From 228d33d2a86e4bbd1e8ee5839382dc0182a73add Mon Sep 17 00:00:00 2001 From: Szymon Janczy Date: Mon, 16 Oct 2023 15:52:30 +0200 Subject: [PATCH] [prometheus-smartctl-exporter] Add relabelings to servicemonitor (#3891) * [prometheus-smartctl-exporter] Add relabelings to servicemonitor Signed-off-by: nepomucen * bump chart version to 0.6.1 Signed-off-by: nepomucen * Revert "bump chart version to 0.6.1" This reverts commit 124b85cd2256ee8cb8d416a883ba5b41f57254cc. Signed-off-by: nepomucen * Bump chart's minor version instead of patch version Signed-off-by: nepomucen * Use with to control variable scoping Signed-off-by: nepomucen --------- Signed-off-by: nepomucen --- charts/prometheus-smartctl-exporter/Chart.yaml | 2 +- .../prometheus-smartctl-exporter/templates/servicemonitor.yaml | 3 +++ charts/prometheus-smartctl-exporter/values.yaml | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/charts/prometheus-smartctl-exporter/Chart.yaml b/charts/prometheus-smartctl-exporter/Chart.yaml index e54677110ca3..e1236b481dbf 100644 --- a/charts/prometheus-smartctl-exporter/Chart.yaml +++ b/charts/prometheus-smartctl-exporter/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.6.0 +version: 0.7.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/prometheus-smartctl-exporter/templates/servicemonitor.yaml b/charts/prometheus-smartctl-exporter/templates/servicemonitor.yaml index db5c50a01ca9..af32a18bf72f 100644 --- a/charts/prometheus-smartctl-exporter/templates/servicemonitor.yaml +++ b/charts/prometheus-smartctl-exporter/templates/servicemonitor.yaml @@ -18,6 +18,9 @@ spec: port: http scheme: http scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }} +{{- with .Values.serviceMonitor.relabelings }} + relabelings: {{ toYaml . | nindent 8 }} +{{- end }} namespaceSelector: matchNames: - {{ .Release.Namespace }} diff --git a/charts/prometheus-smartctl-exporter/values.yaml b/charts/prometheus-smartctl-exporter/values.yaml index 571a403acab9..a42774066673 100644 --- a/charts/prometheus-smartctl-exporter/values.yaml +++ b/charts/prometheus-smartctl-exporter/values.yaml @@ -25,6 +25,8 @@ serviceMonitor: # release: prometheus-operator interval: 60s scrapeTimeout: 30s + # Set relabel_configs as per https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config + relabelings: [] prometheusRules: enabled: false