From 07bac454cb4c322eeda5015f6ed2bf5330920709 Mon Sep 17 00:00:00 2001 From: Alex Souslik Date: Mon, 8 Jan 2024 18:43:56 +0200 Subject: [PATCH] [prometheus-rabbitmq-exporter] add target labels support (#3939) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [prometheus-rabbitmq-exporter] add target labels support Signed-off-by: alex-souslik-hs * change if to with Signed-off-by: alex-souslik-hs --------- Signed-off-by: alex-souslik-hs Signed-off-by: Alex Souslik Co-authored-by: MH Co-authored-by: André Bauer --- charts/prometheus-rabbitmq-exporter/Chart.yaml | 2 +- charts/prometheus-rabbitmq-exporter/templates/service.yaml | 3 +++ .../templates/servicemonitor.yaml | 4 ++++ charts/prometheus-rabbitmq-exporter/values.yaml | 4 ++++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/charts/prometheus-rabbitmq-exporter/Chart.yaml b/charts/prometheus-rabbitmq-exporter/Chart.yaml index 056901f6c9b8..0c01048e9abe 100644 --- a/charts/prometheus-rabbitmq-exporter/Chart.yaml +++ b/charts/prometheus-rabbitmq-exporter/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: Rabbitmq metrics exporter for prometheus name: prometheus-rabbitmq-exporter -version: 1.9.0 +version: 1.10.0 appVersion: v0.29.0 home: https://github.com/kbudde/rabbitmq_exporter sources: diff --git a/charts/prometheus-rabbitmq-exporter/templates/service.yaml b/charts/prometheus-rabbitmq-exporter/templates/service.yaml index 98da08487c6b..394c9cbdfee4 100644 --- a/charts/prometheus-rabbitmq-exporter/templates/service.yaml +++ b/charts/prometheus-rabbitmq-exporter/templates/service.yaml @@ -7,6 +7,9 @@ metadata: chart: {{ template "prometheus-rabbitmq-exporter.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.service.labels }} + {{ toYaml . | indent 4 }} + {{- end }} spec: type: {{ .Values.service.type }} ports: diff --git a/charts/prometheus-rabbitmq-exporter/templates/servicemonitor.yaml b/charts/prometheus-rabbitmq-exporter/templates/servicemonitor.yaml index 72c5a96df940..f59c70a3713d 100644 --- a/charts/prometheus-rabbitmq-exporter/templates/servicemonitor.yaml +++ b/charts/prometheus-rabbitmq-exporter/templates/servicemonitor.yaml @@ -34,5 +34,9 @@ spec: {{- range .Values.prometheus.monitor.namespace }} - {{ . }} {{- end }} + {{- with .Values.prometheus.monitor.targetLabels }} + targetLabels: + {{- toYaml . | nindent 4 }} + {{- end }} {{- end }} {{- end }} diff --git a/charts/prometheus-rabbitmq-exporter/values.yaml b/charts/prometheus-rabbitmq-exporter/values.yaml index 31f6f2b5c2d2..029e1e9b95e4 100644 --- a/charts/prometheus-rabbitmq-exporter/values.yaml +++ b/charts/prometheus-rabbitmq-exporter/values.yaml @@ -12,6 +12,8 @@ service: type: ClusterIP externalPort: 9419 internalPort: 9419 + labels: {} + resources: {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little @@ -74,6 +76,8 @@ prometheus: namespace: [] metricRelabelings: [] relabelings: [] + targetLabels: [] + rules: enabled: false additionalLabels: {}