Label the transaction counter with account_id (cardinality experiment)

Phase 5 step 4: a deliberate cardinality explosion. Every account that
transacts mints its own series. To be reverted after the burst.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Movses Aslanyan
2026-10-24 21:37:29 +03:30
co-authored by Claude Opus 5.5
parent b3e7c14958
commit a1f1d80bba
+5 -1
View File
@@ -155,7 +155,11 @@ async def submit_transaction(body: TransactionRequest):
finally: finally:
transaction_duration.record(time.perf_counter() - start, {"kind": body.kind}) transaction_duration.record(time.perf_counter() - start, {"kind": body.kind})
currency = body.currency if body.currency in KNOWN_CURRENCIES else "other" currency = body.currency if body.currency in KNOWN_CURRENCIES else "other"
transactions_total.add(1, {"kind": body.kind, "status": status, "currency": currency}) # Phase 5 step 4: deliberate cardinality explosion. Revert after the experiment.
transactions_total.add(
1,
{"kind": body.kind, "status": status, "currency": currency, "account_id": body.account_id},
)
return JSONResponse(status_code=201, content={**result, "request_id": request_id}) return JSONResponse(status_code=201, content={**result, "request_id": request_id})