From 945fe5d39da9d405b82d7d1834b8128d015697d2 Mon Sep 17 00:00:00 2001 From: Tobias Manske Date: Mon, 17 Apr 2023 21:49:02 +0200 Subject: [PATCH] Relabel instance to container_name --- .../compose_project/templates/prometheus/prometheus.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/coreos-config/roles/compose_project/templates/prometheus/prometheus.yml b/coreos-config/roles/compose_project/templates/prometheus/prometheus.yml index bf4a278..ad6271a 100644 --- a/coreos-config/roles/compose_project/templates/prometheus/prometheus.yml +++ b/coreos-config/roles/compose_project/templates/prometheus/prometheus.yml @@ -25,6 +25,11 @@ scrape_configs: - targets: - localhost:9090 - job_name: 'service_discovery' + metric_relabel_configs: + - source_labels: + - "container_name" + target_label: "instance" + action: replace file_sd_configs: - files: - /label_discovery/docker-targets.json