node exporter's data collection frequency

53 views
Skip to first unread message

mohan garden

unread,
Jul 23, 2024, 8:28:42 AM7/23/24
to Prometheus Users
Hi All, 
We are running node exporter in our infra server and prometheus  is able to scrape the reported data at 30 seconds scrape inverval. It appears that node exporter collects the df command's output, and we try to discourage the use of df command on the NFS .

As we plan to reduce the impact of node exporter on the NFS  metadata query , so wanted to understand that at what frequency does the node exporter collects the data.

Was unable to figure out this information from node exporter's --help option.

Please advice.

Regards
- MG


mohan garden

unread,
Jul 23, 2024, 9:10:33 AM7/23/24
to Prometheus Users
came across this query , seems data is collected when prometheus contacts the node exporter during scrape.
https://groups.google.com/g/prometheus-users/c/h46MJjkEadQ

This leaves me with just the following query , 
does node exporter use the same method to collect the file system usage stats which the df command uses?

Regards,
- MG

Ben Kochie

unread,
Jul 23, 2024, 9:47:38 AM7/23/24
to mohan garden, Prometheus Users
Best practice if you don't want to include NFS mounts is to exclude it from the list of filesystem types.

--collector.filesystem.fs-types-exclude="^(autofs|binfmt_misc|bpf|cgroup2?|configfs|debugfs|devpts|devtmpfs|fusectl|hugetlbfs|iso9660|mqueue|nfs|nsfs|overlay|proc|procfs|pstore|rpc_pipefs|securityfs|selinuxfs|squashfs|sysfs|tracefs)$"

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/1d03248a-3596-4fe5-aa62-33e632895912n%40googlegroups.com.

Brian Candler

unread,
Jul 23, 2024, 9:48:16 AM7/23/24
to Prometheus Users
> does node exporter use the same method to collect the file system usage stats which the df command uses?

Essentially yes. But you can easily exclude certain filesystems and/or types of filesystem from collection.

The below is picked up from an old machine, but I believe the flags won't have changed much: "--collector.filesystem.fs-types-exclude" is probably the one of most of interest to you.

/usr/local/bin/node_exporter --web.config=/etc/prometheus/node_exporter_web_config.yaml --web.disable-exporter-metrics --collector.textfile.directory=/var/lib/node_exporter --collector.netdev.device-exclude=^(veth.+)$ --collector.netclass.ignored-devices=^(veth.+)$ --collector.diskstats.ignored-devices=^(ram|loop|fd|(h|s|v|xv)d[a-z]+|nvme[0-9]+n[0-9]+p)[0-9]+$ --collector.filesystem.fs-types-exclude=^(aufs|autofs|binfmt_misc|bpf|cgroup2?|configfs|debugfs|devpts|devtmpfs|fuse[.]glusterfs|fuse[.]lxcfs|fusectl|hugetlbfs|mqueue|nfs4?|nsfs|overlay|proc|procfs|pstore|rootfs|rpc_pipefs|securityfs|selinuxfs|squashfs|sysfs|tmpfs|tracefs)$ --collector.filesystem.mount-points-exclude=^/(dev|proc|sys|var/lib/docker|.*[.]zfs/snapshot)($|/)
Reply all
Reply to author
Forward
0 new messages