api-reference/decision-engine-api-reference/analytics.mdx
Analytics is the operator-facing view for understanding how routing is behaving in practice.
The page is split into these sections:
For single-payment inspection, use the separate Payment Audit surface documented in payment-audit.
The current implementation uses these sources:
Analytics is always merchant-scoped by the authenticated identity:
There is no all-merchants analytics mode. The analytics routes no longer accept scope or
merchant_id query params, and changing the merchant selector in the top bar does not widen the
backend query scope.
Connector success-rate history is sourced from stored score_snapshot analytics events, not directly from Redis. Redis remains the live source for current score state. The connector SR chart can be narrowed by:
payment_method_typepayment_methodTo populate Analytics and Decision Audit with real traffic, use the routing traffic generator.
Generate traffic for merchant_space:
bash scripts/generate-routing-traffic.sh
What the script does:
merchant_space/rule/create or /rule/update flow100 real POST /decide-gateway requests with mixed payment-method combinationsPOST /update-gateway-score using a mix of successful and failed outcomes/routing/create and /routing/activatePOST /routing/evaluate traffic so the rule-evaluation analytics path is populatedUseful overrides:
MERCHANT_ID=merchant_space TOTAL_PAYMENTS=100 bash scripts/generate-routing-traffic.sh
RULE_EVALUATIONS=40 bash scripts/generate-routing-traffic.sh
CONNECTORS_CSV=stripe,adyen,checkout,paypal bash scripts/generate-routing-traffic.sh
After the script finishes, sign in as merchant_space and open /dashboard/analytics or
/dashboard/audit. Analytics reads will resolve the merchant from your authenticated session.
ClickHouse is part of the standard local runtime stacks. To bring up only ClickHouse and its schema init job:
COMPOSE_PROFILES= docker compose --profile analytics-clickhouse up -d
website/src/components/pages/AnalyticsPage.tsxwebsite/src/components/layout/Sidebar.tsxsrc/routes/analytics.rssrc/analytics/clickhouse/scripts/src/metrics.rs