]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: fix duplicate grafana panels when on mgr failover 56929/head
authorAvan Thakkar <athakkar@redhat.com>
Tue, 2 Apr 2024 09:45:48 +0000 (15:15 +0530)
committerAvan Thakkar <athakkar@redhat.com>
Wed, 19 Jun 2024 06:52:40 +0000 (12:22 +0530)
Fixes: https://tracker.ceph.com/issues/64970
Signed-off-by: Avan Thakkar <athakkar@redhat.com>
(cherry picked from commit e6ff23d1297cbcf5da030178c53e14a6b6ce5f43)

Conflicts:
src/pybind/mgr/cephadm/templates/services/prometheus/prometheus.yml.j2
src/pybind/mgr/cephadm/tests/test_services.py

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 b6a407e091e69adb271ee99104924ea38103cf30..32ac92e56bf8252e0e08936646cf1302971bca0f 100644 (file)
@@ -696,6 +696,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
 
@@ -855,6 +858,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: