Skip to content

Mounstats collector ignores NFS mount even if metrics are different #993

@sublimestate

Description

@sublimestate

Host operating system: output of uname -a

Linux debian 4.9.0-6-amd64 #1 SMP Debian 4.9.88-1+deb9u1 (2018-05-07) x86_64 GNU/Linux

node_exporter version: output of node_exporter --version

node_exporter, version 0.16.0 (branch: master, revision: ac5a981)
build user: root@debian
build date: 20180706-16:39:05
go version: go1.10.3

node_exporter command line flags

--collector.mountstats --log.level=debug

Are you running node_exporter in Docker?

No

What did you do that produced an error?

I mounted the same device twice, both mounts were on the same mountpoint. The first mount was done using nfs version 3 and the other was done using nfs version 4.
Command: mount -t nfs -o vers=3 127.0.0.1:/var/nfs /mnt/nfs
Command: mount -t nfs -o vers=4 127.0.0.1:/var/nfs /mnt/nfs

What did you expect to see?

The mounts have some differences(e.g age, port, events stats). Considering that these metrics are different I expected to see a separate line for each nfs mount in node_exporter metrics.

What did you see instead?

I saw metrics for only one mount.
node_mountstats_nfs_age_seconds_total{export="127.0.0.1:/var/nfs"} 499
# HELP node_mountstats_nfs_event_jukebox_delay_total Number of times the NFS server indicated EJUKEBOX; retrieving data from offline storage.
# HELP node_mountstats_nfs_event_vfs_read_page_total Number of pages read directly via mmap()'d files.
# TYPE node_mountstats_nfs_event_vfs_read_page_total counter
node_mountstats_nfs_event_vfs_read_page_total{export="127.0.0.1:/var/nfs"} 0
# HELP node_mountstats_nfs_event_vfs_read_pages_total Number of times a group of pages have been read.
# TYPE node_mountstats_nfs_event_vfs_read_pages_total counter
node_mountstats_nfs_event_vfs_read_pages_total{export="127.0.0.1:/var/nfs"} 0
# HELP node_mountstats_nfs_event_vfs_update_page_total Number of updates (and potential writes) to pages.
# TYPE node_mountstats_nfs_event_vfs_update_page_total counter
node_mountstats_nfs_event_vfs_update_page_total{export="127.0.0.1:/var/nfs"} 0

My current approach to solving this problem is to have the mounstats_linux.go compare the device name, mountpoint and port. If all those values are the same then the collector will skip it as a duplicate, if not then it will show the metrics. Do you think this is a good solution? I can make a pull request if the approach seems fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions