Commit Graph
8 Commits
Author SHA1 Message Date
David Santos 113eee0b97 feat(obs): add Loki ruler alert rules and MONITORING.md Loki section (BIT-19957)
- deploy/loki/rules/fake/errors_hub_alerts.yaml: four LogQL-based Loki ruler
  alert rules (error rate per service, fatal detection, ingest-api sustained
  errors, collector-worker stall detection)
- deploy/loki/loki.yaml: add explicit ruler.storage (local), rule_path, and
  enable_api/enable_alertmanager_v2 so Loki loads rules from /loki/rules
- docker-compose.yml: mount deploy/loki/rules → /loki/rules:ro in the loki
  service (observability profile)
- docs/MONITORING.md: add Loki section with label table, alert rule summary,
  config file index, and LXC deployment note

Paperclip-Issue: BIT-19957
Paperclip-Agent: cto
2026-05-14 09:31:31 +00:00
David SantosandClaude Sonnet 4.6 8bb49ce32b 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]>
2026-04-27 08:03:20 +00:00
David Santos 7daa867374 chore(lab): sync working tree from Paperclip execution host (10.10.50.17)
CI / Test ingest-api (push) Has been cancelled
CI / Test api (push) Has been cancelled
CI / Lint and typecheck admin-ui (push) Has been cancelled
CI / Validate Docker build (push) Has been cancelled
2026-04-16 10:24:33 +00:00
David Santos 1099cbb724 collector-worker: bound ingest POST with INGEST_PUSH_TIMEOUT_MS (BIT-2600)
CI / Test ingest-api (push) Has been cancelled
CI / Test api (push) Has been cancelled
CI / Lint and typecheck admin-ui (push) Has been cancelled
CI / Validate Docker build (push) Has been cancelled
Add AbortController timeout to pushEventsToIngest (error ingest_push_timeout),
env INGEST_PUSH_TIMEOUT_MS (default 60s, minimum 1s), Vitest coverage, and
compose/env.example documentation.

Made-with: Cursor
2026-04-12 11:51:03 +00:00
Peter Spark 3b175eec86 fix(admin-ui): proxy ingest API through Next.js rewrites (BIT-750)
The single-domain deployment (errors.bitreport.pt) routed all traffic
through the admin-ui, whose auth middleware redirected /v1/ingest/events
and /health to /login — making the ingest API unreachable from outside.

- middleware.ts: pass through /v1/* and /health without auth redirect
- next.config.ts: rewrite /v1/* and /health to ingest-api backend
  (INGEST_API_URL env, default http://127.0.0.1:3041)
- docker-compose.yml: set INGEST_API_URL=http://ingest-api:3041
- env examples: document INGEST_API_URL
- scripts/onboard-project.sh: generate project + ingest key SQL

Paperclip-Agent: peter-spark
Paperclip-Issue: BIT-750
Paperclip-Run: dc5b7949-b24d-4867-a2cd-cf4f47477ef8
2026-04-03 10:01:55 +00:00
1sonhadorandPaperclip 563f644861 compose: add admin-ui service on port 3040 (Next standalone)
Expose Velzon admin dashboard in docker-compose with ERROR_REPORTING_UI_DEMO=1
by default until admin API serves /v1/incidents. Document env vars in .env.example.

Co-Authored-By: Paperclip <[email protected]>
2026-03-23 19:50:30 +00:00
1sonhadorandPaperclip 4604606033 feat(errors): migrate error-reporting stack from PostgreSQL to MariaDB (BIT-255)
Replace Postgres with MariaDB 11 in docker-compose; convert all
database/error_reporting and db/migrations SQL to InnoDB-friendly syntax
(DATETIME(6), AUTO_INCREMENT, ON DUPLICATE KEY). Run admin portal DDL in the
same migrate one-shot as error_reporting.

Switch ingest-api, collector-worker, and api from pg to mysql2 (pools,
parameterized queries, transactions). Align ingest writes with
er_incident_occurrences and include project_id on idempotency inserts.

Add scripts/run-mysql-migrations.sh for host-side applies; update LXC
run-migrate/verify, deployment docs, and .env.example (mysql://, ER_MYSQL_*).

Verified: npm run build + npm test in ingest-api and collector-worker;
npm run build in api. Full docker compose not run here (no local daemon).

Co-Authored-By: Paperclip <[email protected]>
2026-03-22 19:29:11 +00:00
1sonhadorandPaperclip b0b733d5e1 feat(BIT-247): consolidate error reporting repo from OTT
Merge ingest-api, collector-worker, admin-ui, database/error_reporting, deploy/lxc,
docker-compose, and deployment docs into the dedicated repository. Paths updated
for repo root (ER_REPO_ROOT, systemd WorkingDirectory). Root README documents layout.

Co-Authored-By: Paperclip <[email protected]>
2026-03-22 18:20:27 +00:00