Repository navigation
feat(agent): count and log a udp: cluster with no routable endpoint - #937
Merged
Merged
Conversation
Fifth of the #931 series. The fix landed in #936; this makes the failure it fixed detectable if it ever returns in another form. WHY THERE WAS NOTHING TO SEE A published udp: cluster in which no endpoint is routable is a silent blackhole. udp_proxy takes the datagram, finds an empty healthy set (NewUDPServiceCluster sets HealthyPanicThreshold: 0, so it will not spray to unhealthy hosts), and discards it. Nothing reports that: - no NACK: the config is valid - no "UDPRoute input discarded": nothing was dropped at projection time, so the #874 path stays quiet - no udp_proxy counter either. downstream_sess_rx_datagrams counts per SESSION and a session needs a host, so it does not move. Measured on a live cluster: it read 1 after FOUR datagrams had reached the socket. captureUDPClusters is the only place that holds both the cluster and its endpoints' health, so it is the only place the condition can be named. Reported rather than skipped. Skipping would remove the listener and trade one blackhole for another; leaving the cluster published means the service recovers by itself the moment an endpoint goes healthy. WHAT COUNTS AS ROUTABLE IS ENVOY'S DEFINITION, NOT OURS HEALTHY and UNKNOWN are both load balanced -- UNKNOWN is the default for an endpoint nobody has said anything about -- while UNHEALTHY, DRAINING and TIMEOUT are not. Reading UNKNOWN as unhealthy would fire on every healthy service whose endpoints carry no explicit status, which is most of them. An empty load assignment reports nothing: that is a cold start, not a blackhole, and firing there would make the counter ring for every service between its cluster appearing and its endpoints arriving. THE COUNTER IS SEEDED, AND THE GATE HAS A RED STATE Seeded at zero, because an unseeded counter has no Prometheus series at all and "no series" is indistinguishable from "zero" to a grading query. That has been forgotten twice here (rev200, then rev231/#882) -- TestEveryRegisteredCounterDeclaresItsSeedPolicy now caught it a third time, before it shipped. TestUnroutableUDPEndpoints drives the detector red, including the exact shape #931 shipped in (#853: a gate never shown to fire is not a gate). INCIDENTAL REFACTOR New() was one flat run of `if ... err != nil` registrations sitting one registration below the gocognit limit, so adding this counter failed the lint. Split into registerActivityInstruments / registerAnomalyCounters / seedAnomalyCounters -- groups that match the seeding distinction rather than an arbitrary cut. The seed-policy test parses this file's AST, so it reads the registrations from the helpers unchanged. Refs #931 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
This was referenced Sep 26, 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.
Fifth of the #931 series. The fix landed in #936; this makes the failure it fixed detectable if it ever returns in another form.
Why there was nothing to see
A published
udp:cluster in which no endpoint is routable is a silent blackhole.udp_proxytakes the datagram, finds an empty healthy set (NewUDPServiceClustersetsHealthyPanicThreshold: 0, so it will not spray to unhealthy hosts), and discards it.Nothing reports that:
UDPRoute input discarded(#874)downstream_sess_rx_datagramsThat last one measured 1 after four datagrams had reached the socket on a live cluster.
captureUDPClustersis the only place holding both the cluster and its endpoints' health, so it is the only place the condition can be named.Reported rather than skipped. Skipping would remove the listener and trade one blackhole for another; leaving the cluster published means the service recovers by itself the moment an endpoint goes healthy.
Routable is Envoy's definition, not ours
HEALTHYandUNKNOWNare both load balanced —UNKNOWNis the default for an endpoint nobody has said anything about — whileUNHEALTHY,DRAININGandTIMEOUTare not.Reading
UNKNOWNas unhealthy would fire on every healthy service whose endpoints carry no explicit status, which is most of them. An empty load assignment reports nothing: that is a cold start, not a blackhole, and firing there would make the counter ring for every service between its cluster appearing and its endpoints arriving.The counter is seeded, and the gate has a red state
Seeded at zero — an unseeded counter has no Prometheus series at all, and "no series" is indistinguishable from "zero" to a grading query.
That has been forgotten twice in this file (rev200, then rev231/#882).
TestEveryRegisteredCounterDeclaresItsSeedPolicycaught it a third time here, before it shipped — which is the first time that guard has paid for itself.TestUnroutableUDPEndpointsdrives the detector red, including the exact shape #931 shipped in, per #853.Incidental refactor, called out because it is in the diff
New()was one flat run ofif … err != nilregistrations sitting one registration below the gocognit limit, so adding this counter failed the lint. Split intoregisterActivityInstruments/registerAnomalyCounters/seedAnomalyCounters— groups that match the seeding distinction rather than an arbitrary cut.The seed-policy test parses this file's AST, so it reads the registrations from the helpers unchanged. Worth noting the flat version meant whoever added the next counter would hit the lint rather than the author who used up the budget.
Verification
bazel test //...— 109/109.--config=lint --@aspect_rules_lint//lint:fail_on_violation //...clean (it was not, before the refactor). Refs #931.Last one after this: PR6 (e2e —
l4udp-*re-annotatedprotocol: udp, T3.1 green; it has been seen red three times, so #853 is satisfied).🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr