Add request phase timing design spec - #1069
Conversation
9c40b21 to
9f01f5f
Compare
jevansnyc
left a comment
There was a problem hiding this comment.
The direction is sound, but I found correctness blockers around the finalization boundary and total-time snapshot, plus naming, privacy, telemetry-delivery, configuration, and query-model concerns. I would address the blocking items before treating the design as implementation-ready. Inline comments contain concrete suggested changes.
… semantics, KV scope, geo carry, route template, sink confirmation, sampling and query model, config rollback
jevansnyc
left a comment
There was a problem hiding this comment.
Round 2: the first-round corrections materially improve the design. The freeze point, stored snapshot, template-cache naming, rollback plan, and confirmed ingestion response are now much clearer. I still see three implementation-blocking issues: buffered publisher paths invalidate the body-phase math, the Tinybird schema/query model is invalid as written, and the cache-replay exclusion is not conservative enough. The remaining inline comments cover geo/context propagation, privacy, adapter parity, validation, and operational behavior.
…ivate-only header emission, non-null sorting key with service identity, coarse publisher route template, telemetry snapshot and outage behavior, tinybird flag decoupling, adapter phase semantics
ChristianPavilonis
left a comment
There was a problem hiding this comment.
Summary
The observability goal and Fastly freeze point fit the project, but the design and companion implementation plan assume several carriers and adapter hooks that the current code does not provide. The inline findings identify the architectural changes needed before implementation can proceed without losing routes or reporting misleading data.
…e metadata extension, adapter-derived env, typed template-cache state, adapter-owned emission context, per-mode delivery semantics, Axum outer wrapper
Closes #1068.
Design spec for per-request phase attribution: TS-emitted
Server-Timingsubtimings plus Tinybird access telemetry percentiles.What the spec covers
RequestTimingstype (closed phase enum, saturating monotonic spans, cheap-clone handle) collected on every request with no flag, carried through request extensions, the streaming body closure, and post-send emission.ts-total,ts-appbuild,ts-filter,ts-geo,ts-kv,ts-origin,ts-c2. Appended inapply_finalize_headers, gated by a newobservability.server_timing_enabledflag. Browsers expose the header viaPerformanceResourceTiming.serverTiming, so publisher RUM tooling picks up the breakdown with no integration work.auction_wait_ms,stream_ms,resp_bytes) flow to Tinybird only.access_logs_rawdatasource with phase columns,route_class,c2_state,ts_version, andpop; one sampled NDJSON row per request emitted strictly after the last body byte, reusing the auction sink pattern; unwires the settings guard that rejectstinybird.access_enabled.Server-Timingthrough.Motivation: a production stall window (publisher redacted in the spec) added a uniform ~600 ms to every application-path request and could not be attributed without a live probing session. With this in place the next window names its phase in one response header or one dashboard query.
Spec only; no runtime code changes in this PR. Implementation plan follows.