From fb060d73a8ea4f517b05928a7a4c2a600e90a4c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Alejandro=20Marug=C3=A1n?= Date: Tue, 12 Jul 2022 19:42:42 +0200 Subject: [PATCH] feat(chart): add `metricRelabelings` and `relabelings` on serviceMonitor (#85) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(chart): add `metricRelabelings` and `relabelings` on serviceMonitor Signed-off-by: Iván Alejandro Marugán --- helm/templates/servicemonitor.yaml | 8 ++++++++ helm/values.yaml | 2 ++ 2 files changed, 10 insertions(+) diff --git a/helm/templates/servicemonitor.yaml b/helm/templates/servicemonitor.yaml index a03d561..ae0f1cc 100644 --- a/helm/templates/servicemonitor.yaml +++ b/helm/templates/servicemonitor.yaml @@ -21,6 +21,14 @@ spec: {{- with .Values.serviceMonitor.scrapeTimeout }} scrapeTimeout: {{ . }} {{- end }} + {{- if .Values.serviceMonitor.metricRelabelings }} + metricRelabelings: + {{- toYaml .Values.serviceMonitor.metricRelabelings | nindent 4 }} + {{- end }} + {{- if .Values.serviceMonitor.relabelings }} + relabelings: + {{- toYaml .Values.serviceMonitor.relabelings | nindent 4 }} + {{- end }} namespaceSelector: matchNames: - {{ .Release.Namespace }} diff --git a/helm/values.yaml b/helm/values.yaml index a942cb5..4ee6f5c 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -14,6 +14,8 @@ serviceMonitor: scrapeTimeout: namespace: additionalLabels: {} + metricRelabelings: [] + relabelings: [] grafanaDashboard: # Specifies whether a Grafana dashboard should be created