From 6e1b64438c8d4f8ceac557c85bc04845ce645393 Mon Sep 17 00:00:00 2001 From: Geet Samra Date: Fri, 12 May 2023 15:18:04 -0700 Subject: [PATCH] kube-state-metrics: updating metricRelabelings to include cluster names --- .../patch/templates/servicemonitor.yaml.patch | 41 ++++++++++++------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/packages/rancher-monitoring/rancher-kube-state-metrics/generated-changes/patch/templates/servicemonitor.yaml.patch b/packages/rancher-monitoring/rancher-kube-state-metrics/generated-changes/patch/templates/servicemonitor.yaml.patch index 7cfac35b2..e63e24d8d 100644 --- a/packages/rancher-monitoring/rancher-kube-state-metrics/generated-changes/patch/templates/servicemonitor.yaml.patch +++ b/packages/rancher-monitoring/rancher-kube-state-metrics/generated-changes/patch/templates/servicemonitor.yaml.patch @@ -1,21 +1,34 @@ --- charts-original/templates/servicemonitor.yaml +++ charts/templates/servicemonitor.yaml -@@ -35,6 +35,18 @@ - {{- if .Values.prometheus.monitor.metricRelabelings }} +@@ -32,9 +32,19 @@ + {{- if .Values.prometheus.monitor.honorLabels }} + honorLabels: true + {{- end }} +- {{- if .Values.prometheus.monitor.metricRelabelings }} metricRelabelings: ++ {{- if .Values.prometheus.monitor.metricRelabelings }} {{- toYaml .Values.prometheus.monitor.metricRelabelings | nindent 8 }} -+ {{ if .Values.global.cattle.clusterId }} -+ - sourceLabels: [__address__] -+ targetLabel: cluster_id -+ replacement: {{ .Values.global.cattle.clusterId }} -+ {{- end }} -+ {{ else }} -+ {{ if .Values.global.cattle.clusterId }} -+ metricRelabelings: -+ - sourceLabels: [__address__] -+ targetLabel: cluster_id -+ replacement: {{ .Values.global.cattle.clusterId }} -+ {{- end }} ++ {{- end }} ++ {{ if .Values.global.cattle.clusterId }} ++ - sourceLabels: [__address__] ++ targetLabel: cluster_id ++ replacement: {{ .Values.global.cattle.clusterId }} ++ {{- end }} ++ {{ if .Values.global.cattle.clusterName }} ++ - sourceLabels: [__address__] ++ targetLabel: cluster_name ++ replacement: {{ .Values.global.cattle.clusterName }} {{- end }} {{- if .Values.prometheus.monitor.relabelings }} relabelings: +@@ -61,10 +71,6 @@ + {{- if .Values.prometheus.monitor.honorLabels }} + honorLabels: true + {{- end }} +- {{- if .Values.prometheus.monitor.metricRelabelings }} +- metricRelabelings: +- {{- toYaml .Values.prometheus.monitor.metricRelabelings | nindent 8 }} +- {{- end }} + {{- if .Values.prometheus.monitor.relabelings }} + relabelings: + {{- toYaml .Values.prometheus.monitor.relabelings | nindent 8 }}