Skip to content

Add server-side auction telemetry (edge emission for Tinybird/Grafana)#813

Draft
jevansnyc wants to merge 37 commits into
server-side-ad-templates-implfrom
auction-telemetry
Draft

Add server-side auction telemetry (edge emission for Tinybird/Grafana)#813
jevansnyc wants to merge 37 commits into
server-side-ad-templates-implfrom
auction-telemetry

Conversation

@jevansnyc

@jevansnyc jevansnyc commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

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.

Source Handler
auction_api POST /auction
spa_navigation GET /__ts/page-bids
initial_navigation SSAT dispatch / collect

What's included

  • New pure auction::telemetry module: row types (summary / provider-call / bid grains) with NDJSON serialization, a builder (win-matching, mediator dedup, decoded-price fill), and an AuctionEventSink abstraction with a no-op default.
  • OrchestrationResult -> rows mapping; provider-call status derived from the orchestrator's existing error_type metadata (launch_failed / parse_response / transport).
  • Sink seam on RuntimeServices (no-op default, so existing constructions are unaffected) plus FastlyAuctionEventSink writing per-row NDJSON with an injected event_ts.
  • A shared emit_completed_auction_telemetry helper called from all three handlers.
  • Real device signals (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_id is a fresh UUID independent of the internal AuctionRequest.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)

  • SSAT non-completed outcomes: abandoned dispatched tokens, skipped, dispatch-failed.
  • Access logs (the ops datasource).
  • Off-repo: the self-managed Tinybird project, the HTTPS relay (RFC 8615 challenge), and the Grafana dashboards.

Design and plans

The design spec and the six implementation plans are included under docs/superpowers/specs/ and docs/superpowers/plans/.

Testing

25 telemetry unit and integration tests; the full trusted-server-core suite passes; the Fastly adapter compiles for wasm32-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 than main. It may need a rebase onto the current branch tip before merge.

Tracking

Closes #814

jevansnyc added 30 commits June 23, 2026 07:07
Completes the telemetry module suite by testing one realistic case with
multiple providers, mixed bid outcomes, and complete event grain emission.
ChristianPavilonis

This comment was marked as resolved.

@aram356 aram356 marked this pull request as draft June 23, 2026 17:32
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants