From 2358a8a7106136866e43ab9c80752e18f5605763 Mon Sep 17 00:00:00 2001 From: "Pai, Radhika (rp592h)" Date: Thu, 26 Sep 2019 15:46:28 +0000 Subject: [PATCH] Prometheus: Relabeling the node-exporter label 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 --- prometheus/values.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/prometheus/values.yaml b/prometheus/values.yaml index e16b6d85f..3bd53a07d 100644 --- a/prometheus/values.yaml +++ b/prometheus/values.yaml @@ -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 @@ -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