# health check is not active, so give it a default of 0
self.metrics[path].set(0)
+ for alert_id in ('CEPHADM_CERT_ERROR', 'CEPHADM_CERT_WARNING'):
+ if alert_id in active_names:
+ self._process_cert_health_detail(alert_id, active_healthchecks[alert_id])
+
self.health_history.check(health)
+
for name, info in self.health_history.healthcheck.items():
+ # Skip CEPHADM_CERT_ERROR and CEPHADM_CERT_WARNING as they're handled specially above with message details
+ if name in ('CEPHADM_CERT_ERROR', 'CEPHADM_CERT_WARNING'):
+ continue
v = 1 if info.active else 0
self.metrics['health_detail'].set(
v, (
@cherrypy.expose
def metrics(self) -> str:
+ cherrypy.response.headers['Content-Type'] = 'text/plain; charset=utf-8'
return ''
- cherrypy.tree.mount(Root(), '/', {})
+ config = {
+ '/': {
+ 'response.headers.server': 'Ceph-Prometheus',
+ 'engine.autoreload.on': False,
+ }
+ }
+ tree = _cptree.Tree()
+ tree.mount(Root(), '/', config=config)
# Wait for port to be available before starting
if not _wait_for_port_available(self.log, server_addr, server_port):