fix: send container metrics directly to prometheus

This commit is contained in:
f
2026-06-16 22:01:05 -03:00
parent d085c66d68
commit 03227f1907

View File

@ -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