Report unrecognized proxy error codes as unknown instead of dropping them - #394
Draft
archandatta wants to merge 1 commit into
Draft
archandatta wants to merge 1 commit into
archandatta wants to merge 1 commit into
Conversation
…them The metro egress proxy adds X-Kernel-Proxy-Error codes on its own release cadence, so cdpmonitor dropped every branded 502 whose code postdated the image's enum. Publish those as code=unknown with the sanitized header value in raw_code, and add restricted_route_unavailable, which was never listed. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.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.
Summary
cdpmonitorpublishes aproxy_errorfor every branded 502: anX-Kernel-Proxy-Errorvalue outside the enum is reported ascode: unknownwith the sanitized header value inraw_code, instead of being droppedrestricted_route_unavailableandunknownto thecodeenum andraw_codetoBrowserProxyErrorEventData; regeneratelib/oapi/oapi.goraw_codeto the OTLP attributekernel.proxy_error_raw_codeTestProxyErrorE2Eover a published code, a code published after the enum's first release, and an unrecognized valueWhy
The metro egress proxy defines the header codes and deploys on merge. This image validates them against its compiled-in enum and rolls on its own cadence, so every code added on the proxy side is dropped here until the next image release.
restricted_route_unavailablehas never been in a released image, andorigin_tls_timeoutandprovider_rejectedlanded in #385 a day after the image now in production was cut. For all three the session records anetwork_responsewith status 502 and nothing that names the proxy failure; the only trace is thedropping proxy_error with unknown codewarning inside the VM.Reporting
unknownkeeps the event and its request attribution while the enum catches up.raw_codeis lowercased, restricted to[a-z0-9_], and capped at 64 bytes. The rate limiter keys onunknownrather than the raw value, so an origin that sets the header itself gets one slot per session and resource type, not a map entry per distinct string. kernel/kernel#4113 publishes the same two enum members andraw_codein the public spec.Unchanged: the nine codes already listed are emitted exactly as before, the 502 gate and the per-session sampling interval are the same, and OTLP severity for
proxy_errorstill depends onresource_typeonly.Review note: this spec has no
x-enum-varnames, so the generated constant for the new member is the bareoapi.Unknown. It compiles without collision today.Testing
go test ./lib/cdpmonitor/ ./lib/events/...— passes (~45s); includes the newTestSanitizeProxyErrorRawCode, the rewrittenproxy_error_unknown_code_reported_as_unknownsubtest, and the newproxy_error_raw_codeOTLP subtestKERNEL_CDPMONITOR_CHROME_E2E=1 go test ./lib/cdpmonitor/ -run TestProxyErrorE2E— 3/3 subtests pass against a real Chromiumgo vet ./lib/cdpmonitor/ ./lib/events/— cleango mod tidyremoves ~300 stalego.sumentries onmain; that drift is left out of this PR🤖 Generated with Claude Code