fix: send container metrics directly to prometheus
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user