You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One evaluation call recorded one analytics event per batch entry, so the Decision Audit listed 30–52 "events" for a payment the router had called three times. Healthy batching read as a call storm, and the noise buried the routing mismatches the screen exists to surface. Traced on sandbox (pay_OR9TzfVd6AuKV8y7I9A8): three calls inside 31 ms batching 3, 7 and 7 entries → 3 request-hits + 17 per-entry events, before confirm or a checkout refresh added theirs.
Fix — in two steps
feat(analytics): count evaluation calls in the Decision Audit, not per-entry events #387 added call_count = uniq(request_id) beside event_count (Matches row reading 3 calls · 17 entries, per-call collapsible trace groups keyed on request_id) — at the cost of a ClickHouse column, migration 039, and column-drift probe machinery. It also fixed two things found on the way: an empty batch answered TE_04 400 — making every session/PML call from a card-only cut-over profile a logged failure plus a single-call retry — and now answers 200 {"results": []}; and POST /routing/evaluate/batch gained its missing classify_request arm so batch calls appear in the request-level audit at all.
Verified A/B against main's binary with live ClickHouse; positional contract held in every batch response; routing + analytics Playwright suites 29/29 against the patched build.
Summary
One evaluation call recorded one analytics event per batch entry, so the Decision Audit listed 30–52 "events" for a payment the router had called three times. Healthy batching read as a call storm, and the noise buried the routing mismatches the screen exists to surface. Traced on sandbox (
pay_OR9TzfVd6AuKV8y7I9A8): three calls inside 31 ms batching 3, 7 and 7 entries → 3 request-hits + 17 per-entry events, before confirm or a checkout refresh added theirs.Fix — in two steps
call_count = uniq(request_id)besideevent_count(Matches row reading3 calls · 17 entries, per-call collapsible trace groups keyed onrequest_id) — at the cost of a ClickHouse column, migration039, and column-drift probe machinery. It also fixed two things found on the way: an empty batch answeredTE_04 400— making every session/PML call from a card-only cut-over profile a logged failure plus a single-call retry — and now answers200 {"results": []}; andPOST /routing/evaluate/batchgained its missingclassify_requestarm so batch calls appear in the request-level audit at all.details(~3 KB for a 12-entry batch vs the 64 KB truncation cap),payment_idis preserved when uniform across entries so audit lookup by payment id still lands, and any failed entry makes the call's statuserror. A 12-entry batch: 13 events before → 2 after. Event counts are proportional to calls again with no schema change and nothing to run on existing deployments — and the two ride-along fixes from feat(analytics): count evaluation calls in the Decision Audit, not per-entry events #387 are restored (the restored empty-batch arm even failed to compile against a plain revert, which is why feat(analytics): one preview event per batch evaluate call #391 targets the revert branch).Verified A/B against
main's binary with live ClickHouse; positional contract held in every batch response; routing + analytics Playwright suites 29/29 against the patched build.PRs
Part of #395.