Add auction timeline offsets spec amendment - #1076
Open
jevansnyc wants to merge 4 commits into
Open
Conversation
Adds section 18 to the request phase timing spec: three first-call-wins T0 offsets (auction dispatched, resolved, committed) on RequestTimings, emitted as additive nullable columns on access_logs_raw with auction_id as the join key to the per-bidder auction dataset. Answers the overlap-proof questions the two existing clocks cannot: when the auction started relative to request entry, when the final bid landed, and when targeting was committed toward GAM.
Implements spec section 18: three first-call-wins marks on RequestTimings (dispatched at the DispatchAuctionOutcome::Dispatched arm, resolved after collect at both sites, committed after write_bids_to_state at both sites), carried through TimingSnapshot into four additive access_logs_raw columns: auction_dispatched_ms, auction_resolved_ms, auction_committed_ms, and auction_id as the join key to the per-bidder auction dataset. Null offsets mean no auction ran; a failed dispatch records nothing. FORWARD_QUERY fills the new columns with typed defaults for pre-existing rows. No header emission, no config surface, no adapter changes: the values ride the existing snapshot and the tinybird.access_enabled gate.
The Cloudflare integration harness writes wrangler.integration.generated.toml at test time; it was swept into the previous commit by accident. Ignore it so local CI=1 runs cannot commit it again.
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.
Spec-first follow-up to #1074, targeting the feature branch so it lands with (or after) the base spec rather than against main.
Adds section 18 to the request phase timing design: three T0-anchored auction milestones so the auction's timeline and the request's timeline finally share a clock.
Problem
Two clocks that never meet:
auction_events_rawmeasures the auction internally (total_time_ms, per-providerprovider_response_time_ms) on a clock that starts at auction creation; the access row is T0-anchored but only recordsauction_wait_ms(blocked time at collect). Nothing can answer: when did the auction start relative to request entry, when did the final bid land, and when was targeting committed toward GAM.Design
RequestTimings(same style asmark_headers_ready()): dispatched (bid requests left the edge), resolved (final bid or timeout), committed (write_bids_to_statereturned; targeting available to the response pipeline in both buffered and streaming modes).access_logs_raw:auction_dispatched_ms/auction_resolved_ms/auction_committed_ms(Nullable UInt32; null = no auction ran) plusauction_id(join key to the per-bidder auction dataset;nonesentinel).tinybird.access_enabledgate. Additive schema evolution with JSONPaths + FORWARD_QUERY, checked withtb --cloud deploy --check.Why it matters
This is the overlap proof: a client-side wrapper cannot dispatch until the browser boots (t~3000ms on measured prospect pages); the server-side auction dispatches while the origin fetch is in flight. One access row then reads as a timeline (dispatch at t=D, resolve at t=R, commit at t=C, headers at t=H), with
R - Djoining per-bidder detail viaauction_id, andauction_wait_msfinally interpretable next to it:(R - D) - auction_wait_msapproximates how much of the auction was absorbed by work the request needed anyway.Update: implementation is included in this PR (per owner direction), as separate commits on top of the spec: the three marks on
RequestTimings, the publisher call sites, the four row columns, and the datasource evolution (validated withtb --cloud deploy --check; the FORWARD_QUERY triggers a backfill at promotion, acceptable at current volume and required for thenonesentinel on pre-existing rows). All CI gates pass locally.🤖 Generated with Claude Code