From 416ae8214f2adbb5038a37506f19005ee5a78084 Mon Sep 17 00:00:00 2001
From: Nacho Barrientos <nacho.barrientos@cern.ch>
Date: Wed, 12 Mar 2025 16:06:58 +0100
Subject: [PATCH] Cover with a test that extraLabelsForMetrics are honoured

---
 tests/prometheus/prometheus.yaml | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/tests/prometheus/prometheus.yaml b/tests/prometheus/prometheus.yaml
index e10f24a..958e8ca 100644
--- a/tests/prometheus/prometheus.yaml
+++ b/tests/prometheus/prometheus.yaml
@@ -38,6 +38,18 @@ tests:
       - equal:
           path: spec.externalLabels.k8s_cluster_name
           value: test
+  - it: extra labels for metrics are honoured
+    set:
+      kubernetes.clusterName: test
+      metrics.prometheus.server.extraLabelsForMetrics:
+        test: bar
+    asserts:
+      - equal:
+          path: spec.externalLabels.k8s_cluster_name
+          value: test
+      - equal:
+          path: spec.externalLabels.test
+          value: bar
   - it: should be deployed with no remoteWrites if no fluentbit is available
     set:
       kubernetes.clusterName: test
-- 
GitLab