mirror of https://git.rancher.io/charts
22 lines
820 B
Diff
22 lines
820 B
Diff
--- 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:
|