A magnetic flowmeter comprising: a pipe having a non-conductive liner on an inner surface; a field coil adjacent to the pipe and configured to generate a magnetic field across a fluid flowing through the pipe; a first electrode located in a first tunnel passing through the pipe and into the non- conductive liner, and a second electrode located in a second tunnel passing through the pipe and into the non-conductive liner, the first electrode and the second electrode configured to sense a voltage induced by the magnetic field across the fluid flowing through the pipe; a first sealed compartment attached to an outer surface of the pipe, the first sealed compartment enclosing at least one of the field coil,the first electrode, and the second electrode; a first MEMS relative humidity probe or sensor located within the sealed compartment and configured to sense relative humidity in the first sealed compartment; and an electronics compartment having transmitter circuitry connected to the field coil, the first electrode, the second electrode, and the first MEMS relative humidity probe or sensor, wherein, the first sealed compartment comprises a magnetics compartment surrounding the pipe and enclosing the field coil,the first electrode, the second electrode, and the vapor sensor, wherein the transmitter circuitry generates a first output representing a flow rate of the fluid as a function of the voltage sensed by the first electrode and the second electrode, and generates a second output based upon the relative humidity sensed by the first MEMS relative humidity probe or sensor, the second output providing an alert indicating vapor permeation in the first sealed compartment to prompt a user to replace the magnetic flowmeter when a threshold level of humidity is sensed in the first sealed compartment. a pipe having a non-conductive liner on an inner surface; a field coil adjacent to the pipe and configured to generate a magnetic field across a fluid flowing through the pipe; a first electrode located in a first tunnel passing through the pipe and into the non- conductive liner, and a second electrode located in a second tunnel passing through the pipe and into the non-conductive liner, the first electrode and the second electrode configured to sense a voltage induced by the magnetic field across the fluid flowing through the pipe; a first sealed compartment attached to an outer surface of the pipe, the first sealed compartment enclosing at least one of the field coil,the first electrode, and the second electrode; a first MEMS relative humidity probe or sensor located within the sealed compartment and configured to sense relative humidity in the first sealed compartment; and an electronics compartment having transmitter circuitry connected to the field coil, the first electrode, the second electrode, and the first MEMS relative humidity probe or sensor, wherein, the first sealed compartment comprises a magnetics compartment surrounding the pipe and enclosing the field coil,the first electrode, the second electrode, and the vapor sensor, wherein the transmitter circuitry generates a first output representing a flow rate of the fluid as a function of the voltage sensed by the first electrode and the second electrode, and generates a second output based upon the relative humidity sensed by the first MEMS relative humidity probe or sensor, the second output providing an alert indicating vapor permeation in the first sealed compartment to prompt a user to replace the magnetic flowmeter when a threshold level of humidity is sensed in the first sealed compartment.