This is a small device called a reed switch. When the device is exposed to a magnetic field, the two ferrous materials inside the switch pull together and the switch closes.
When the magnetic field is removed, the reeds separate and the switch opens. This makes for a great non-contact switch
Glass Length: 14mm Glass Diameter: 2mm Total Length: 45mm Switching Voltage: 300 VDC Switching Voltage: 300 VDC Contact Rating: 10W Switching Current: 0.55 A Operate time : 0.45 ms Bounce time: 0.25 ms Release time: 0.35 ms Resonant Frequency: 5000 HZ Operating Frequency: 400 HZ Pull in Value: 20-70 AT Min. Drop out Value: 4 AT Contact Capacitance: 0.5 pF Electrical Life: 50mV-10μA-1x106