From: Nitzan Mordechai Date: Thu, 11 Dec 2025 06:32:31 +0000 (+0000) Subject: mgr/prometheus: metrics header for standby module X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6c5af28253b365aa0ea2d3abeab07a45c06af41f;p=ceph-ci.git mgr/prometheus: metrics header for standby module PR #65245 drop the header set for standby module, we should still have it. Fixes: https://tracker.ceph.com/issues/74149 Signed-off-by: Nitzan Mordechai --- diff --git a/src/pybind/mgr/cephadm/templates/services/prometheus/prometheus.yml.j2 b/src/pybind/mgr/cephadm/templates/services/prometheus/prometheus.yml.j2 index 2afbf606af2..2f584bbceb2 100644 --- a/src/pybind/mgr/cephadm/templates/services/prometheus/prometheus.yml.j2 +++ b/src/pybind/mgr/cephadm/templates/services/prometheus/prometheus.yml.j2 @@ -45,6 +45,7 @@ scrape_configs: {% for service, urls in service_discovery_cfg.items() %} {% if service != 'alertmanager' %} - job_name: '{{ service }}' + fallback_scrape_protocol: PrometheusText0.0.4 relabel_configs: - source_labels: [__address__] target_label: cluster diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index f5c8f778521..53d7f889dd5 100644 --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@ -2330,6 +2330,7 @@ class StandbyModule(MgrStandbyModule): @cherrypy.expose def metrics(self) -> str: + cherrypy.response.headers['Content-Type'] = 'text/plain; charset=utf-8' return '' cherrypy.tree.mount(Root(), '/', {})