Skip to content

Commit

Permalink
[prometheus-snmp-exporter] add action=replace to metricsRelabelings (#…
Browse files Browse the repository at this point in the history
…3858)

This (default) parameter is automatically added by k8s, causing the in-cluster
object to differ from the manifest created by this chart. This discrepancy
causes GitOps tooling to consider the resource out of date, as described in
#3626

Signed-off-by: Alex Miller <[email protected]>
  • Loading branch information
thinkmassive authored Oct 3, 2023
1 parent 272301a commit 57c9e02
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/prometheus-snmp-exporter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
description: Prometheus SNMP Exporter
name: prometheus-snmp-exporter
version: 1.8.0
version: 1.8.1
appVersion: v0.21.0
home: https://github.com/prometheus/snmp_exporter
sources:
Expand Down
3 changes: 3 additions & 0 deletions charts/prometheus-snmp-exporter/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,15 @@ spec:
- sourceLabels: [instance]
targetLabel: instance
replacement: {{ .target }}
action: replace
- sourceLabels: [target]
targetLabel: target
replacement: {{ .name }}
action: replace
{{- range $targetLabel, $replacement := .additionalMetricsRelabels | default $.Values.serviceMonitor.additionalMetricsRelabels }}
- targetLabel: {{ $targetLabel }}
replacement: {{ $replacement }}
action: replace
{{- end }}
{{- if (or .relabelings $.Values.serviceMonitor.relabelings) }}
relabelings:
Expand Down

0 comments on commit 57c9e02

Please sign in to comment.