From: NitzanMordhai <97529641+NitzanMordhai@users.noreply.github.com> Date: Thu, 5 Mar 2026 06:48:39 +0000 (+0200) Subject: Merge pull request #66571 from NitzanMordhai/wip-nitzan-prometheus-HealthHistory... X-Git-Tag: testing/wip-pdonnell-testing-20260306.175013~24 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7d9f8f3b5f2112299079105c5582c6208348002d;p=ceph-ci.git Merge pull request #66571 from NitzanMordhai/wip-nitzan-prometheus-HealthHistory-deadlock mgr/prometheus: Use RLock to fix deadlock in HealthHistory --- 7d9f8f3b5f2112299079105c5582c6208348002d diff --cc src/pybind/mgr/prometheus/module.py index 6ebb7ab3ff9,0d825c42730..4a575fb066b --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@@ -1050,15 -1073,9 +1098,16 @@@ class Module(MgrModule, OrchestratorCli # 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, ( @@@ -2305,16 -2331,10 +2355,17 @@@ class StandbyModule(MgrStandbyModule) @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):