How thealiceiris/incident_replay_system works
Incident Replay System is a FastAPI service for collecting incident events and reconstructing ordered timelines, including trace-wide replay. Service clients submit incidents and events; the API validates and handles them through the ingestion router, which writes synchronously to PostgreSQL and supports deduplication. Responders retrieve incident or trace timelines through the replay router, ordered by event time. A feature flag optionally enables strict incident-status validation. The README also documents Terraform-based cloud infrastructure and canary delivery, which are deployment concerns rather than runtime product components; source excerpts do not establish their runtime connections.ёж
Main entry points: ingestion/router.py Ingestion routes · replay/router.py Replay routes · main.py FastAPI app · database.py Database sessions
Components 11
API service
- FastAPI app
src/backend/main.py
Ingestion
- Ingestion routes
src/backend/ingestion/router.py - Request and response schemas
src/backend/schemas.py
Timeline replay
- Replay routes
src/backend/replay/router.py
Persistence and flags
- Database sessions
src/backend/database.py - Incident and event models
src/backend/models.py - PostgreSQL
- Flag client and statuses
src/backend/flags.py
Other components
- Service clients
- SRE responders
- flagd provider
Connections 14
- Service clients → FastAPI app: submit events
README.md - SRE responders → FastAPI app: request timelines
README.md - FastAPI app → Ingestion routes: routes requests
src/backend/main.py - FastAPI app → Replay routes: routes requests
src/backend/main.py - Ingestion routes → Request and response schemas: validates and returns
src/backend/ingestion/router.py - Replay routes → Request and response schemas: returns timelines
src/backend/replay/router.py - Ingestion routes → Database sessions: uses sessions
src/backend/ingestion/router.py - Ingestion routes → Incident and event models: queries and writes
src/backend/ingestion/router.py - Ingestion routes → Flag client and statuses: checks status flag
src/backend/ingestion/router.py - Replay routes → Database sessions: uses sessions
src/backend/replay/router.py - Replay routes → Incident and event models: queries events
src/backend/replay/router.py - Database sessions → PostgreSQL: opens sessions
README.md - Incident and event models → PostgreSQL: stored as tables
README.md - Flag client and statuses → flagd provider: configures provider
src/backend/flags.py