Explorar o código

fix(alloy): Add rootfs_path configuration to prometheus.exporter.unix (#1327)

The Alloy boilerplate mounts the host root filesystem at /:/rootfs:ro,
but the prometheus.exporter.unix component was using the default
rootfs_path of '/', causing it to read the container's filesystem
instead of the host's.

This fix adds rootfs_path = "/rootfs" to ensure filesystem metrics
(especially Used Root FS stat) report correctly for the host system.

Fixes #1326
Christian Lempa hai 5 meses
pai
achega
82039d8169
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      library/compose/alloy/config/config.alloy.j2

+ 1 - 0
library/compose/alloy/config/config.alloy.j2

@@ -145,6 +145,7 @@ discovery.relabel "metrics" {
 prometheus.exporter.unix "metrics" {
   disable_collectors = ["ipvs", "btrfs", "infiniband", "xfs", "zfs"]
   enable_collectors = ["meminfo"]
+  rootfs_path = "/rootfs"
   filesystem {
     fs_types_exclude     = "^(autofs|binfmt_misc|bpf|cgroup2?|configfs|debugfs|devpts|devtmpfs|tmpfs|fusectl|hugetlbfs|iso9660|mqueue|nsfs|overlay|proc|procfs|pstore|rpc_pipefs|securityfs|selinuxfs|squashfs|sysfs|tracefs)$"
     mount_points_exclude = "^/(dev|proc|run/credentials/.+|sys|var/lib/docker/.+)($|/)"