--- charts-original/templates/servicemonitor.yaml +++ charts/templates/servicemonitor.yaml @@ -30,6 +30,20 @@ tlsConfig: {{- toYaml .Values.serviceMonitor.tlsConfig | nindent 6 }} {{- end }} + metricRelabelings: + {{- if .Values.serviceMonitor.metricRelabelings }} + {{- toYaml .Values.serviceMonitor.metricRelabelings | nindent 6 }} + {{- 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.serviceMonitor.relabelings }} relabelings: {{- toYaml .Values.serviceMonitor.relabelings | nindent 4 }}