I assume you want to measure the temp of the metal.
If there is no mechanical stress I have had success attaching the little “transistor” types to copper pipe with a blob of heatsink compound (to get good heat transfer). The wiring has to be fixed securely without any stress on leads or device. This works OK if left alone.
You can go down the thermocouple path but you will HAVE TO USE an interface to process the very small voltage produced (40µV per ºC). Also have to apply “cold junction compensation” which is very important. Without this the error could be anything up to the value of ambient temperature.These interface units take care of this. “K” type would probably be the most common. It has a yellow (+) and red (-) wire. These colours usually indicate which type of thermocouple it is, there are many. I think some interfaces don’t take kindly to earthing so you may have to insulate from metal with thin piece of mica like transistor insulators and some heat sink compound.