Skip to content

Commit a654945

Browse files
authored
Merge pull request ceph#56626 from rhcs-dashboard/fix-prometheus-conf-mgr-failover
mgr/dashboard: fix duplicate grafana panels when on mgr failover Reviewed-by: Adam King <[email protected]> Reviewed-by: Nizamudeen A <[email protected]>
2 parents 117f85b + e6ff23d commit a654945

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/pybind/mgr/cephadm/templates/services/prometheus/prometheus.yml.j2

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ scrape_configs:
4141
tls_config:
4242
ca_file: mgr_prometheus_cert.pem
4343
honor_labels: true
44+
relabel_configs:
45+
- source_labels: [instance]
46+
target_label: instance
47+
replacement: 'ceph_cluster'
4448
http_sd_configs:
4549
- url: {{ mgr_prometheus_sd_url }}
4650
basic_auth:
@@ -54,6 +58,9 @@ scrape_configs:
5458
- source_labels: [__address__]
5559
target_label: cluster
5660
replacement: {{ cluster_fsid }}
61+
- source_labels: [instance]
62+
target_label: instance
63+
replacement: 'ceph_cluster'
5764
http_sd_configs:
5865
- url: {{ mgr_prometheus_sd_url }}
5966
{% endif %}

src/pybind/mgr/cephadm/tests/test_services.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,9 @@ def test_prometheus_config_security_disabled(self, _run_cephadm, cephadm_module:
744744
- source_labels: [__address__]
745745
target_label: cluster
746746
replacement: fsid
747+
- source_labels: [instance]
748+
target_label: instance
749+
replacement: 'ceph_cluster'
747750
http_sd_configs:
748751
- url: http://[::1]:8765/sd/prometheus/sd-config?service=mgr-prometheus
749752
@@ -904,6 +907,10 @@ def gen_cert(host, addr):
904907
tls_config:
905908
ca_file: mgr_prometheus_cert.pem
906909
honor_labels: true
910+
relabel_configs:
911+
- source_labels: [instance]
912+
target_label: instance
913+
replacement: 'ceph_cluster'
907914
http_sd_configs:
908915
- url: https://[::1]:8765/sd/prometheus/sd-config?service=mgr-prometheus
909916
basic_auth:

0 commit comments

Comments
 (0)