prometheus / node_exporter

Exporter for machine metrics
https://prometheus.io/
Apache License 2.0
10.97k stars 2.33k forks source link

Request to add label for mount point to mountstats #2097

Open jgauth opened 3 years ago

jgauth commented 3 years ago

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

discordianfish commented 3 years ago

Yeah agree, this should have a mountpoint label.

SuperQ commented 3 years ago

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

jgauth commented 3 years ago

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

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

SuperQ commented 3 years ago

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

conallob commented 1 year ago

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

jgauth commented 1 year ago

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

dsnt02518 commented 1 year ago

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.

conallob commented 1 year ago

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

conallob commented 1 year ago

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