mountstats: Add support for UDP NFS mounts#100
Merged
grobie merged 1 commit intoprometheus:masterfrom Jul 5, 2018
Merged
Conversation
5029ca5 to
38ecfcb
Compare
* Add "protocol" field to the NFSTransportStats struct that is either udp or tcp * Parse xprt lines for UDP NFS mounts correctly Closes prometheus#99 Signed-off-by: Hannes Körber <[email protected]>
hakoerber
pushed a commit
to hakoerber/node_exporter
that referenced
this pull request
Jul 12, 2018
In prometheus/procfs#100, the NFSTransportStats struct was expanded by a field called protocol that specifies the NFS protocol in use, either "tcp" or "udp". This commit adds the protocol as a label to all NFS metrics exported via the mountstats collector. Signed-off-by: Hannes Körber <[email protected]>
discordianfish
pushed a commit
to prometheus/node_exporter
that referenced
this pull request
Jul 23, 2018
* vendor: Update prometheus/procfs Signed-off-by: Hannes Körber <[email protected]> * mountstats: Use new NFS protocol field In prometheus/procfs#100, the NFSTransportStats struct was expanded by a field called protocol that specifies the NFS protocol in use, either "tcp" or "udp". This commit adds the protocol as a label to all NFS metrics exported via the mountstats collector. Signed-off-by: Hannes Körber <[email protected]> * Update fixtures for UDP mount Signed-off-by: Hannes Körber <[email protected]>
remijouannet
pushed a commit
to remijouannet/procfs
that referenced
this pull request
Oct 20, 2022
* Add "protocol" field to the NFSTransportStats struct that is either udp or tcp * Parse xprt lines for UDP NFS mounts correctly Closes prometheus#99 Signed-off-by: Hannes Körber <[email protected]>
bobrik
pushed a commit
to bobrik/procfs
that referenced
this pull request
Jan 14, 2023
oblitorum
pushed a commit
to shatteredsilicon/node_exporter
that referenced
this pull request
Apr 9, 2024
* vendor: Update prometheus/procfs Signed-off-by: Hannes Körber <[email protected]> * mountstats: Use new NFS protocol field In prometheus/procfs#100, the NFSTransportStats struct was expanded by a field called protocol that specifies the NFS protocol in use, either "tcp" or "udp". This commit adds the protocol as a label to all NFS metrics exported via the mountstats collector. Signed-off-by: Hannes Körber <[email protected]> * Update fixtures for UDP mount Signed-off-by: Hannes Körber <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ok, this took a lot longer than I actually thought. :)
Overview
The goal was to support parsing of NFS xprt mountstats for UDP mounts. Because the format of the
xprtline in/proc/self/mountstatsdiffers between TCP and UDP, getting stats for UDP mount points was not possible before and led to the following error in the prometheus node exporter:See also issue #99 for reference.
Details
The difference of the
xprtline between TCP and UDP is described here: https://utcc.utoronto.ca/~cks/space/blog/linux/NFSMountstatsXprtThe
statversbump from1.0to1.1had the same impact to both TCP and UDP, see this kernel commit for reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=15a4520621824a3c2eb2de2d1f3984bc1663d3c8. The difference betweenstatvers=1.0andstatvers=1.1are the three last fields (11-13 for TCP and 8-10 for UDP). To make it more clear, here is how the lines are supposed to look like, with the numbering taken from the link above:In the struct, all field that are missing in the respective
xprtline are set to 0This led to the following code changes:
I added a new fields
protocolto theNFSTransportStatsstruct that is eithertcporudp. In the struct, the fields are the same for TCP and UDP, with the fields 3-5 being set to 0 for UDP.Closes #99
Ping @grobie @SuperQ
I'm also working on incorporating the changes into the prometheus node exporter and got a first version working, but I want to wait for this pull request to be done before continuing.