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