Tracksolid deployment with timescale & grafana with backup
Find a file
david kiania 8d386bf27a
Some checks failed
Static Analysis / static (push) Waiting to run
Tests / test (push) Waiting to run
Static Analysis / static (pull_request) Has been cancelled
Tests / test (pull_request) Has been cancelled
fix: BUG-01 ETL type crash, BUG-02 multi-account audit, BUG-03 diagnostic
BUG-01 (CRITICAL): dwh_gold.refresh_daily_metrics inserted t.imei (TEXT) into
fact_daily_fleet_metrics.vehicle_key (INTEGER REFERENCES dim_vehicles), so the
nightly ETL would have raised "invalid input syntax for type integer" on every
run. Migration 08 backfills dim_vehicles from tracksolid.devices and rewrites
the function to JOIN through dim_vehicles, returning the serial vehicle_key.
The function also re-syncs dim_vehicles at the top of each call so newly
registered devices appear in the warehouse without manual seeding.

BUG-02 (HIGH): sync_driver_audit.py only queried TARGET_ACCOUNT, ignoring the
Fireside@HQ and Fireside_MSA sub-accounts. The audit now iterates TARGETS
(matching FIX-M19 in ingest_movement_rev.sync_devices), dedupes devices by
IMEI, and tolerates per-target failures.

BUG-03 (HIGH, diagnostic only): the webhook trip handler stores item["miles"]
straight into distance_km. The field name is suspicious and FIX-M16 already
proved the polling endpoint mis-documents its units. Added a SQL diagnostic
that compares the distribution of stored-km / great-circle-km for push-source
vs poll-source trips over 30 days — the ratio test will tell us whether the
push value needs a /1.609 (miles), /1000 (metres), or no conversion. The
existing calculation is left unchanged until the data confirms the unit; the
old FIX-M11 comment is replaced with a BUG-03 pointer to the diagnostic.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 15:34:43 +03:00
.forgejo/workflows feat: add db_audit health checks, runner, and scheduled Forgejo workflow 2026-04-12 21:40:29 +03:00
administration Add DB connection string to ops manual, add administration notes, remove stale deploy guide 2026-04-10 22:34:56 +03:00
backup feat(backup): timestamp and schedule in Africa/Nairobi local time 2026-04-24 11:30:20 +03:00
db_audit fix: BUG-01 ETL type crash, BUG-02 multi-account audit, BUG-03 diagnostic 2026-05-15 15:34:43 +03:00
docs feat: Daily Operations dashboard + tracksolid analytics views 2026-04-19 13:44:18 +03:00
grafana fix(grafana): raise geomap maxZoom from 12 to 22 for full-resolution drill-in 2026-04-27 18:32:21 +03:00
n8n-workflows Add n8n workflow templates and change webhook port to 8888 2026-04-08 18:54:42 +03:00
tests perf+fix: SAVEPOINT-per-item pollers, batched GPS inserts, parallel detail fetch 2026-04-18 00:33:55 +03:00
.env fix: point DATABASE_URL at timescale_db container (not legacy 31.97.44.246:5888) 2026-04-18 15:43:49 +03:00
.gitignore Add webhook receiver, consolidate shared utilities, expand telemetry coverage 2026-04-08 16:31:17 +03:00
.python-version chore: align .python-version to 3.12.0 (matches Docker image and pyproject.toml) 2026-04-12 21:41:43 +03:00
01_BusinessAnalytics.md docs: update analytics report with live DB state (18 Apr 2026) 2026-04-18 08:39:58 +03:00
02_tracksolid_docker_commands.md Add 02_tracksolid_docker_commands.md — remote DB command reference 2026-04-11 08:23:01 +03:00
02_tracksolid_full_schema_rev.sql Add webhook receiver, consolidate shared utilities, expand telemetry coverage 2026-04-08 16:31:17 +03:00
03_webhook_schema_migration.sql Add webhook receiver, consolidate shared utilities, expand telemetry coverage 2026-04-08 16:31:17 +03:00
04_bug_fix_migration.sql Fix alarm field mapping, distance unit bug, parking params; add schema migrations 2026-04-10 22:18:30 +03:00
05_enhancement_migration.sql Fix alarm field mapping, distance unit bug, parking params; add schema migrations 2026-04-10 22:18:30 +03:00
06_business_analytics_migration.sql feat: business analytics expansion + driver CSV import 2026-04-18 08:30:34 +03:00
07_analytics_views.sql feat: Daily Operations dashboard + tracksolid analytics views 2026-04-19 13:44:18 +03:00
08_fix_etl_vehicle_key.sql fix: BUG-01 ETL type crash, BUG-02 multi-account audit, BUG-03 diagnostic 2026-05-15 15:34:43 +03:00
260410_baseline_report.md Regenerate 260410_baseline_report.md from live database (post-migration) 2026-04-11 07:42:33 +03:00
260412_baseline_report.md Add 260412 baseline report — first trip data, FIX-M16 confirmed 2026-04-12 00:14:27 +03:00
20260414_FS__Logistics - final_fixed.csv fix: auto-register devices on push + allow CSV import to insert new rows 2026-04-21 12:29:32 +03:00
CLAUDE.md feat: [FIX-M19] multi-account ingest across fireside sub-accounts 2026-04-24 10:43:07 +03:00
docker-compose.yaml feat(backup): timestamp and schedule in Africa/Nairobi local time 2026-04-24 11:30:20 +03:00
Dockerfile Fix migration failures: switch to full TimescaleDB + use psql runner 2026-04-08 17:17:58 +03:00
grafanaDeployment.md Add Grafana NOC fleet dashboard with provisioning 2026-04-09 00:01:52 +03:00
grafanaOperationalManual.md Add Grafana NOC operational manual 2026-04-09 00:12:48 +03:00
import_drivers_csv.py fix: auto-register devices on push + allow CSV import to insert new rows 2026-04-21 12:29:32 +03:00
ingest_events_rev.py perf+fix: SAVEPOINT-per-item pollers, batched GPS inserts, parallel detail fetch 2026-04-18 00:33:55 +03:00
ingest_movement_rev.py feat: [FIX-M19] multi-account ingest across fireside sub-accounts 2026-04-24 10:43:07 +03:00
OPERATIONS_MANUAL.md Replace hardcoded container names with dynamic lookup 2026-04-10 23:09:01 +03:00
pyproject.toml ci: add ruff + mypy static analysis config and Forgejo workflow 2026-04-12 21:32:33 +03:00
README.md first commit 2026-04-07 20:41:16 +03:00
run_migrations.py fix: BUG-01 ETL type crash, BUG-02 multi-account audit, BUG-03 diagnostic 2026-05-15 15:34:43 +03:00
run_migrations.sh Add idempotent migration runner script 2026-04-10 23:31:57 +03:00
sync_driver_audit.py fix: BUG-01 ETL type crash, BUG-02 multi-account audit, BUG-03 diagnostic 2026-05-15 15:34:43 +03:00
tracksolid_DB_manual.md Replace hardcoded container names with dynamic lookup 2026-04-10 23:09:01 +03:00
tracksolidApiDocumentation.md Update tracksolidApiDocumentation.md with live implementation findings 2026-04-11 07:52:28 +03:00
ts_shared_rev.py feat: [FIX-M19] multi-account ingest across fireside sub-accounts 2026-04-24 10:43:07 +03:00
webhook_receiver_rev.py fix: BUG-01 ETL type crash, BUG-02 multi-account audit, BUG-03 diagnostic 2026-05-15 15:34:43 +03:00