node_exporter icon indicating copy to clipboard operation
node_exporter copied to clipboard

Request to add label for mount point to mountstats

Open jgauth opened this issue 4 years ago • 10 comments

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

jgauth avatar Jul 22 '21 20:07 jgauth

Yeah agree, this should have a mountpoint label.

discordianfish avatar Jul 26 '21 10:07 discordianfish

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

SuperQ avatar Jul 28 '21 11:07 SuperQ

Looks like it: https://github.com/prometheus/node_exporter/commit/5a6db5c8d22f9a73473014f42cfc5bc18053666d#

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

jgauth avatar Jul 28 '21 17:07 jgauth

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

SuperQ avatar Jul 29 '21 17:07 SuperQ

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

conallob avatar Apr 26 '23 15:04 conallob

@conallob Please feel free to pick up where I left off - https://github.com/prometheus/node_exporter/pull/2102

jgauth avatar May 01 '23 21:05 jgauth

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.

dsnt02518 avatar May 02 '23 09:05 dsnt02518

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

conallob avatar May 02 '23 11:05 conallob

@dsnt02518 Since you have https://github.com/prometheus/node_exporter/pull/2676 already open, I'll leave this to you

conallob avatar May 17 '23 12:05 conallob