Skip to content

Commit

Permalink
Prometheus: Relabeling the node-exporter label
Browse files Browse the repository at this point in the history
Added the reblabeling config lines to the kubernetes_sd_config key, to
replace the node_name with hostname for Node-exporter. This must now
display the hostname also as one of the labels of the Node-exporter
metrics.

Change-Id: Ic96a890552a1cd2f5e595c37330de048f31a0e75
  • Loading branch information
rp592h committed Sep 26, 2019
1 parent c3a1ae4 commit 2358a8a
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion prometheus/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,19 @@ conf:
- __meta_kubernetes_service_name
target_label: job
replacement: ${1}
- job_name: 'node-exporter'
kubernetes_sd_configs:
- role: endpoints
scrape_interval: 60s
relabel_configs:
- source_labels:
- __meta_kubernetes_service_name
action: keep
regex: 'node-exporter'
- source_labels:
- __meta_kubernetes_pod_node_name
action: replace
target_label: hostname
- job_name: 'kubernetes-service-endpoints'
kubernetes_sd_configs:
- role: endpoints
Expand All @@ -916,7 +929,7 @@ conf:
- source_labels:
- __meta_kubernetes_service_name
action: drop
regex: '(openstack-metrics|prom-metrics|ceph-mgr)'
regex: '(openstack-metrics|prom-metrics|ceph-mgr|node-exporter)'
- source_labels:
- __meta_kubernetes_service_annotation_prometheus_io_scrape
action: keep
Expand Down

0 comments on commit 2358a8a

Please sign in to comment.