Skip to content

Commit

Permalink
[prometheus-mysql-exporter]: add default relabeling for multiple target
Browse files Browse the repository at this point in the history
Signed-off-by: Remy Mollandin <[email protected]>
  • Loading branch information
Remy-Mollandin-SK5 committed Oct 17, 2023
1 parent d039d96 commit 76fa4dd
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions charts/prometheus-mysql-exporter/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,18 @@ spec:
{{- if $.Values.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ $.Values.serviceMonitor.scrapeTimeout }}
{{- end }}
{{- if $.Values.serviceMonitor.metricRelabelings }}
metricRelabelings: {{ toYaml $.Values.serviceMonitor.metricRelabelings | nindent 8 }}
{{- end }}
metricRelabelings:
- action: replace
replacement: {{ .endpoint }}
sourceLabels: [instance]
targetLabel: instance
- action: replace
replacement: {{ .name }}
sourceLabels: [target]
targetLabel: target
{{- if $.Values.serviceMonitor.metricRelabelings -}}
{{ toYaml $.Values.serviceMonitor.metricRelabelings | nindent 8 }}
{{- end }}
{{- if $.Values.serviceMonitor.relabelings }}
relabelings: {{ toYaml $.Values.serviceMonitor.relabelings | nindent 8 }}
{{- end }}
Expand Down

0 comments on commit 76fa4dd

Please sign in to comment.