Files
2025-03-19 11:19:53 +00:00

39 lines
1.0 KiB
Plaintext

prometheus.exporter.unix "host_metrics" {
// Enable specific collectors that would provide the missing metrics
enable_collectors = [
"cpu", "pressure", "netdev", "netstat", "diskstats",
"meminfo", "loadavg", "softnet", "stat", "thermal_zone",
]
// Set paths for accessing host metrics when running in a container
procfs_path = "/host/proc"
sysfs_path = "/host/sys"
rootfs_path = "/rootfs"
// Configure filesystem collector
filesystem {
mount_points_exclude = "^/(sys|proc|dev|host|etc)($$|/)"
}
// Configure netdev collector
netdev {
// Include all network devices for network traffic metrics
device_exclude = ""
}
}
// Make sure we scrape the host metrics
prometheus.scrape "host_metrics" {
targets = prometheus.exporter.unix.host_metrics.targets
forward_to = [prometheus.remote_write.prometheus.receiver]
scrape_interval = "15s"
scrape_timeout = "10s"
job_name = "node"
}
prometheus.remote_write "prometheus" {
endpoint {
url = "http://prometheus:9090/api/v1/write"
}
}