The node_filesystem_size_bytes query result is inconsistent with the server result

49 views
Skip to first unread message

袁安安

unread,
Aug 13, 2020, 4:46:54 AM8/13/20
to Prometheus Users

Host operating system: output of uname -a

Linux master 3.10.0-1062.18.1.el7.x86_64 #1 SMP Tue Mar 17 23:49:17 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux


node_exporter version: output of node_exporter --version

node_exporter v1.0.1


Are you running node_exporter in Docker?

node_exporter running in kubernetes


What did you do that produced an error?

I use 'node_filesystem_size_bytes' The size of the system disk (DF - H) queried by bytes is inconsistent with that on the host.Why are the two different? It should be the same value, which causes my monitoring alarm to be incorrect


What did you expect to see?

Index node_filesystem_size_bytes query results

/dev/mapper/centos-home:50G
/dev/mapper/centos-root:518.5G


What did you see instead?

(1).'Index node_filesystem_size_bytes' query results

/dev/mapper/centos-home:518.5G
/dev/mapper/centos-root:518.5G


(2).'df -h' query results

/dev/mapper/centos00-root 50G 3.6G 47G 8% /
/dev/mapper/centos00-home 519G 24G 496G 5% /home

Brian Candler

unread,
Aug 13, 2020, 7:13:24 AM8/13/20
to Prometheus Users
It's because you're running node_exporter inside docker, so node_exporter sees the filesystems as they are inside the docker container.


It's better to run node_exporter directly on the host - for example, copy the binary to each host, and run it under systemd as a regular service.

anyuxianzh...@gmail.com

unread,
Aug 13, 2020, 9:58:44 PM8/13/20
to Prometheus Users
Thank you for your answer. I'm currently node_exporter is deployed in kubernetes and monitored by Prometheus. Does kubernetes deploy  Reference documents for the exporter?

anyuxianzh...@gmail.com

unread,
Aug 14, 2020, 1:23:26 AM8/14/20
to Prometheus Users
I have solved the problem. The monitoring is normal. Thank you.

Brian Candler

unread,
Aug 14, 2020, 2:49:52 AM8/14/20
to Prometheus Users
For the benefit of future readers who come across this thread, can you explain how you solved the problem?

anyuxianzh...@gmail.com

unread,
Aug 14, 2020, 5:49:12 AM8/14/20
to Prometheus Users
Add the mount of host file to the deployment file of node exporter

- --log.level=info
- --path.procfs=/host/proc
- --path.sysfs=/host/sys
- --path.rootfs=/rootfs
- --collector.vmstat
- --collector.vmstat.fields=.*
- --collector.netstat
- --collector.netstat.fields=.*
- --collector.filesystem.ignored-mount-points=^/(proc|tmpfs|shm|sys|var/lib/docker/.+|var/lib/kubelet/.+)($|/)
- --collector.filesystem.ignored-fs-types=^(autofs|tmpfs|shm|binfmt_misc|bpf|cgroup2?|configfs|debugfs|devpts|devtmpfs|fusectl|hugetlbfs|mqueue|nsfs|overlay|proc|procfs|pstore|rpc_pipefs|securityfs|selinuxfs|squashfs|sysfs|tracefs)$
Reply all
Reply to author
Forward
0 new messages