Repository navigation
feat(nat): Count session creation and claim probes - #849
Merged
Merged
Conversation
Port pressure showed only as the busiest destination's share once sessions had piled up, and a shard whose uplinks failed to re-resolve after a link change logged it and kept stale coverage with no metric. nat_claims, a per-CPU array of 48 slots (family x protocol x probes), counts every new session's masquerade port claim by how many of its 8 candidates it probed, at one increment per new session and nothing per packet. A claim that adopts a live session's lost port opens no session and is not counted. galactic_nat_session_creates_total sums it per family and protocol, and galactic_nat_masquerade_claim_probes_total keeps the distribution: with a share u of a destination's ports held, a claim needs more than k probes with probability u^k, so the share above one probe estimates fill before any destination nears exhaustion. galactic_nat_uplink_resolve_errors_total counts failed uplink re-resolutions. The EgressShard reconciler's controller-runtime metrics were already served on the same port; the docs now say so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
New series: Why a distribution rather than one "more than N probes" counter. A claim probes up to 8 consecutive candidates, so with a share u of a destination's ports held it needs more than k probes with probability of roughly u^k. N=1 is the most sensitive early sign, since the share of claims needing more than one probe approximates how full the destinations taking new flows are. Keeping the whole distribution lets any N be read at query time for 48 series, and A claim that adopts a live session's lost port opens no session and is not counted. A claim that finds no port is a |
privateip
marked this pull request as ready for review
October 12, 2026 19:01
scotwells
previously approved these changes
Oct 12, 2026
scotwells
approved these changes
Oct 12, 2026
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.
Summary
On-call could see port pressure only as the busiest destination's share, and a shard whose uplinks failed to re-resolve after a link change kept stale coverage with nothing but a log line to show it.
Shards now count every new session by family and protocol, and how many port probes each claim took, which estimates how full busy destinations are well before any of them runs out, plus failed uplink re-resolutions.
This covers the review's two second-tier items at one counter increment per new session and nothing per packet, adding 55 series per shard, and it documents that the reconciler's controller metrics were already served on the shard's metrics port.
It is stacked on #848, and adds no alerts, since the review proposed none for these.
Test plan
Related to #722
🤖 Generated with Claude Code