From cfe3d28d3da99b3c450099b4555ea3f2006f8750 Mon Sep 17 00:00:00 2001 From: Miller Date: Fri, 17 Nov 2023 04:19:16 -0500 Subject: [PATCH] [prometheus-blackbox-exporter] add action=replace to metricsRelabelings (#3857) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 https://github.com/prometheus-community/helm-charts/issues/3626 Signed-off-by: Alex Miller Signed-off-by: André Bauer Co-authored-by: André Bauer --- charts/prometheus-blackbox-exporter/Chart.yaml | 2 +- .../prometheus-blackbox-exporter/templates/servicemonitor.yaml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/charts/prometheus-blackbox-exporter/Chart.yaml b/charts/prometheus-blackbox-exporter/Chart.yaml index 9584e0bab43d..1192dc1bd2dd 100644 --- a/charts/prometheus-blackbox-exporter/Chart.yaml +++ b/charts/prometheus-blackbox-exporter/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 description: Prometheus Blackbox Exporter name: prometheus-blackbox-exporter -version: 8.6.0 +version: 8.6.1 appVersion: v0.24.0 home: https://github.com/prometheus/blackbox_exporter sources: diff --git a/charts/prometheus-blackbox-exporter/templates/servicemonitor.yaml b/charts/prometheus-blackbox-exporter/templates/servicemonitor.yaml index 8ea1d542ad32..9386944ff1a2 100644 --- a/charts/prometheus-blackbox-exporter/templates/servicemonitor.yaml +++ b/charts/prometheus-blackbox-exporter/templates/servicemonitor.yaml @@ -37,12 +37,15 @@ spec: - sourceLabels: [instance] targetLabel: instance replacement: {{ .url }} + action: replace - sourceLabels: [target] targetLabel: target replacement: {{ .name }} + action: replace {{- range $targetLabel, $replacement := .additionalMetricsRelabels | default $.Values.serviceMonitor.defaults.additionalMetricsRelabels }} - targetLabel: {{ $targetLabel | quote }} replacement: {{ $replacement | quote }} + action: replace {{- end }} {{- if concat (.additionalRelabeling | default list) $.Values.serviceMonitor.defaults.additionalRelabeling }} relabelings: