From 72997385cd6859e632ed6c02217b61861420c7bb Mon Sep 17 00:00:00 2001 From: nd Date: Thu, 24 Dec 2020 00:58:03 +0100 Subject: [PATCH] add support to add labels to proxied metrics --- templates/node-scraper.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/node-scraper.j2 b/templates/node-scraper.j2 index aa84866..075e750 100644 --- a/templates/node-scraper.j2 +++ b/templates/node-scraper.j2 @@ -64,7 +64,7 @@ static_configs: - targets: - {{ inventory_hostname }}:{{ prometheus_agent.scrapers[item].proxy[j] }} - labels: {{ merged_prometheus_labels|to_json }} + labels: {{ merged_prometheus_labels|combine(prometheus_agent.agents.proxy.mappings[j].labels|d({}))|to_json }} tls_config: ca_file: /etc/prometheus/targetcerts/{{ inventory_hostname }}.crt cert_file: /etc/ssl/prometheus_scraper.crt