From 176e33ee2ae519695b6233817bcf4e76d73a57de Mon Sep 17 00:00:00 2001 From: Aryan Baghi Date: Mon, 11 Mar 2024 12:41:48 +0100 Subject: [PATCH] Use container labels instead of task labels --- content/docs/guides/dockerswarm.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/content/docs/guides/dockerswarm.md b/content/docs/guides/dockerswarm.md index a8001f442..d96efc334 100644 --- a/content/docs/guides/dockerswarm.md +++ b/content/docs/guides/dockerswarm.md @@ -125,11 +125,11 @@ scrape_configs: regex: running action: keep # Only keep containers that have a `prometheus-job` label. - - source_labels: [__meta_dockerswarm_service_label_prometheus_job] + - source_labels: [__meta_dockerswarm_container_label_prometheus_job] regex: .+ action: keep # Use the prometheus-job Swarm label as Prometheus job label. - - source_labels: [__meta_dockerswarm_service_label_prometheus_job] + - source_labels: [__meta_dockerswarm_container_label_prometheus_job] target_label: job ``` @@ -147,7 +147,7 @@ out example, we only **keep** the targets that should be running. It prevents monitoring tasks that should be shut down. ```yaml -- source_labels: [__meta_dockerswarm_service_label_prometheus_job] +- source_labels: [__meta_dockerswarm_container_label_prometheus_job] regex: .+ action: keep ``` @@ -158,7 +158,7 @@ targets which have a `prometheus-job` label. ```yaml -- source_labels: [__meta_dockerswarm_service_label_prometheus_job] +- source_labels: [__meta_dockerswarm_container_label_prometheus_job] target_label: job ```