URL Shortener & Link Management Service  ·  View 17 of 23  ·  Runtime

Click Analytics Pipeline

From an edge log row to a number somebody bills on, with the bot split and the reconciliation that make it defensible.

Editable source SVG draw.io All views
Emit Edge access log cached or not Resolver log misses only Buffer Event Hubs 30 s RPO · 7 day retain Classify Traffic classifier human · unfurler · scanner Enricher country, device, referrer Identifier drop no raw IP retained Land Raw click events ADX · 90 days Roll up Materialised views per code, per day Unique estimator ±2%, labelled Serve Tenant dashboard ≤ 60 s p95 Click stream export at least once Billing meter humans and bots split Reconcile Daily reconciliation ±0.5% vs edge counters Loss alarm budget 0.05% append only replayable Click Analytics — From Access Log to a Number Someone Bills On Queue / topic Application we own Security / platform Data store External / third party Risk / gap event / async batch synchronous failure / alternate Counting from the edge access log rather than from application code is what lets the redirect be cached for 30 seconds without losing a click. v 1.0 · owner Platform Architecture · date 2026-09

Counting from the log

  • Both cached and uncached clicks appear in the edge access log, so the count does not depend on how many requests reached application code.
  • The resolver log is a second, smaller stream used for cache-miss analysis, not for counting — one authority per number.
  • Reconciliation against the edge counters runs daily with a ±0.5% tolerance and a 0.05% loss budget; breaching either pages somebody.

What is exact and what is not

  • Exact: total clicks, human/bot split, country and device breakdowns.
  • Estimated: unique visitors, ≤ 2% relative error, labelled as an estimate everywhere it appears.
  • Fresh: 60 s p95, 5 minutes p99 into the dashboard. Backlogs degrade freshness and are reported as degraded rather than hidden.

Privacy by construction

  • The raw IP is used for classification and dropped at ingestion; no identifier that would require consent is retained.
  • This is a design constraint, not a policy note: it is why the click event schema in view 12 has the fields it has and no others.