From e76ba352edb091358aae8933c92e28a47efcb7c2 Mon Sep 17 00:00:00 2001 From: Rico Berger Date: Mon, 4 May 2020 15:14:26 +0200 Subject: [PATCH] [stable/elasticsearch-exporter] Add options to set relabel configuration for metrics (#21636) * Add options to set relabel configuration for metrics Signed-off-by: ricoberger * Use consistent indentation Signed-off-by: ricoberger --- stable/elasticsearch-exporter/Chart.yaml | 2 +- stable/elasticsearch-exporter/README.md | 1 + stable/elasticsearch-exporter/templates/servicemonitor.yaml | 4 ++++ stable/elasticsearch-exporter/values.yaml | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/stable/elasticsearch-exporter/Chart.yaml b/stable/elasticsearch-exporter/Chart.yaml index d187ba216507..a2757bc085e2 100644 --- a/stable/elasticsearch-exporter/Chart.yaml +++ b/stable/elasticsearch-exporter/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: Elasticsearch stats exporter for Prometheus name: elasticsearch-exporter -version: 3.2.0 +version: 3.3.0 kubeVersion: ">=1.10.0-0" appVersion: 1.1.0 home: https://github.com/justwatchcom/elasticsearch_exporter diff --git a/stable/elasticsearch-exporter/README.md b/stable/elasticsearch-exporter/README.md index 14039783bd80..cfb3f9845b40 100644 --- a/stable/elasticsearch-exporter/README.md +++ b/stable/elasticsearch-exporter/README.md @@ -100,6 +100,7 @@ Parameter | Description | Default `serviceMonitor.interval` | Interval at which metrics should be scraped | `10s` `serviceMonitor.scrapeTimeout` | Timeout after which the scrape is ended | `10s` `serviceMonitor.scheme` | Scheme to use for scraping | `http` +`serviceMonitor.relabelings` | Relabel configuration for the metrics | `[]` `prometheusRule.enabled` | If true, a PrometheusRule CRD is created for a prometheus operator | `false` `prometheusRule.namespace` | If set, the PrometheusRule will be installed in a different namespace | `""` `prometheusRule.labels` | Labels for prometheus operator | `{}` diff --git a/stable/elasticsearch-exporter/templates/servicemonitor.yaml b/stable/elasticsearch-exporter/templates/servicemonitor.yaml index 69d7e0ace7cd..e4946d681f4e 100644 --- a/stable/elasticsearch-exporter/templates/servicemonitor.yaml +++ b/stable/elasticsearch-exporter/templates/servicemonitor.yaml @@ -25,6 +25,10 @@ spec: port: {{ .Values.service.metricsPort.name }} path: {{ .Values.web.path }} scheme: {{ .Values.serviceMonitor.scheme }} + {{- if .Values.serviceMonitor.relabelings }} + relabelings: + {{- toYaml .Values.serviceMonitor.relabelings | nindent 4 }} + {{- end }} jobLabel: "{{ .Release.Name }}" selector: matchLabels: diff --git a/stable/elasticsearch-exporter/values.yaml b/stable/elasticsearch-exporter/values.yaml index bf92a297db14..0fd2a632ba41 100644 --- a/stable/elasticsearch-exporter/values.yaml +++ b/stable/elasticsearch-exporter/values.yaml @@ -166,6 +166,7 @@ serviceMonitor: interval: 10s scrapeTimeout: 10s scheme: http + relabelings: [] prometheusRule: ## If true, a PrometheusRule CRD is created for a prometheus operator