How sumanthkm06/opstrace works
OpsTrace is a Linux infrastructure monitor and incident-investigation platform. Its main workflow collects host telemetry and raw logs, submits them to a FastAPI backend for persistence and analysis, and presents fleet health, logs, incidents, and dependency impact in a React dashboard. The backend also supports change correlation, incident timelines, controlled remediation with audit records, failure simulation, and Prometheus self-monitoring. The README documents the system-level connections; sampled source and the SOURCE INDEX support selected internal links. Several unsampled routes and subsystem details are therefore shown only where documented.
Main entry points: incident_engine.py Incident Engine · main.py Collector Daemon · models Relational Models · backend.py Backend Client
Components 26
Host Collection
- Collector Daemon
collector/main.py - Host Metrics
collector/app/collectors/models.py - Log Collection
collector/app/collectors/log_file.py - Log Parsing
collector/app/collectors/log_parser.py - Backend Client
collector/app/clients/backend.py
Backend Ingestion
- Versioned API
backend/app/api/v1/router.py - Telemetry API
backend/app/api/v1/telemetry.py - Telemetry Ingest
backend/app/services/telemetry_ingest.py - Log Ingest
backend/app/services/log_ingest.py
Incident Analysis
- Log Analysis
collector/app/analyzers/log_analyzer.py - Incident Detection
collector/app/detectors/incident_detector.py - Incident Engine
backend/app/engines/incident_engine.py - Change Correlation
backend/app/engines/correlation_engine.py - Dependency Impact
backend/app/engines/dependency_engine.py - Incident Timeline
backend/app/engines/timeline_engine.py - Remediation Review
backend/app/engines/remediation_engine.py - Failure Simulation
backend/app/services/failure_simulation.py
Investigation UI
- Dashboard Routes
frontend/src/App.tsx - Fleet & Incident Views
frontend/src/pages/OverviewPage.tsx - Frontend API Client
frontend/src/services/api.ts
Persistence & Operations
- PostgreSQL
- Relational Models
backend/app/models - Metrics Endpoint
backend/app/observability/prometheus.py
Other components
- Linux Host
- Prometheus
- Engineer
Connections 25
- Linux Host → Collector Daemon: provides telemetry
- Collector Daemon → Host Metrics: collects
collector/main.py - Collector Daemon → Log Collection: collects logs
collector/main.py - Log Collection → Log Parsing: parses
collector/app/collectors/log_parser.py - Collector Daemon → Backend Client: submits data
collector/main.py - Backend Client → Telemetry API: sends telemetry
- Versioned API → Telemetry API: routes to
backend/app/api/v1/router.py - Telemetry API → Telemetry Ingest: delegates to
backend/app/api/v1/telemetry.py - Telemetry Ingest → Relational Models: persists samples
- Backend Client → Log Ingest: sends logs
- Log Ingest → Relational Models: persists logs
backend/app/services/log_ingest.py - Relational Models → PostgreSQL: stored in
- Relational Models → Log Analysis: feeds analysis
- Log Analysis → Incident Detection: supports detection
- Incident Detection → Incident Engine: informs incidents
- Incident Engine → Change Correlation: supports correlation
- Incident Engine → Dependency Impact: supports impact analysis
- Incident Engine → Incident Timeline: supports replay
- Incident Engine → Remediation Review: supports remediation
- Versioned API → Failure Simulation: routes simulations
backend/app/api/v1/router.py - Engineer → Dashboard Routes: investigates
- Dashboard Routes → Fleet & Incident Views: routes views
frontend/src/App.tsx - Fleet & Incident Views → Frontend API Client: requests data
- Frontend API Client → Versioned API: calls backend
- Prometheus → Metrics Endpoint: scrapes