What is this metal cylinder with a connected wire that i found in my apparement
That is remote sensor and capillary tube for a nearby radiator or radiant floor circuit's actuator "thermostat".

Example product: Danfoss RA2972 https://store.danfoss.com/en/Heating-and-District-Energy/Radiator-Thermostats/Radiator-Sensors/Room-sensor-mTRV/RA-2000-Sensors/p/013G2972 the product pictures does not show the tube between the actuator and the sensing bulb.

I've no idea whether the gas/liquid filling of the capillary system is harmful or not.