Overview
Decision Engine uses a Kafka to ClickHouse analytics pipeline:- API server captures full request and response bodies for API analytics events
- API server publishes analytics events to Kafka
- ClickHouse Kafka engine queue tables consume Kafka and materialized views fan into the raw tables
- business-domain analytics events
- raw API request and response events
analytics_domain_eventsanalytics_api_events
analytics_domain_events_queueanalytics_api_events_queueanalytics_payment_audit_summary_bucketsanalytics_domain_events_mvanalytics_api_events_mvanalytics_payment_audit_summary_buckets_mv
- raw event timelines still read from
analytics_domain_events - summary lists read from the pre-aggregated
analytics_payment_audit_summary_buckets
lookup_key:
payment_idwhen present- otherwise
request_id
Local Bring-Up
Start the local analytics stack:- ClickHouse:
clickhouse/clickhouse-server:26.1 - Kafka:
apache/kafka:3.8.1 - ClickHouse database:
default
clickhouse/scripts/
/docker-entrypoint-initdb.d. They create the raw tables, recreate the Kafka queue tables and materialized views, create the payment-audit summary bucket table, and bind the queue tables to the configured Kafka brokers and topics.
The analytics data volume is persistent, so normal restarts keep historical data.
If you need a clean reset:
Config
Relevant config lives under:Retention
The raw analytics tables retain data for 18 months:analytics_api_eventsanalytics_domain_events
Troubleshooting
Useful checks when ingestion looks stalled:Related Docs
- Analytics — the operator-facing view built on this pipeline.
- Payment Audit — single-payment timeline lookups against these tables.
- Local Setup Guide — bringing up the
analytics-clickhouseprofile.