If the water system isn't pressurized (within reason), you could possibly use something like this:
https://www.sparkfun.com/products/11050Just drill a hole in one of the pipes, stick the probe in, and seal with epoxy. You could also put another probe on the return line, so you can see what temperature the water coming back into the heater is.
It says "waterproof", and theres a link to an arduino code example. Since it doesn't give specifics, it might not be be designed to work underwater, but you never know until you try....