Repository navigation
feat(proxy): access-log rows carry the proxy generation and connection timing (#1333) - #1370
Merged
Merged
Conversation
…n timing (#1333) Every HTTP access-log row (both reporters) gains five attributes: proxy_epoch %ENVIRONMENT(AETHER_RESTART_EPOCH)% connection_id %CONNECTION_ID% ds_cx_age_ms %COMMON_DURATION(DS_CX_BEG:DS_RX_BEG:ms)% ds_hs_ms %COMMON_DURATION(DS_CX_BEG:DS_HS_END:ms)% us_tx_beg_ms %COMMON_DURATION(DS_RX_BEG:US_TX_BEG:ms)% and the L4 (tcp_proxy) record gains proxy_epoch. A hot-restart parent stops flushing stats to sinks when its child starts, so no metric label can separate the two generations of an overlap. An access-log row is written by one process, so the generation belongs there. proxy_epoch renders "-" until the supervisor exports the variable. Envoy accepts a %COMMON_DURATION% time point it does not know and renders "-", so `envoy --mode validate` cannot catch a typo. A live test in //agent/test/mtlspool runs production's inbound access logger on an mTLS and on an HTTP/3 listener of the pinned Envoy and asserts the fields are numbers, that two requests on one connection share connection_id and ds_hs_ms, and that ds_cx_age_ms grows by the gap between them. Runbook: "Reading a hot-restart overlap". Closes #1333 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
There was a problem hiding this comment.
🟢 Approval recommended
The implementation matches the stated logging contract and includes comprehensive unit, generated-config, and live protocol coverage.
0 open findings
What changed in this PR
Adds proxy-generation and connection-timing context to Envoy access logs for diagnosing hot-restart overlaps.
Changes:
- Adds five HTTP access-log attributes and
proxy_epochto L4 logs. - Adds unit, bootstrap-validation, and live TLS/QUIC coverage.
- Documents field semantics and investigation queries.
| File | Description |
|---|---|
.claude/agents/aether-investigator.md |
Updates investigator log-field guidance. |
docs/runbook.md |
Documents overlap analysis and new fields. |
agent/internal/xds/proxy/BUILD.bazel |
Adds test dependency. |
agent/internal/xds/proxy/accesslog.go |
Emits generation and connection timing fields. |
agent/internal/xds/proxy/accesslog_test.go |
Verifies exact HTTP and L4 formats. |
agent/test/envoy_validate/BUILD.bazel |
Registers bootstrap field validation. |
agent/test/envoy_validate/accesslog_fields.go |
Extracts access-log formats from bootstraps. |
agent/test/envoy_validate/accesslog_fields_test.go |
Checks all generated logger fields. |
agent/test/mtlspool/BUILD.bazel |
Registers live test and dependencies. |
agent/test/mtlspool/accesslog_timing_test.go |
Validates live TLS and QUIC rendering. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This was referenced Oct 7, 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.
Closes #1333
What changes
Every HTTP access-log row (
log_name:aether_access_logs), on both reporters, gains five attributes. The L4 record (aether_l4_access_logs) gainsproxy_epochonly.proxy_epoch%ENVIRONMENT(AETHER_RESTART_EPOCH)%connection_id%CONNECTION_ID%ds_cx_age_ms%COMMON_DURATION(DS_CX_BEG:DS_RX_BEG:ms)%ds_hs_ms%COMMON_DURATION(DS_CX_BEG:DS_HS_END:ms)%us_tx_beg_ms%COMMON_DURATION(DS_RX_BEG:US_TX_BEG:ms)%Why: a hot-restart parent stops flushing stats to sinks when its child starts, so no metric label can separate the two generations of an overlap. An access-log row is written by one process, so the generation goes there, together with what the connection had cost before the request.
proxy_epochreads the variable the supervisor exports in #1366. The two pull requests merge in either order: until a proxy's supervisor exports it, the field reads-and nothing else changes.Checked against the pinned Envoy (726d7ac)
Read in the source:
stream_info_formatter.{h,cc}).-.%ENVIRONMENT%reads the variable once, when the formatter is built, and renders-when it is unset.DS_CX_BEGfalls back to the request's own start when the connection start is unknown, sods_cx_age_mswould read0, not-.Measured, by a new live test (
//agent/test/mtlspool,TestAccessLogConnectionTiming). It takes production's access logger, unmodified, out of the listenersNewInboundListenerandNewInboundQUICListenerbuild, puts it on an mTLS listener and an HTTP/3 listener of a destination Envoy, sends requests through a source Envoy (the production h2 cluster, then a productionquic:twin), and reads the rows from an OTLP logs receiver inside the test. Two requests ride one connection, 400 ms apart:proxy_epochconnection_idds_cx_age_msds_hs_msus_tx_beg_msprotocolSo the HTTP/3 connection manager does see the QUIC session's start and handshake end. The scoping pass had inferred that; this is the evidence. Every attribute arrives as an OTLP string.
Red, then green: with
DS_HS_ENDmisspelled asDS_HS_EMD,envoy --mode validatestill accepted all eleven generated bootstraps, and the live test failed on all three paths withds_hs_ms rendered "-", not a number. Restored, it passes: 30 of 30 serial runs, and under--config=race.One thing to know when reading
connection_id: for a TCP connection it is a small per-process counter, for a QUIC connection a 64-bit number. It is unique within one Envoy process only, so pair it with the node andproxy_epoch.Other tests
agent/internal/xds/proxy: the exact strings on both reporters, andproxy_epochalone on the L4 record.agent/test/envoy_validate: the generated bootstraps still validate;TestGeneratedAccessLogsCarryGenerationAndTimingreads the same bytes and pins the keys on every access logger in them (mTLS inbound, HTTP/3 inbound, outbound, capture, and the capturetcp_proxychains).Pipeline and graders
Read, not changed:
k8s-talos-main,clusters/talos-main/otel-collector/values.yaml). The logs pipeline ismemory_limiter,batch, then VictoriaLogs and thecount/aether_identityconnector. The connector readsreporter,cluster_name,node_name,source_spiffe_id,upstream_cluster,upstream_peer_uri_san,upstream_hostanddownstream_peer_uri_san. No processor keeps or drops attributes by name. The new names collide with none of these, and the L4 record still has noreporter.k8s.namespace.name,k8s.pod.name,service.name, so the new attributes are ordinary fields and add no streams.e2e/eastwest-quic-hotrestart.shparses the collector's debug output by attribute name with the pattern[a-z_]+; the new names fit it and it selects fields by name. The soak graders ine2e/soak/README.mdare LogsQL queries on named fields.docs/observability/has no access-log field reference.Not verified: the rows in the live VictoriaLogs (nothing was deployed), and a source-reporter row rendered live. The live test reads destination rows only; the source side uses the same strings, and that its
ds_hs_msreads-is inferred from the source (no TLS handshake on a cleartext downstream), not run.Cost
About 105 bytes per row, which is about +8 % raw access-log volume on talos-main (about 12 M rows on an idle day, 23 M on a soak day). These are the scoping estimates, not a new measurement. It applies to both reporters. A QUIC destination row costs roughly 15 bytes more than that, because of the longer
connection_id.Option for the reviewer:
ds_hs_msshould always be-on a source row (the application speaks cleartext to its proxy), and limiting the timing fields to the destination reporter would about halve the cost. This pull request keeps them on both, as designed, becauseconnection_id,ds_cx_age_msandus_tx_beg_msdo carry information on the source side.Docs
docs/runbook.md, new section "Reading a hot-restart overlap": what the stats do during an overlap, what each new field means, example queries, and what the fields cannot show (time a SYN or a datagram waited in the kernel before Envoy read it). The L4 field list and the investigator agent's field list name the new fields. Proposal 014 is left as history.No chart change, no proxy release, no GitOps change.
🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr