feat(conntrack): measure since-last-report bytes/packets lost on GC reap - #2554
Draft
Matthew McKeen (mmckeen) wants to merge 6 commits into
Draft
feat(conntrack): measure since-last-report bytes/packets lost on GC reap#2554Matthew McKeen (mmckeen) wants to merge 6 commits into
Matthew McKeen (mmckeen) wants to merge 6 commits into
Conversation
Signed-off-by: Matthew McKeen <matthew.mckeen@fastly.com>
Signed-off-by: Matthew McKeen <matthew.mckeen@fastly.com>
Signed-off-by: Matthew McKeen <matthew.mckeen@fastly.com>
Signed-off-by: Matthew McKeen <matthew.mckeen@fastly.com>
Signed-off-by: Matthew McKeen <matthew.mckeen@fastly.com>
Signed-off-by: Matthew McKeen <matthew.mckeen@fastly.com>
Matthew McKeen (mmckeen)
force-pushed
the
conntrackGCUnreportedMetrics
branch
from
July 20, 2026 02:37
dc25974 to
a0110bb
Compare
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.
Description
Conntrack accumulates the bytes/packets seen since the last report on each entry, emits them as
previously_observed_*on report events, then resets. When the userspace GC loop reaps an idle-expired entry, that since-last-report residual is dropped and never reported — systematically undercounting traffic on connections that go idle and are reaped between reports.This measures (does not flush) that lost residual. On GC reap, the entry's tx/rx since-last-report bytes/packets are attributed to ingress/egress from the entry's host-relative
traffic_direction(tx is the entry's direction, rx the opposite) and added to two new control-plane counters. This quantifies the undercount without emitting per-flow reap events, which would complicate report parsing.conntrack_gc_unreported_bytes_counter{direction}conntrack_gc_unreported_packets_counter{direction}The direction classification is shared with packetparser via
flow.TrafficDirectionand two small helpers inpkg/utils(TrafficDirectionString,OppositeTrafficDirection).Related Issue
#1760
Checklist
git commit -S -s ...). See this documentation on signing commits.Screenshots (if applicable) or Testing Completed
Deployed in cluster; the new counters accrue on GC reap and show the previously-invisible undercount by direction.
Additional Notes
Stacked on #2505 — this builds on the conntrack GC delete loop /
gcDeletionintroduced there. Until #2505 merges, the commit range here includes its commits; the net-new change is the final commit, and this rebases down to just that once #2505 lands.A follow-up will extend the same counters to the in-kernel deletion path (RST / final-ACK / timeout), reusing the eBPF drop-map pattern from #2503.
Please refer to the CONTRIBUTING.md file for more information on how to contribute to this project.