]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #66571 from NitzanMordhai/wip-nitzan-prometheus-HealthHistory...
authorNitzanMordhai <97529641+NitzanMordhai@users.noreply.github.com>
Thu, 5 Mar 2026 06:48:39 +0000 (08:48 +0200)
committerGitHub <noreply@github.com>
Thu, 5 Mar 2026 06:48:39 +0000 (08:48 +0200)
mgr/prometheus: Use RLock to fix deadlock in HealthHistory

1  2 
src/pybind/mgr/prometheus/module.py

index 6ebb7ab3ff9d63888ed99bcbd067da39de1e7f92,0d825c42730018ff748fbcf280ae14c9357b2979..4a575fb066b21b8a9bcc0c8888d0bca5079763d8
@@@ -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):