prometheus / node_exporter

Exporter for machine metrics
https://prometheus.io/
Apache License 2.0
10.64k stars 2.3k forks source link

Missing file system metrics for /dev/shm #3057

Open jura43 opened 2 weeks ago

jura43 commented 2 weeks ago

Host operating system:

Linux server1.local 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

node_exporter version:

1.6.1

node_exporter command line flags

  - '--path.rootfs=/host'
  - '--path.procfs=/host/proc'
  - '--path.sysfs=/host/sys'
  - '--collector.textfile.directory=/etc/node-exporter/'

Are you running node_exporter in Docker?

Yes

volumes:
  - /:/host:ro
  - /proc:/host/proc:ro
  - /sys:/host/sys:ro
  - /etc/hostname:/etc/nodename

I don't have any errors in logs regarding /dev/shm. I have file system metrics for all other tmpfs partitions (/run/lock, /run, etc.), but not for one mounted on /dev/shm

dswarbrick commented 4 days ago

Check your --collector.filesystem.fs-types-exclude flag option. By default it excludes devtmpfs filesystem types, of which /dev typically is.

jura43 commented 3 days ago

Check your --collector.filesystem.fs-types-exclude flag option. By default it excludes devtmpfs filesystem types, of which /dev typically is.

I don't have --collector.filesystem.fs-types-exclude set. Which flag or setting I can use to enable collecting of /dev/shm?

dswarbrick commented 3 days ago

You will need to override the default --collector.filesystem.fs-types-exclude regex so that devtmpfs (or probably actually just tmpfs) is not excluded, and you will need to override the default --collector.filesystem.mount-points-exclude so that /dev is not excluded.

node_filesystem_avail_bytes{device="tmpfs",device_error="",fstype="tmpfs",mountpoint="/dev/shm"} 1.668038656e+10