]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard: fix duplicate grafana panels when on mgr failover
authorAvan Thakkar <athakkar@redhat.com>
Tue, 2 Apr 2024 09:45:48 +0000 (15:15 +0530)
committerAvan Thakkar <athakkar@redhat.com>
Wed, 3 Apr 2024 15:24:48 +0000 (20:54 +0530)
Fixes: https://tracker.ceph.com/issues/64970
Signed-off-by: Avan Thakkar <athakkar@redhat.com>
src/pybind/mgr/cephadm/templates/services/prometheus/prometheus.yml.j2
src/pybind/mgr/cephadm/tests/test_services.py

index 931913668ae8cecdca2804b183d86147378ef702..faccc8f6de26cf2b1d0427328c02d7c06ae588ec 100644 (file)
@@ -41,6 +41,10 @@ scrape_configs:
     tls_config:
       ca_file: mgr_prometheus_cert.pem
     honor_labels: true
+    relabel_configs:
+    - source_labels: [instance]
+      target_label: instance
+      replacement: 'ceph_cluster'
     http_sd_configs:
     - url: {{ mgr_prometheus_sd_url }}
       basic_auth:
@@ -54,6 +58,9 @@ scrape_configs:
     - source_labels: [__address__]
       target_label: cluster
       replacement: {{ cluster_fsid }}
+    - source_labels: [instance]
+      target_label: instance
+      replacement: 'ceph_cluster'
     http_sd_configs:
     - url: {{ mgr_prometheus_sd_url }}
 {% endif %}
index fd48e09636e5c21f66ce0b56409b825cb8bdec7a..05f402b309a401973e0332105b3ca9f01735a258 100644 (file)
@@ -736,6 +736,9 @@ class TestMonitoring:
                     - source_labels: [__address__]
                       target_label: cluster
                       replacement: fsid
+                    - source_labels: [instance]
+                      target_label: instance
+                      replacement: 'ceph_cluster'
                     http_sd_configs:
                     - url: http://[::1]:8765/sd/prometheus/sd-config?service=mgr-prometheus
 
@@ -895,6 +898,10 @@ class TestMonitoring:
                     tls_config:
                       ca_file: mgr_prometheus_cert.pem
                     honor_labels: true
+                    relabel_configs:
+                    - source_labels: [instance]
+                      target_label: instance
+                      replacement: 'ceph_cluster'
                     http_sd_configs:
                     - url: https://[::1]:8765/sd/prometheus/sd-config?service=mgr-prometheus
                       basic_auth: