How fasterflash/realtime_ecommerce_observability_platform works
This repository implements a simulated e-commerce observability platform. Its central workflow generates probabilistic customer-session events, streams and validates them, stores raw and structured data, and refreshes analytical KPIs. Dashboards expose business, operational, and recovery views; anomaly detection and DLQ replay handle incidents and failed events, while Airflow automates alerts and reports. The graph follows README-documented data flows and the sampled producer/anomaly calls. Several consumer, recovery, and dashboard implementations were not sampled, so their internal call relationships are not expanded.
Main entry points: raw_event_consumer.py Event validation · silver_session_consumer.py Silver processing · anomaly_engine_v2.py Anomaly scoring · analysis_engine.py AI analytics
Components 23
Simulation and Ingestion
- Session simulator
producer/session.py - Traffic runner
producer/main.py - Kafka topics
- Event validation
consumers/raw_event_consumer.py - Dead-letter handling
consumers/dlq_consumer.py
Storage and Analytics
- Raw archive
- Silver processing
consumers/silver_session_consumer.py - Gold KPI refresh
consumers/gold_kpi_consumer.py - Platform KPI refresh
consumers/platform_kpi_materializer.py - PostgreSQL warehouse
Detection and Operations
- Anomaly scoring
observability/anomaly_engine_v2.py - Anomaly features
observability/anomaly_features.py - Incident state
observability/incident_store.py
Dashboards and Recovery
- Business dashboard
dashboard_v2/app.py - Operations dashboard
dashboard_ops/app_ops.py - AI analytics
dashboard_v2/intelligence/analysis_engine.py - Recovery dashboard
replay/recovery_dashboard.py - Replay workflow
replay/replay_worker.py
Automation and Monitoring
- Scheduled reports
airflow/dags - Pipeline logging
logs/platform_logger.py - Infrastructure monitoring
Other components
- Platform user
- Gemini API
Connections 27
- Platform user → Traffic runner: starts simulation
- Traffic runner → Session simulator: runs sessions
producer/main.py - Session simulator → Kafka topics: streams events
- Kafka topics → Event validation: consumes events
- Event validation → Dead-letter handling: routes failures
- Event validation → Silver processing: routes clean events
- Kafka topics → Raw archive: archives raw events
- Silver processing → PostgreSQL warehouse: writes validated data
- Silver processing → Gold KPI refresh: feeds aggregates
- Gold KPI refresh → PostgreSQL warehouse: refreshes KPI tables
- Platform KPI refresh → PostgreSQL warehouse: refreshes platform KPIs
- PostgreSQL warehouse → Anomaly scoring: supplies KPI snapshots
- Anomaly scoring → Anomaly features: gets features
observability/anomaly_engine_v2.py - Anomaly scoring → Incident state: creates or resolves
observability/anomaly_engine_v2.py - PostgreSQL warehouse → Business dashboard: serves analytics
- PostgreSQL warehouse → Operations dashboard: serves operational views
- Incident state → Operations dashboard: supplies incidents
- Business dashboard → AI analytics: offers AI analysis
- AI analytics → PostgreSQL warehouse: queries warehouse
dashboard_v2/intelligence/analysis_engine.py - AI analytics → Gemini API: requests interpretation
- Platform user → Recovery dashboard: reviews failures
- Recovery dashboard → Replay workflow: initiates replay
- Replay workflow → Kafka topics: publishes corrected events
- Scheduled reports → Incident state: checks incidents
- Scheduled reports → Pipeline logging: checks pipeline logs
- Pipeline logging → Kafka topics: publishes log events
logs/platform_logger.py - Infrastructure monitoring → Kafka topics: scrapes service metrics