A sensor includes: a needle member defining a hollow portion, wherein the needle member comprises a peripheral wall, and a through hole extends through the peripheral wall; an elongated detection member positioned in the hollow portion and extending along a longitudinal direction of the needle member; and at least one protruding portion that protrudes radially inward from the peripheral wall and restricts movement of the detection member in a radial direction.