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]>
51 lines
2.0 KiB
Bash
51 lines
2.0 KiB
Bash
# BitReport error reporting — Docker Compose (copy to `.env` in this directory).
|
|
# `docker compose` reads `.env` automatically for variable substitution in docker-compose.yml.
|
|
|
|
# --- MariaDB (service: mariadb) ---
|
|
ER_MYSQL_ROOT_PASSWORD=devrootchange
|
|
ER_MYSQL_USER=er_app
|
|
ER_MYSQL_PASSWORD=er_app_secret
|
|
ER_MYSQL_DATABASE=error_reporting
|
|
# Host port mapped to MariaDB (container listens on 3306)
|
|
ER_PUBLISH_MYSQL_PORT=3306
|
|
|
|
# --- Admin UI (Next.js, service: admin-ui) ---
|
|
ER_PUBLISH_ADMIN_PORT=3040
|
|
# 1 = Velzon layout with demo data (no admin API required). 0 = require ERROR_REPORTING_ADMIN_API_BASE.
|
|
ERROR_REPORTING_UI_DEMO=1
|
|
# When admin Fastify API serves /v1/incidents (service `api`, not ingest-api), e.g.:
|
|
# ERROR_REPORTING_ADMIN_API_BASE=http://api:3050
|
|
# Ingest API URL for Next.js reverse-proxy rewrites (default http://127.0.0.1:3041).
|
|
# In Docker Compose this should be http://ingest-api:3041.
|
|
# INGEST_API_URL=http://ingest-api:3041
|
|
|
|
# --- Ingest API (service: ingest-api) ---
|
|
ER_PUBLISH_INGEST_PORT=3041
|
|
# Optional rate limiting (defaults match ingest-api/src/config/env.ts)
|
|
# INGEST_RATE_LIMIT_MAX=300
|
|
# INGEST_RATE_LIMIT_WINDOW_MS=60000
|
|
|
|
# --- Collector worker (service: collector-worker) ---
|
|
# Demo token for the seeded HTTP fixture source (must match project token in DB seed)
|
|
ER_COLLECTOR_PROJECT_ALPHA_TOKEN=er_tst_a_secret_one
|
|
# TICK_INTERVAL_MS=3000
|
|
# SOURCE_REFRESH_MS=15000
|
|
# HTTP_FETCH_TIMEOUT_MS=15000
|
|
# INGEST_PUSH_TIMEOUT_MS=60000
|
|
# INGEST_PUSH_MAX_RETRIES=3
|
|
# INGEST_PUSH_RETRY_BASE_MS=500
|
|
# INGEST_PUSH_RETRY_MAX_JITTER_MS=250
|
|
# 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
|