nfsd: ignore unknown metric lines instead of failing#851
Open
locker95 wants to merge 1 commit into
Open
Conversation
New kernel versions can add lines to /proc/net/rpc/nfsd (for example wdeleg_getattr on Linux 6.6+). Treating an unknown key as a hard error makes ParseServerRPCStats return nothing, so consumers such as node_exporter drop all NFSd metrics for one new field. Skip unknown keys and keep returning the metrics we already understand. Known keys (including wdeleg_getattr) are still parsed as before. Related to prometheus/node_exporter#2799 Signed-off-by: Dean Chen <862469039@qq.com>
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.
What
ParseServerRPCStatscurrently returns an error when/proc/net/rpc/nfsdcontains a metric key it does not know about. That fails the whole parse, so callers such as node_exporter export no NFSd metrics for a single new kernel field.Skip unknown keys and keep returning the stats we already understand. Known keys (including
wdeleg_getattr) are unchanged.Why
Linux 6.6+ added
wdeleg_getattr(handled in #574). The same failure mode will hit again the next time the kernel adds a line. Other parsers in this repo already ignore unknown prefixes for forward compatibility (e.g. PSI).Related discussion: prometheus/node_exporter#2799
Test
Adds a fixture case with a synthetic
future_kernel_statline alongside known metrics.