netstat: model legacy TcpExt counters removed from recent kernels - #863
Merged
Merged
Conversation
Member
|
This needs a DCO sign-off. You can use |
SuperQ
approved these changes
Aug 27, 2026
PAWSPassive, TCPPrequeued, TCPDirectCopyFromBacklog, TCPDirectCopyFromPrequeue, TCPPrequeueDropped, TCPLoss, TCPFACKReorder, TCPForwardRetrans, TCPHPHitsToUser and TCPSchedulerFailed are absent from the current kernel TcpExt table but are still printed by older kernels. Model them so consumers keep metric parity with older kernels; the parser stays additive (absent keys remain nil). See prometheus/node_exporter#3796. Signed-off-by: 霏承 <huangleshu.hls@alibaba-inc.com>
neoLsH
force-pushed
the
add-legacy-tcpext-counters
branch
from
August 27, 2026 10:07
d0574f8 to
cc6d988
Compare
neoLsH
added a commit
to neoLsH/node_exporter
that referenced
this pull request
Aug 28, 2026
procfs v0.22.0 includes prometheus/procfs#863, which models the 10 legacy TcpExt counters. With this bump, the explicit descriptors already present in netstat_descs_linux.go start populating for users whose field regex selects them, restoring parity with older kernels. Part of prometheus#3796. Signed-off-by: 霏承 <huangleshu.hls@alibaba-inc.com>
neoLsH
added a commit
to neoLsH/node_exporter
that referenced
this pull request
Aug 28, 2026
procfs v0.22.0 includes prometheus/procfs#863, which models the 10 legacy TcpExt counters. With this bump, the explicit descriptors already present in netstat_descs_linux.go start populating for users whose field regex selects them, restoring parity with older kernels. Part of prometheus#3796. Signed-off-by: 霏承 <huangleshu.hls@alibaba-inc.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
Add 10 legacy
TcpExtcounters to the/proc/net/netstatmodel and parser:PAWSPassive,TCPPrequeued,TCPDirectCopyFromBacklog,TCPDirectCopyFromPrequeue,TCPPrequeueDropped,TCPLoss,TCPFACKReorder,TCPForwardRetrans,TCPHPHitsToUser,TCPSchedulerFailed.Why
These counters are absent from the current kernel's
TcpExttable (none ofthem are in linus/master
include/uapi/linux/snmp.h), but older kernels stillprint them in
/proc/net/netstat. node_exporter is switching its netstatcollector to these parsers (prometheus/node_exporter#3796), and would
otherwise silently drop these metrics for users whose
--collector.netstat.fieldsregex selects them.Behavior
*float64and staynilwhen the kerneldoes not print them (all modern kernels), matching the optional-field
semantics from Replace float64 with *float64 for proc_netstat, proc_snmp and proc_snmp6 #464.
cases.
Out of scope
IcmpMsg/Icmp6Msgper-type counters: the kernel only prints non-zeroInTypeN/OutTypeNentries, so the set is host-dependent and open-ended —a fixed struct can't cover it (a map, like
NetDev, or an unknown-keysescape hatch would). Separate follow-up.
StatValuerefactor floated in netstat: Use procfs parsers for netstat, snmp and snmp6 node_exporter#3796: changingall netstat/snmp field types would be a breaking API change for existing
consumers; separate discussion.
Note on scope: this PR closes the backward gap (counters older kernels print that
were never modeled). procfs's
TcpExtalso lags the current kernel in the otherdirection (e.g.
TCPDelivered,TCPAckCompressed,TCPZeroWindowDrop,TCPBacklogCoalesce,BeyondWindow,TCPTimeoutRehash,TCPDSACKRecvSegs,TCPMigrateReq*,TCPAO*are printed by modern kernels but not modeled). Thatforward lag is procfs's ordinary upkeep, pre-exists this change, and affects all
consumers; it is deliberately out of scope here rather than bundled in.