Skip to content

mountstats: add --collector.mountstats.nfs.aggregate-transports flag#3650

Open
evkuzin wants to merge 1 commit intoprometheus:masterfrom
evkuzin:nfs_nconn_aggr
Open

mountstats: add --collector.mountstats.nfs.aggregate-transports flag#3650
evkuzin wants to merge 1 commit intoprometheus:masterfrom
evkuzin:nfs_nconn_aggr

Conversation

@evkuzin
Copy link
Copy Markdown

@evkuzin evkuzin commented May 8, 2026

Adds an opt-in flag, --collector.mountstats.nfs.aggregate-transports, that sums the per-transport NFS metrics across all export entries of a mount and emits a single series per mount (no transport label).

Before 29f6ec0a, mountstats_linux only read the first export entry from /proc/self/mountstats, which silently underreported every transport metric on mounts using NFS nconnect. That commit correctly fixed the numbers by iterating all transports and adding a transport index label.

The fix is right, but for hosts with many NFS mounts and high nconnect values it multiplies the existing (already large) node_mountstats_nfs_* cardinality by nconnect. On a host with tens of mounts, enabling nconect will turns into tens of thousands of additional series per scrape (multiplies all nfs metrics by nconnect value) which is enough to be a real operational problem for the monitoring.

When the new flag is set:

The 10 node_mountstats_nfs_transport_* descriptors are built without the transport label, restoring the pre-29f6ec0a schema and cardinality.
All export entries are aggregated into a single value per mount before being emitted:

  • Counters (Bind, Connect, Sends, Receives, BadTransactionIDs, CumulativeBacklog, CumulativeSendingQueue, CumulativePendingQueue) → sum — matches the kernel's actual mount-wide totals.
  • IdleTimeSeconds (gauge) → min — represents "time since the mount last saw any RPC traffic on any transport".
  • MaximumRPCSlotsUsed (gauge) → max — the busiest transport's peak.

Default is false, so existing scrapes are unchanged.

Happy to add some tests as well.

…educe cardinality coming from nconnect nfs feature

Signed-off-by: Author Name <evgeny.kuzin@outlook.com>

Signed-off-by: Evgeny Kuzin <evgeny.kuzin@outlook.com>
@evkuzin
Copy link
Copy Markdown
Author

evkuzin commented May 8, 2026

@SuperQ could you take a look when you have time please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant