From edfe72b1f06756dc91d7da7fcc041476367a4fe3 Mon Sep 17 00:00:00 2001 From: RichieSams Date: Mon, 6 Apr 2020 07:40:16 -0700 Subject: [PATCH] [bitnami/node-exporter] Add the ability to specify the ServiceMonitor relabelings (#2222) * [bitnami/node-exporter] Add the ability to specify the ServiceMonitor relabelings This allows the user to apply pre-scraping relabeling * [bitnami/node-exporter] Update components versions Signed-off-by: Bitnami Containers Co-authored-by: Adrian Astley Co-authored-by: Bitnami Containers --- bitnami/node-exporter/Chart.yaml | 2 +- bitnami/node-exporter/README.md | 1 + bitnami/node-exporter/templates/servicemonitor.yaml | 3 +++ bitnami/node-exporter/values.yaml | 9 +++++++-- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/bitnami/node-exporter/Chart.yaml b/bitnami/node-exporter/Chart.yaml index 8c56588e2a..49e40d37e3 100644 --- a/bitnami/node-exporter/Chart.yaml +++ b/bitnami/node-exporter/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: 0.18.1 description: Prometheus exporter for hardware and OS metrics exposed by UNIX kernels, with pluggable metric collectors. name: node-exporter -version: 0.2.8 +version: 0.2.9 keywords: - prometheus - node-exporter diff --git a/bitnami/node-exporter/README.md b/bitnami/node-exporter/README.md index 548a21be92..07e32d8145 100644 --- a/bitnami/node-exporter/README.md +++ b/bitnami/node-exporter/README.md @@ -110,6 +110,7 @@ The following table lists the configurable parameters of the Node Exporter chart | `serviceMonitor.interval` | Scrape interval (use by default, falling back to Prometheus' default) | `nil` | | `serviceMonitor.jobLabel` | The name of the label on the target service to use as the job name in prometheus. | `nil` | | `serviceMonitor.selector` | ServiceMonitor selector labels | `[]` | +| `serviceMonitor.relabelings` | ServiceMonitor relabelings | `[]` | | `serviceMonitor.metricRelabelings` | ServiceMonitor metricRelabelings | `[]` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example the following command sets the `minReadySeconds` of the Node Exporter Pods to `120` seconds. diff --git a/bitnami/node-exporter/templates/servicemonitor.yaml b/bitnami/node-exporter/templates/servicemonitor.yaml index 213b10f566..acdf310938 100644 --- a/bitnami/node-exporter/templates/servicemonitor.yaml +++ b/bitnami/node-exporter/templates/servicemonitor.yaml @@ -24,6 +24,9 @@ spec: {{- if .Values.serviceMonitor.scrapeTimeout }} scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }} {{- end }} + {{- if .Values.serviceMonitor.relabelings }} + relabelings: {{- include "node-exporter.tplValue" ( dict "value" .Values.serviceMonitor.relabelings "context" $) | nindent 8 }} + {{- end }} {{- if .Values.serviceMonitor.metricRelabelings }} metricRelabelings: {{- include "node-exporter.tplValue" ( dict "value" .Values.serviceMonitor.metricRelabelings "context" $) | nindent 8 }} {{- end }} diff --git a/bitnami/node-exporter/values.yaml b/bitnami/node-exporter/values.yaml index 97340d3e5e..def223a7a9 100644 --- a/bitnami/node-exporter/values.yaml +++ b/bitnami/node-exporter/values.yaml @@ -50,7 +50,7 @@ serviceAccount: image: registry: docker.io repository: bitnami/node-exporter - tag: 0.18.1-debian-10-r56 + tag: 0.18.1-debian-10-r74 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' @@ -222,7 +222,12 @@ serviceMonitor: # selector: # prometheus: my-prometheus - ## Metric relabeling + ## RelabelConfigs to apply to samples before scraping + ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#relabelconfig + ## + # relabelings: [] + + ## MetricRelabelConfigs to apply to samples before ingestion ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#relabelconfig ## # metricRelabelings: []