]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
mgr/prometheus: prune stale health checks, compress output
authorNitzan Mordechai <nmordech@redhat.com>
Wed, 20 Aug 2025 14:50:40 +0000 (14:50 +0000)
committerNitzan Mordechai <nmordech@redhat.com>
Wed, 8 Oct 2025 06:53:03 +0000 (06:53 +0000)
commitd0022cd2ab9d45a9945ca10f6f6599670deed739
tree2a43bdaf7f39a88e2410c20ed426f9773eef5411
parentaf633b0c80ad9b2b5ead75c56dc70daf7a3efd36
mgr/prometheus: prune stale health checks, compress output

This patch introduces several improvements to the Prometheus module:

 - Introduces `HealthHistory._prune()` to drop stale and inactive health checks.
  Limits the in-memory healthcheck dict to a configurable max_entries (default 1000).
  TTL for stale entries is configurable via `healthcheck_history_stale_ttl` (default 3600s).

 - Refactors HealthHistory.check() to use a unified iteration over known and current checks,
  improving concurrency and minimizing redundant updates.

 - Use cherrypy.tools.gzip instead of manual gzip.compress() for cleaner
  HTTP compression with proper header handling and client negotiation.

 - Introduces new module options:
    - `healthcheck_history_max_entries`

 - Add proper error handling for CherryPy engine startup failures
 - Remove os._exit monkey patch in favor of proper exception handling
 - Remove manual Content-Type header setting (CherryPy handles automatically)

Fixes: https://tracker.ceph.com/issues/68989
Signed-off-by: Nitzan Mordechai <nmordech@redhat.com>
doc/mgr/prometheus.rst
src/pybind/mgr/prometheus/module.py