Skip to content

Request to add label for mount point to mountstats #2097

Open

Description

@jgauth

Currently the labels for NFS metrics from mountstats are "export", "protocol", "mountaddr"

I'm requesting that another label be added, the mountpoint on the NFS client.

For example if /proc/self/mountstats had the following device info:
device myhostname.com:/exports/example mounted on /auto/example with fstype nfs statvers=1.1

I'd like to have a label: mountpoint: /auto/example, in addition to the label export: myhostname.com:/exports/example

It looks like this is already supported by procfs: https://github.com/prometheus/procfs/blob/master/mountstats.go#L314

Activity

  1. discordianfish commented on Jul 26, 2021

    @discordianfish
    Member

    Yeah agree, this should have a mountpoint label.

  2. SuperQ commented on Jul 28, 2021

    @SuperQ
    Member

    Did we have something like this previously, but removed it to avoid duplicate metrics?

  3. jgauth commented on Jul 28, 2021

    @jgauth
    Author

    Looks like it: 5a6db5c

    Can we include the mountpoint label, while also skipping duplicates?

  4. SuperQ commented on Jul 29, 2021

    @SuperQ
    Member

    Yea, that seems reasonable. Pick first one, ignore the rest, is that good enough?

  5. conallob commented on Apr 26, 2023

    @conallob
    Contributor

    I would like to work on this, unless there is already someone actively working on it

  6. jgauth commented on May 1, 2023

    @jgauth
    Author

    @conallob Please feel free to pick up where I left off - #2102

  7. dsnt02518 commented on May 2, 2023

    @dsnt02518

    By bizarre synchronicity I was actually working on a patch for this before I was aware of this issue. Hopefully the PR above will either resolve this or at least prove helpful.

  8. conallob commented on May 2, 2023

    @conallob
    Contributor

    I'll take a look at #2102 and try to get a PR out this week

  9. conallob commented on May 17, 2023

    @conallob
    Contributor

    @dsnt02518 Since you have #2676 already open, I'll leave this to you

  10. michael-duren commented on Nov 22, 2025

    @michael-duren

    Is this still in need of being completed? I'm looking for a first issue to contribute to.

  11. Vedant-Mhatre commented on Feb 23, 2026

    @Vedant-Mhatre
    Contributor

    I opened a PR for this: #3554.

    Implemented:

    • add mountpoint label to mountstats NFS metrics
    • include mountpoint in dedup identity so different mountpoints are exported separately
    • add test coverage for duplicate export mounted at different mountpoints
    • align fixture mountinfo entries with mountstats fixture data
    • update e2e fixtures and fix CI checks (all green)

    I noticed older PR #2676 is still open but inactive (last updated November 20, 2023), so this PR is intended as a fresh/updated attempt.

    Happy to adjust if maintainers prefer a different direction.

    If someone already has an in-progress solution, I’m happy to coordinate.

  12. discordianfish commented on Feb 25, 2026

    @discordianfish
    Member

    The question how to solve this is afaik still open. We didn't want to include all mountpoints if the stats are possibly the same, see @SuperQ's comment here: #2676 (comment)

  13. Vedant-Mhatre commented on Mar 6, 2026

    @Vedant-Mhatre
    Contributor

    Thanks, that makes sense.

    Re-reading @SuperQ's earlier comment, I think the main unresolved question is whether the kernel is actually exposing meaningfully distinct mountstats per mountpoint, or whether multiple mountpoints are often just aliases of the same underlying stats.

    My current PR assumes the former, so it changes the existing node_mountstats_nfs_* metrics in a way that could increase cardinality quite a bit for automount-style setups.

    I also don’t think trying to detect “same vs different” based on the current metric values would be a robust approach.

    Given that, would you prefer I rework this toward an additive node_mountstats_nfs_mountpoint_info metric while keeping the existing stats deduped, or would you rather leave this until there’s a concrete real-world case showing that the per-mountpoint stats are actually distinct and worth exposing on the stats metrics themselves?

    I’m happy to adjust the PR once the intended direction is clear.

  14. SuperQ commented on Mar 6, 2026

    @SuperQ
    Member

    Thanks @Vedant-Mhatre, when last I looked into this my testing showed that the actual stats were identical between different mountpoints. Hence why we currently do not have the label. If we have evidence to the contrary we can for sure change our minds and have per-mountpoint metrics.

    For now, I think we should go the node_mountstats_nfs_mountpoint_info route.

    We need someone with real-world setups to provide data to act on.

  15. Vedant-Mhatre commented on Mar 6, 2026

    @Vedant-Mhatre
    Contributor

    Thanks, that gives me a clear direction.

    I’ll rework #3554 to keep the existing node_mountstats_nfs_* metrics deduped and add an additive node_mountstats_nfs_mountpoint_info metric instead.

  16. Priyanshuraturi28 commented on Jun 10, 2026

    @Priyanshuraturi28

    Hi! I'd like to work on this. I'll add the mountpoint label to mountstats metrics. Could someone assign this to me?

  17. agbanagba commented on Nov 8, 2026

    @agbanagba

    I was hoping to work on this but I believe this issue has been fixed in #3554. May be good to close it.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions