rancher-charts/packages/rancher-monitoring/rancher-kube-state-metrics/generated-changes/patch/templates/servicemonitor.yaml.patch

22 lines
820 B
Diff
Raw Normal View History

--- charts-original/templates/servicemonitor.yaml
+++ charts/templates/servicemonitor.yaml
@@ -35,6 +35,18 @@
{{- if .Values.prometheus.monitor.metricRelabelings }}
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.prometheus.monitor.relabelings }}
relabelings: