# balaji-kvb/telemetryscope architecture

> Architecture diagram of the GitHub repository balaji-kvb/telemetryscope, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/balaji-kvb/telemetryscope
- Repository: https://github.com/balaji-kvb/telemetryscope

## Overview

TelemetryScope is a cloud-native telemetry collection, log analytics, and operational investigation platform. Its main path accepts structured events through ingestion, validates and normalizes them, forwards them to processing for fingerprinting, persistence, and alert evaluation, then serves stored telemetry and operational views to the dashboard. The README also describes demo workload controls, deployment correlation, infrastructure visibility, and optional alert webhooks. Source excerpts verify key service calls; some broader UI and integration relationships are documented but not shown in sampled code.

Main entry points: [`frontend/src/App.jsx`](https://github.com/balaji-kvb/telemetryscope/blob/main/frontend/src/App.jsx) (React Dashboard), [`services/processing-service/app.py`](https://github.com/balaji-kvb/telemetryscope/blob/main/services/processing-service/app.py) (Processing Endpoint), [`frontend/src/services/api.js`](https://github.com/balaji-kvb/telemetryscope/blob/main/frontend/src/services/api.js) (Dashboard API Client), [`services/processing-service/processors/database.py`](https://github.com/balaji-kvb/telemetryscope/blob/main/services/processing-service/processors/database.py) (Event Persistence)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Telemetry Capture"]
  node_intake["Ingestion API<br/>[ingestion.py]"]
  node_validation["Payload Validation<br/>[payload.py]"]
  node_ingestion_app["Ingestion Service<br/>[app.py]"]
end

subgraph group_analysis["Processing &amp; Alerts"]
  node_processor["Processing Endpoint<br/>[app.py]"]
  node_fingerprint["Error Fingerprinting<br/>[fingerprint.py]"]
  node_persistence["Event Persistence<br/>[database.py]"]
  node_alert_eval["Alert Evaluation<br/>[alerts.py]"]
  node_postgres[("PostgreSQL")]
end

subgraph group_investigation["Query &amp; Investigation"]
  node_query_api["Query &amp; Control API<br/>[app.py]"]
  node_query_db["Analytics Queries<br/>[database.py]"]
  node_dashboard["React Dashboard<br/>[App.jsx]"]
  node_api_client["Dashboard API Client<br/>[api.js]"]
  node_overview["Overview &amp; Timeline<br/>[Overview.jsx]"]
  node_live_logs["Live Log Search<br/>[LiveLogs.jsx]"]
  node_errors["Error Investigation<br/>[Errors.jsx]"]
  node_alerts_ui["Alert Console<br/>[Alerts.jsx]"]
  node_services_ui["Service Catalog<br/>[Services.jsx]"]
end

subgraph group_operations["Operations &amp; Demo"]
  node_demo["Demo Workload<br/>[app.py]"]
  node_load_ui["Load Controls<br/>[LoadTest.jsx]"]
  node_infra_ui["Infrastructure View<br/>[Infrastructure.jsx]"]
  node_monitoring["Prometheus &amp; Grafana<br/>[prometheus.yml]"]
end

node_producer(("Telemetry Producers"))
node_webhook["External Alert Target"]

node_producer -->|"submits events"| node_intake
node_intake -->|"validates payload"| node_validation
node_intake -->|"forwards events"| node_processor
node_processor -->|"computes fingerprint"| node_fingerprint
node_processor -->|"persists event"| node_persistence
node_processor -->|"evaluates alerts"| node_alert_eval
node_processor -->|"updates error group"| node_persistence
node_persistence -->|"writes telemetry"| node_postgres
node_alert_eval -->|"inserts alert"| node_persistence
node_alert_eval -.->|"notifies optionally"| node_webhook
node_query_api -->|"runs queries"| node_query_db
node_query_db -->|"reads telemetry"| node_postgres
node_dashboard -->|"uses API client"| node_api_client
node_api_client -->|"requests REST data"| node_query_api
node_dashboard -->|"routes to"| node_overview
node_dashboard -->|"routes to"| node_live_logs
node_dashboard -->|"routes to"| node_errors
node_dashboard -->|"routes to"| node_alerts_ui
node_dashboard -->|"routes to"| node_services_ui
node_dashboard -->|"routes to"| node_load_ui
node_dashboard -->|"routes to"| node_infra_ui
node_load_ui -.->|"calls controls"| node_api_client
node_api_client -.->|"triggers demo"| node_demo
node_monitoring -.->|"scrapes metrics"| node_ingestion_app
node_monitoring -.->|"scrapes metrics"| node_processor
node_monitoring -.->|"scrapes metrics"| node_query_api

click node_intake "https://github.com/balaji-kvb/telemetryscope/blob/main/services/ingestion-service/routes/ingestion.py"
click node_validation "https://github.com/balaji-kvb/telemetryscope/blob/main/services/ingestion-service/validators/payload.py"
click node_ingestion_app "https://github.com/balaji-kvb/telemetryscope/blob/main/services/ingestion-service/app.py"
click node_processor "https://github.com/balaji-kvb/telemetryscope/blob/main/services/processing-service/app.py"
click node_fingerprint "https://github.com/balaji-kvb/telemetryscope/blob/main/services/processing-service/fingerprint.py"
click node_persistence "https://github.com/balaji-kvb/telemetryscope/blob/main/services/processing-service/processors/database.py"
click node_alert_eval "https://github.com/balaji-kvb/telemetryscope/blob/main/services/processing-service/processors/alerts.py"
click node_postgres "https://github.com/balaji-kvb/telemetryscope/blob/main/database/init/002_initial_schema.sql"
click node_query_api "https://github.com/balaji-kvb/telemetryscope/blob/main/services/query-service/app.py"
click node_query_db "https://github.com/balaji-kvb/telemetryscope/blob/main/services/query-service/queries/database.py"
click node_dashboard "https://github.com/balaji-kvb/telemetryscope/blob/main/frontend/src/App.jsx"
click node_api_client "https://github.com/balaji-kvb/telemetryscope/blob/main/frontend/src/services/api.js"
click node_overview "https://github.com/balaji-kvb/telemetryscope/blob/main/frontend/src/pages/Overview.jsx"
click node_live_logs "https://github.com/balaji-kvb/telemetryscope/blob/main/frontend/src/pages/LiveLogs.jsx"
click node_errors "https://github.com/balaji-kvb/telemetryscope/blob/main/frontend/src/pages/Errors.jsx"
click node_alerts_ui "https://github.com/balaji-kvb/telemetryscope/blob/main/frontend/src/pages/Alerts.jsx"
click node_services_ui "https://github.com/balaji-kvb/telemetryscope/blob/main/frontend/src/pages/Services.jsx"
click node_demo "https://github.com/balaji-kvb/telemetryscope/blob/main/demo-workload/app.py"
click node_load_ui "https://github.com/balaji-kvb/telemetryscope/blob/main/frontend/src/pages/LoadTest.jsx"
click node_infra_ui "https://github.com/balaji-kvb/telemetryscope/blob/main/frontend/src/pages/Infrastructure.jsx"
click node_monitoring "https://github.com/balaji-kvb/telemetryscope/blob/main/monitoring/prometheus/prometheus.yml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_intake,node_validation,node_ingestion_app toneBlue
class node_processor,node_fingerprint,node_persistence,node_alert_eval,node_postgres toneAmber
class node_query_api,node_query_db,node_dashboard,node_api_client,node_overview,node_live_logs,node_errors,node_alerts_ui,node_services_ui toneMint
class node_demo,node_load_ui,node_infra_ui,node_monitoring toneRose
class node_producer,node_webhook toneIndigo
```

## Components

### Telemetry Capture

- [Ingestion API](https://github.com/balaji-kvb/telemetryscope/blob/main/services/ingestion-service/routes/ingestion.py): `services/ingestion-service/routes/ingestion.py`
- [Payload Validation](https://github.com/balaji-kvb/telemetryscope/blob/main/services/ingestion-service/validators/payload.py): `services/ingestion-service/validators/payload.py`
- [Ingestion Service](https://github.com/balaji-kvb/telemetryscope/blob/main/services/ingestion-service/app.py): `services/ingestion-service/app.py`

### Processing & Alerts

- [Processing Endpoint](https://github.com/balaji-kvb/telemetryscope/blob/main/services/processing-service/app.py): `services/processing-service/app.py`
- [Error Fingerprinting](https://github.com/balaji-kvb/telemetryscope/blob/main/services/processing-service/fingerprint.py): `services/processing-service/fingerprint.py`
- [Event Persistence](https://github.com/balaji-kvb/telemetryscope/blob/main/services/processing-service/processors/database.py): `services/processing-service/processors/database.py`
- [Alert Evaluation](https://github.com/balaji-kvb/telemetryscope/blob/main/services/processing-service/processors/alerts.py): `services/processing-service/processors/alerts.py`
- [PostgreSQL](https://github.com/balaji-kvb/telemetryscope/blob/main/database/init/002_initial_schema.sql): `database/init/002_initial_schema.sql`

### Query & Investigation

- [Query & Control API](https://github.com/balaji-kvb/telemetryscope/blob/main/services/query-service/app.py): `services/query-service/app.py`
- [Analytics Queries](https://github.com/balaji-kvb/telemetryscope/blob/main/services/query-service/queries/database.py): `services/query-service/queries/database.py`
- [React Dashboard](https://github.com/balaji-kvb/telemetryscope/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Dashboard API Client](https://github.com/balaji-kvb/telemetryscope/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`
- [Overview & Timeline](https://github.com/balaji-kvb/telemetryscope/blob/main/frontend/src/pages/Overview.jsx): `frontend/src/pages/Overview.jsx`
- [Live Log Search](https://github.com/balaji-kvb/telemetryscope/blob/main/frontend/src/pages/LiveLogs.jsx): `frontend/src/pages/LiveLogs.jsx`
- [Error Investigation](https://github.com/balaji-kvb/telemetryscope/blob/main/frontend/src/pages/Errors.jsx): `frontend/src/pages/Errors.jsx`
- [Alert Console](https://github.com/balaji-kvb/telemetryscope/blob/main/frontend/src/pages/Alerts.jsx): `frontend/src/pages/Alerts.jsx`
- [Service Catalog](https://github.com/balaji-kvb/telemetryscope/blob/main/frontend/src/pages/Services.jsx): `frontend/src/pages/Services.jsx`

### Operations & Demo

- [Demo Workload](https://github.com/balaji-kvb/telemetryscope/blob/main/demo-workload/app.py): `demo-workload/app.py`
- [Load Controls](https://github.com/balaji-kvb/telemetryscope/blob/main/frontend/src/pages/LoadTest.jsx): `frontend/src/pages/LoadTest.jsx`
- [Infrastructure View](https://github.com/balaji-kvb/telemetryscope/blob/main/frontend/src/pages/Infrastructure.jsx): `frontend/src/pages/Infrastructure.jsx`
- [Prometheus & Grafana](https://github.com/balaji-kvb/telemetryscope/blob/main/monitoring/prometheus/prometheus.yml): `monitoring/prometheus/prometheus.yml`

### Other components

- **Telemetry Producers**
- **External Alert Target**

## Connections

- Telemetry Producers → Ingestion API: submits events (evidence: `README.md`)
- Ingestion API → Payload Validation: validates payload (evidence: `services/ingestion-service/routes/ingestion.py`)
- Ingestion API → Processing Endpoint: forwards events (evidence: `services/ingestion-service/routes/ingestion.py`)
- Processing Endpoint → Error Fingerprinting: computes fingerprint (evidence: `services/processing-service/app.py`)
- Processing Endpoint → Event Persistence: persists event (evidence: `services/processing-service/app.py`)
- Processing Endpoint → Alert Evaluation: evaluates alerts (evidence: `services/processing-service/app.py`)
- Processing Endpoint → Event Persistence: updates error group (evidence: `services/processing-service/app.py`)
- Event Persistence → PostgreSQL: writes telemetry (evidence: `services/processing-service/processors/database.py`)
- Alert Evaluation → Event Persistence: inserts alert (evidence: `services/processing-service/processors/alerts.py`)
- Alert Evaluation → External Alert Target: notifies optionally (evidence: `README.md`)
- Query & Control API → Analytics Queries: runs queries (evidence: `services/query-service/app.py`)
- Analytics Queries → PostgreSQL: reads telemetry (evidence: `services/query-service/queries/database.py`)
- React Dashboard → Dashboard API Client: uses API client
- Dashboard API Client → Query & Control API: requests REST data (evidence: `README.md`)
- React Dashboard → Overview & Timeline: routes to (evidence: `frontend/src/App.jsx`)
- React Dashboard → Live Log Search: routes to (evidence: `frontend/src/App.jsx`)
- React Dashboard → Error Investigation: routes to (evidence: `frontend/src/App.jsx`)
- React Dashboard → Alert Console: routes to (evidence: `frontend/src/App.jsx`)
- React Dashboard → Service Catalog: routes to (evidence: `frontend/src/App.jsx`)
- React Dashboard → Load Controls: routes to (evidence: `frontend/src/App.jsx`)
- React Dashboard → Infrastructure View: routes to (evidence: `frontend/src/App.jsx`)
- Load Controls → Dashboard API Client: calls controls (evidence: `frontend/src/pages/LoadTest.jsx`)
- Dashboard API Client → Demo Workload: triggers demo (evidence: `README.md`)
- Prometheus & Grafana → Ingestion Service: scrapes metrics
- Prometheus & Grafana → Processing Endpoint: scrapes metrics
- Prometheus & Grafana → Query & Control API: scrapes metrics
