From 03227f19070a8fecabd19d31fc9fed2ba11904fa Mon Sep 17 00:00:00 2001 From: f Date: Tue, 16 Jun 2026 22:01:05 -0300 Subject: [PATCH] fix: send container metrics directly to prometheus --- config.alloy.tmpl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config.alloy.tmpl b/config.alloy.tmpl index aa6f898..be50eec 100644 --- a/config.alloy.tmpl +++ b/config.alloy.tmpl @@ -44,6 +44,7 @@ prometheus.scrape "default" { prometheus.exporter.self.alloy.targets, prometheus.exporter.unix.default.targets, prometheus.exporter.cadvisor.docker.targets, + discovery.docker.containers.targets, ) forward_to = [prometheus.remote_write.prometheus.receiver] @@ -60,6 +61,11 @@ prometheus.remote_write "prometheus" { } } +discovery.docker "containers" { + host = "unix:///var/run/docker.sock" + match_first_network = false +} + // Scrape Prometheus metrics from other containers on this host. // Containers opt in via Docker labels: // prometheus.io/scrape=true required: enable scraping