A method and a system for determining analyte content in a fluid in a treatment apparatus. The method comprises positioning a device for treatment in a treatment apparatus. A surface of the device is contacted with a fluid. An analyte content in the fluid is determined based on an electromagnetic property of the fluid following contacting the surface of the device with the fluid. More specifically, an electromagnetic property is measured. The measuring comprises emitting electromagnetic radiation into the fluid in the treatment apparatus and detecting electromagnetic radiation from the fluid. In another aspect, a system comprising a treatment apparatus and a detector for determining the analyte content in the fluid in the treatment apparatus is provided.