Skip to content

Commit e6ff23d

Browse files
committed
mgr/dashboard: fix duplicate grafana panels when on mgr failover
Fixes: https://tracker.ceph.com/issues/64970 Signed-off-by: Avan Thakkar <[email protected]>
1 parent e5c885f commit e6ff23d

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
@@ -736,6 +736,9 @@ def test_prometheus_config_security_disabled(self, _run_cephadm, cephadm_module:
736736
- source_labels: [__address__]
737737
target_label: cluster
738738
replacement: fsid
739+
- source_labels: [instance]
740+
target_label: instance
741+
replacement: 'ceph_cluster'
739742
http_sd_configs:
740743
- url: http://[::1]:8765/sd/prometheus/sd-config?service=mgr-prometheus
741744
@@ -895,6 +898,10 @@ def gen_cert(host, addr):
895898
tls_config:
896899
ca_file: mgr_prometheus_cert.pem
897900
honor_labels: true
901+
relabel_configs:
902+
- source_labels: [instance]
903+
target_label: instance
904+
replacement: 'ceph_cluster'
898905
http_sd_configs:
899906
- url: https://[::1]:8765/sd/prometheus/sd-config?service=mgr-prometheus
900907
basic_auth:

0 commit comments

Comments
 (0)