Skip to content

Commit 3aa93d2

Browse files
committed
NFSd: handle new wdeleg_getattr attribute in /proc/net/rpc/nfsd
This attribute was introduced it v6.6-rc1. The relevant changes in procfs were merged here: prometheus/procfs#574 and are part of procfs v0.11.2 I have also figured out that the stat should be part of the v4 ops counters struct, but that will need changes to both procfs and this code. Since people are already using 6.6-rc1, I think it's better to get the code out there --- even if they don't care about wdeleg_getattr, currently they get _no_ nfsd stats with 6.6-rc1. I will make two follow-up PRs to clean this up in the next releases of procfs and node-exporter. Signed-off-by: Tobias Klausmann <[email protected]>
1 parent 81fc05c commit 3aa93d2

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

collector/fixtures/e2e-64k-page-output.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2743,6 +2743,7 @@ node_nfsd_requests_total{method="SetClientIDConfirm",proto="4"} 3
27432743
node_nfsd_requests_total{method="SymLink",proto="2"} 0
27442744
node_nfsd_requests_total{method="SymLink",proto="3"} 0
27452745
node_nfsd_requests_total{method="Verify",proto="4"} 0
2746+
node_nfsd_requests_total{method="WdelegGetattr",proto="4"} 15
27462747
node_nfsd_requests_total{method="WrCache",proto="2"} 0
27472748
node_nfsd_requests_total{method="Write",proto="2"} 0
27482749
node_nfsd_requests_total{method="Write",proto="3"} 0

collector/fixtures/e2e-output.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2765,6 +2765,7 @@ node_nfsd_requests_total{method="SetClientIDConfirm",proto="4"} 3
27652765
node_nfsd_requests_total{method="SymLink",proto="2"} 0
27662766
node_nfsd_requests_total{method="SymLink",proto="3"} 0
27672767
node_nfsd_requests_total{method="Verify",proto="4"} 0
2768+
node_nfsd_requests_total{method="WdelegGetattr",proto="4"} 15
27682769
node_nfsd_requests_total{method="WrCache",proto="2"} 0
27692770
node_nfsd_requests_total{method="Write",proto="2"} 0
27702771
node_nfsd_requests_total{method="Write",proto="3"} 0

collector/fixtures/proc/net/rpc/nfsd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ proc2 18 2 69 0 0 4410 0 0 0 0 0 0 0 0 0 0 0 99 2
99
proc3 22 2 112 0 2719 111 0 0 0 0 0 0 0 0 0 0 0 27 216 0 2 1 0
1010
proc4 2 2 10853
1111
proc4ops 72 0 0 0 1098 2 0 0 0 0 8179 5896 0 0 0 0 5900 0 0 2 0 2 0 9609 0 2 150 1272 0 0 0 1236 0 0 0 0 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
12+
wdeleg_getattr 15

collector/nfsd_linux.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ func (c *nfsdCollector) Update(ch chan<- prometheus.Metric) error {
8282
c.updateNFSdRequestsv2Stats(ch, &stats.V2Stats)
8383
c.updateNFSdRequestsv3Stats(ch, &stats.V3Stats)
8484
c.updateNFSdRequestsv4Stats(ch, &stats.V4Ops)
85+
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
86+
float64(stats.WdelegGetattr), "4", "WdelegGetattr")
8587

8688
return nil
8789
}

0 commit comments

Comments
 (0)