From d159f09ad8361cd48ae6dfe861b031c4621500ee Mon Sep 17 00:00:00 2001 From: Ryan Dyer Date: Mon, 19 Oct 2020 20:31:17 +0000 Subject: [PATCH] Support additional scrape configuration for the servicemonitor --- charts/kafka-lag-exporter/templates/060-ServiceMonitor.yaml | 3 +++ charts/kafka-lag-exporter/values.yaml | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/charts/kafka-lag-exporter/templates/060-ServiceMonitor.yaml b/charts/kafka-lag-exporter/templates/060-ServiceMonitor.yaml index 77ab0d52..3221c03c 100644 --- a/charts/kafka-lag-exporter/templates/060-ServiceMonitor.yaml +++ b/charts/kafka-lag-exporter/templates/060-ServiceMonitor.yaml @@ -30,4 +30,7 @@ spec: {{- if .Values.prometheus.serviceMonitor.scrapeTimeout }} scrapeTimeout: {{ .Values.prometheus.serviceMonitor.scrapeTimeout }} {{- end }} + {{- if .Values.prometheus.serviceMonitor.additionalConfig }} +{{ toYaml .Values.prometheus.serviceMonitor.additionalConfig | indent 2}} + {{- end }} {{- end }} diff --git a/charts/kafka-lag-exporter/values.yaml b/charts/kafka-lag-exporter/values.yaml index 68603683..88acf313 100644 --- a/charts/kafka-lag-exporter/values.yaml +++ b/charts/kafka-lag-exporter/values.yaml @@ -138,4 +138,8 @@ prometheus: # service monitor label selectors: https://github.com/helm/charts/blob/f5a751f174263971fafd21eee4e35416d6612a3d/stable/prometheus-operator/templates/prometheus/prometheus.yaml#L74 # additionalLabels: # prometheus: k8s + # additionalConfig: + # targetLabels: + # - prometheus + # - app.kubernetes.io/name