Add host label to telegraf targets
Change-Id: Ifb65498565fc5ce4f8b94d7f62055d86b72e04d2
PROD-related: PROD-18671
diff --git a/telegraf/meta/prometheus.yml b/telegraf/meta/prometheus.yml
index e39608c..5d1d57e 100644
--- a/telegraf/meta/prometheus.yml
+++ b/telegraf/meta/prometheus.yml
@@ -23,4 +23,9 @@
endpoint:
- address: {{ address }}
port: {{ agent.output.prometheus_client.bind.port }}
+ relabel_configs:
+ - regex: {{ address }}:{{ agent.output.prometheus_client.bind.port }}
+ replacement: {{ grains['host'] }}
+ source_labels: "__address__"
+ target_label: "host"
{%- endif %}