feat(observability): integrate Loki for centralised log aggregation (BIT-14248)

Adds Grafana Loki + Promtail to the Docker Compose observability profile,
enabling structured-log collection from all errors.bitreport.pt services.

- deploy/loki/loki.yaml: Loki server (filesystem storage, TSDB v13, 30-day retention)
- deploy/loki/promtail.yaml: Docker SD auto-discovery, JSON parse, Pino level normalisation
- deploy/grafana/loki-logs-dashboard.json: Grafana log dashboard (uid er-loki-logs)
- docs/OBSERVABILITY_LOKI.md: setup, key LogQL queries, troubleshooting runbook
- docker-compose.yml: loki + promtail services under --profile observability; LOG_LEVEL env
- .env.example / ingest-api/.env.example: LOG_LEVEL + ER_PUBLISH_LOKI_PORT documented

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
David SantosandClaude Sonnet 4.6 committed 2026-04-27 08:03:20 +00:00
1 parent 94d2d12c97
commit 8bb49ce32b
7 files changed
+929

No files matched your search

+8
View File
@@ -38,5 +38,13 @@ ER_COLLECTOR_PROJECT_ALPHA_TOKEN=er_tst_a_secret_one
# MAX_BACKOFF_EXPONENT=8
# COLLECTOR_DEFAULT_INGEST_TOKEN=
# --- Log level (ingest-api, collector-worker, api) ---
# Controls verbosity. Values: trace | debug | info | warn | error | fatal
# LOG_LEVEL=info
# --- Observability: Loki (profile: observability) ---
# Host port mapped to Loki HTTP API
# ER_PUBLISH_LOKI_PORT=3100
# Node apps (ingest-api, collector-worker, api/) expect:
# DATABASE_URL=mysql://USER:PASSWORD@HOST:PORT/DATABASE