A sensor device for welding, comprising at least: a sensor unit configured to measure states of workpieces to be welded together or a distance to the workpieces; and a container including a housing portion and a shielding portion, the housing portion being adapted to house the sensor unit and having formed therein a gas flow channel that passes a gas, and the shielding portion being adapted to shield radiation heat directed toward the housing portion among radiation heat generated while the workpieces are welded together, wherein: the shielding portion is inclined with respect to a flow direction of a gas passing through an outlet port of the gas flow channel such that the gas discharged from the outlet port is blown to the shielding portion and thus flows to a side opposite to the side where the workpieces are to be welded together, the sensor unit includes at least a detection unit that detects a detection light beam (L1, L2) generated by a projection device, and reflected from surfaces of workpieces to be welded together, the container includes a case body adapted to house the sensor unit as the housing portion, the case body having formed therein at least one pass-through portion that passes a detection light beam directed toward the detection unit, and a protective cover including a protective plate that transmits the detection light beam, the protective cover being attached to the case body such that the protective plate covers the pass-through portion, and the gas flow channel is formed such that gases are blown toward the protective plate from opposite positions around the protective plate on the side of the outlet port, and the gases blown to the protective plate are directed toward the outlet port. a sensor unit configured to measure states of workpieces to be welded together or a distance to the workpieces; and a container including a housing portion and a shielding portion, the housing portion being adapted to house the sensor unit and having formed therein a gas flow channel that passes a gas, and the shielding portion being adapted to shield radiation heat directed toward the housing portion among radiation heat generated while the workpieces are welded together, wherein: the shielding portion is inclined with respect to a flow direction of a gas passing through an outlet port of the gas flow channel such that the gas discharged from the outlet port is blown to the shielding portion and thus flows to a side opposite to the side where the workpieces are to be welded together, the sensor unit includes at least a detection unit that detects a detection light beam (L1, L2) generated by a projection device, and reflected from surfaces of workpieces to be welded together, the container includes a case body adapted to house the sensor unit as the housing portion, the case body having formed therein at least one pass-through portion that passes a detection light beam directed toward the detection unit, and a protective cover including a protective plate that transmits the detection light beam, the protective cover being attached to the case body such that the protective plate covers the pass-through portion, and the gas flow channel is formed such that gases are blown toward the protective plate from opposite positions around the protective plate on the side of the outlet port, and the gases blown to the protective plate are directed toward the outlet port. the shielding portion is inclined with respect to a flow direction of a gas passing through an outlet port of the gas flow channel such that the gas discharged from the outlet port is blown to the shielding portion and thus flows to a side opposite to the side where the workpieces are to be welded together, the sensor unit includes at least a detection unit that detects a detection light beam (L1, L2) generated by a projection device, and reflected from surfaces of workpieces to be welded together, the container includes a case body adapted to house the sensor unit as the housing portion, the case body having formed therein at least one pass-through portion that passes a detection light beam directed toward the detection unit, and a protective cover including a protective plate that transmits the detection light beam, the protective cover being attached to the case body such that the protective plate covers the pass-through portion, and a case body adapted to house the sensor unit as the housing portion, the case body having formed therein at least one pass-through portion that passes a detection light beam directed toward the detection unit, and a protective cover including a protective plate that transmits the detection light beam, the protective cover being attached to the case body such that the protective plate covers the pass-through portion, and the gas flow channel is formed such that gases are blown toward the protective plate from opposite positions around the protective plate on the side of the outlet port, and the gases blown to the protective plate are directed toward the outlet port.