Add server-side auction telemetry (edge emission for Tinybird/Grafana)#813
Draft
jevansnyc wants to merge 37 commits into
Draft
Add server-side auction telemetry (edge emission for Tinybird/Grafana)#813jevansnyc wants to merge 37 commits into
jevansnyc wants to merge 37 commits into
Conversation
…code verification
…Tinybird fallback
Completes the telemetry module suite by testing one realistic case with multiple providers, mixed bid outcomes, and complete event grain emission.
Add configured auction event log endpoint to settings and wire it into Fastly telemetry sink with whitespace-safe fallback to default. Harden auction completion telemetry by adding explicit timeout/launch/parse/transport handling and mapping timeout status. Improve page path normalization with sensitive-segment redaction rules for better privacy.
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
Adds server-side auction telemetry: every completed auction emits structured NDJSON to a Fastly real-time log endpoint (
ts_auction_events) for downstream ingestion into Tinybird and visualization in Grafana. Wired across all three auction initiation paths.auction_apiPOST /auctionspa_navigationGET /__ts/page-bidsinitial_navigationWhat's included
auction::telemetrymodule: row types (summary / provider-call / bid grains) with NDJSON serialization, a builder (win-matching, mediator dedup, decoded-price fill), and anAuctionEventSinkabstraction with a no-op default.OrchestrationResult-> rows mapping; provider-call status derived from the orchestrator's existingerror_typemetadata (launch_failed/parse_response/transport).RuntimeServices(no-op default, so existing constructions are unaffected) plusFastlyAuctionEventSinkwriting per-row NDJSON with an injectedevent_ts.emit_completed_auction_telemetryhelper called from all three handlers.is_mobile/is_known_browser) derived from the request user agent and the client JA4 / H2 fingerprints.Privacy and hot-path safety
No EC id, IP, or raw user agent is emitted. The telemetry
auction_idis a fresh UUID independent of the internalAuctionRequest.id. Page paths are normalized (no query or fragment). Emission is off the response path: the sink defaults to a no-op and the Fastly implementation is a buffered host log write, so there is no synchronous network call before the response.Out of scope (follow-ups, documented in the design spec)
Design and plans
The design spec and the six implementation plans are included under
docs/superpowers/specs/anddocs/superpowers/plans/.Testing
25 telemetry unit and integration tests; the full
trusted-server-coresuite passes; the Fastly adapter compiles forwasm32-wasip1.Note for reviewers
This branch is based on an earlier point of
server-side-ad-templates-impl(PR #680) and observes that branch's SSAT dispatch/collect lifecycle, so it targets that branch rather thanmain. It may need a rebase onto the current branch tip before merge.Tracking
Closes #814