How thazbi/vehical-health-and-telemetry works
SAJIVITA is a three-service vehicle monitoring platform: users register vehicles and configure per-vehicle limits, submit validated telemetry, then separately request alert evaluation. Vehicle and telemetry records and alert state are in memory. The README also documents a local dashboard and an optional Prometheus/Grafana/Loki/Alloy monitoring stack. Source excerpts show the service handlers, stores, and alert rules; monitoring integrations are included only at the README-documented level.
Main entry points: app/main.py Vehicle API · app/main.py Telemetry API · app/main.py Alert API · demo_host.py Local demo host
Components 23
Vehicle registry
- Vehicle API
services/vehicle_service/app/main.py - Vehicle registry
services/vehicle_service/app/core/store.py - Vehicle preferences
services/vehicle_service/app/models/vehicle.py
Telemetry ingestion
- Telemetry API
services/telemetry_service/app/main.py - Telemetry validation
services/telemetry_service/app/models/telemetry.py - Telemetry history
services/telemetry_service/app/core/store.py - Vehicle lookup client
services/telemetry_service/app/services/vehicle_client.py
Alert evaluation
- Alert API
services/alert_service/app/main.py - Alert event models
services/alert_service/app/models/alert.py - Preference client
services/alert_service/app/services/vehicle_client.py - Threshold rules
services/alert_service/app/services/rules.py - Alert lifecycle state
services/alert_service/app/core/store.py
Observability
- Vehicle metrics
services/vehicle_service/app/core/metrics.py - Vehicle logging
services/vehicle_service/app/core/logging_config.py - Telemetry metrics
services/telemetry_service/app/core/metrics.py - Telemetry logging
services/telemetry_service/app/core/logging_config.py - Alert metrics
services/alert_service/app/core/metrics.py - Alert logging
services/alert_service/app/core/logging_config.py - Prometheus
- Grafana dashboards
- Loki and Alloy
Other components
- User or dashboard
- Local demo host
scripts/demo_host.py
Connections 29
- User or dashboard → Local demo host: uses demo
- Local demo host → Vehicle API: registers vehicles
- Local demo host → Vehicle API: sets preferences
- Local demo host → Telemetry API: submits readings
- Local demo host → Alert API: requests evaluation
- Vehicle API → Vehicle registry: reads and writes
services/vehicle_service/app/main.py - Vehicle registry → Vehicle preferences: stores records
services/vehicle_service/app/core/store.py - Telemetry API → Telemetry validation: validates input
services/telemetry_service/app/main.py - Telemetry API → Vehicle lookup client: checks vehicle
services/telemetry_service/app/main.py - Vehicle lookup client → Vehicle API: fetches vehicle
services/telemetry_service/app/services/vehicle_client.py - Telemetry API → Telemetry history: stores and lists
services/telemetry_service/app/main.py - Telemetry history → Telemetry validation: stores records
services/telemetry_service/app/core/store.py - Alert API → Alert event models: accepts event
services/alert_service/app/main.py - Alert API → Preference client: gets preferences
services/alert_service/app/main.py - Preference client → Vehicle API: fetches preferences
- Alert API → Alert lifecycle state: evaluates and queries
services/alert_service/app/main.py - Alert lifecycle state → Threshold rules: evaluates thresholds
services/alert_service/app/core/store.py - Alert lifecycle state → Alert event models: tracks alert state
services/alert_service/app/core/store.py - Vehicle API → Vehicle metrics: updates metrics
services/vehicle_service/app/main.py - Vehicle API → Vehicle logging: logs requests
services/vehicle_service/app/main.py - Telemetry API → Telemetry metrics: updates metrics
services/telemetry_service/app/main.py - Telemetry API → Telemetry logging: logs requests
services/telemetry_service/app/main.py - Alert API → Alert metrics: updates metrics
services/alert_service/app/main.py - Alert API → Alert logging: logs requests
services/alert_service/app/main.py - Prometheus → Vehicle API: scrapes metrics
- Prometheus → Telemetry API: scrapes metrics
- Prometheus → Alert API: scrapes metrics
- Grafana dashboards → Prometheus: uses datasource
- Loki and Alloy → Grafana dashboards: supplies logs