An implantable medical device comprising: a substrate defining wells ; a first chemical sensor and a second chemical sensor disposed within separate wells of the substrate; the first chemical sensor and the second chemical sensor configured to detect one or more analytes, each of the first chemical sensor and second chemical sensor comprising a sensing element ; a first bioerodible masking layer disposed over the second chemical sensor and sealing off the second chemical sensor, the first bioerodible masking layer comprising a first material having a first erosion rate; and a protective planarization layer disposed over at least one of the first chemical sensor and the second chemical sensor such that the outermost surface of the medical device over the first sensor is flush with the outermost surface of the medical device over the second sensor; the planarization layer comprising a second material having an erosion rate that is faster than the erosion rate of the first bioerodible masking layer, and a detector unit comprising a processor, the detector unit being configured to monitor an operational status of the at least first chemical sensor and second chemical sensor, and wherein the detector unit is further configured to periodically evaluate the second chemical sensor status to monitor the sensed concentration of the analyte in order to assess the erosion status of the first bioerodible masking layer. a substrate defining wells ; a first chemical sensor and a second chemical sensor disposed within separate wells of the substrate; the first chemical sensor and the second chemical sensor configured to detect one or more analytes, each of the first chemical sensor and second chemical sensor comprising a sensing element ; a first bioerodible masking layer disposed over the second chemical sensor and sealing off the second chemical sensor, the first bioerodible masking layer comprising a first material having a first erosion rate; and a protective planarization layer disposed over at least one of the first chemical sensor and the second chemical sensor such that the outermost surface of the medical device over the first sensor is flush with the outermost surface of the medical device over the second sensor; the planarization layer comprising a second material having an erosion rate that is faster than the erosion rate of the first bioerodible masking layer, and a detector unit comprising a processor, the detector unit being configured to monitor an operational status of the at least first chemical sensor and second chemical sensor, and wherein the detector unit is further configured to periodically evaluate the second chemical sensor status to monitor the sensed concentration of the analyte in order to assess the erosion status of the first bioerodible masking layer. a second material having an erosion rate that is faster than the erosion rate of the first bioerodible masking layer, and a detector unit comprising a processor, the detector unit being configured to monitor an operational status of the at least first chemical sensor and second chemical sensor, and wherein the detector unit is further configured to periodically evaluate the second chemical sensor status to monitor the sensed concentration of the analyte in order to assess the erosion status of the first bioerodible masking layer. <EOS>