Skip to content

Commit

Permalink
[kube-prometheus-stack] Add support for relabelings and metricRelabel…
Browse files Browse the repository at this point in the history
…ings (prometheus-community#3683)

* Add support for relabelings and metricRelabelings in kube-prometheus-stack

Signed-off-by: Jonathan Bartlett <jonathan@jonnobrow.co.uk>

* Add example values

Signed-off-by: Jonathan Bartlett <jonathan@jonnobrow.co.uk>

* Fix linting error in values.yaml

Signed-off-by: Jonathan Bartlett <jonathan@jonnobrow.co.uk>

---------

Signed-off-by: Jonathan Bartlett <jonathan@jonnobrow.co.uk>
Signed-off-by: Quentin Bisson <quentin.bisson@gmail.com>
Signed-off-by: Jonathan Bartlett <34320158+Jonnobrow@users.noreply.github.com>
Co-authored-by: Quentin Bisson <quentin.bisson@gmail.com>
  • Loading branch information
2 people authored and Matiasmct committed Mar 20, 2024
1 parent e88fcc5 commit 39fa2a1
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/kube-prometheus-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ name: kube-prometheus-stack
sources:
- https://github.com/prometheus-community/helm-charts
- https://github.com/prometheus-operator/kube-prometheus
version: 49.1.0
version: 49.2.0
appVersion: v0.67.1
kubeVersion: ">=1.16.0-0"
home: https://github.com/prometheus-operator/kube-prometheus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,12 @@ items:
{{ toYaml .podTargetLabels | indent 8 }}
{{- end }}
{{- end }}
{{- if .metricRelabelings }}
metricRelabelings:
{{ toYaml .metricRelabelings | indent 8 }}
{{- end }}
{{- if .relabelings }}
relabelings:
{{ toYaml .relabelings | indent 8 }}
{{- end }}
{{- end }}
19 changes: 19 additions & 0 deletions charts/kube-prometheus-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3585,6 +3585,25 @@ prometheus:
##
# serverName: ""

## MetricRelabelConfigs to apply to samples after scraping, but before ingestion.
## ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#relabelconfig
##
# metricRelabelings: []
# - action: keep
# regex: 'kube_(daemonset|deployment|pod|namespace|node|statefulset).+'
# sourceLabels: [__name__]

## RelabelConfigs to apply to samples before scraping
## ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#relabelconfig
##
# relabelings: []
# - sourceLabels: [__meta_kubernetes_pod_node_name]
# separator: ;
# regex: ^(.*)$
# targetLabel: nodename
# replacement: $1
# action: replace

additionalPodMonitors: []
## Name of the PodMonitor to create
##
Expand Down

0 comments on commit 39fa2a1

Please sign in to comment.