-
Notifications
You must be signed in to change notification settings - Fork 364
Error for NFS mounts via UDP #99
Description
I get the following error when using prometheus-node-exporter on a host that has NFS mounts via UDP:
failed to parse mountstats: invalid NFS transport stats 1.1 statement: [740 1 881477 875055 5946 2888414103 286261 16 258752 2080886]
I traced it back to the xprt field in /proc/self/mountstats, which has different fields depending on UDP/TCP, see also https://utcc.utoronto.ca/~cks/space/blog/linux/NFSMountstatsXprt
For the udp RPC transport there is no connection count, connect idle time, or idle time (fields #3, #4, and #5); all other fields are the same. This omission of fields is quite annoying since it means you get to shuffle your code around instead of just ignoring certain fields for certain transports (they could perfectly well report the particular statistic as zero).
This means that
Line 554 in 7d6f385
| return &NFSTransportStats{ |
I'd go ahead and try my luck at adding support for UDP mounts if you want. To keep the interface consistent, I would simply set the non-existent fields to 0 for UDP mounts.
Any objections?