feat: add end-to-end observability (metrics, health, mobile RUM, dashboards, alerts) #32

Manually merged
Ichitux merged 8 commits from feat/observability-metrics-monitoring into main 2026-07-14 11:44:36 +00:00

8 Commits

Author SHA1 Message Date
Antoni Nuñez Romeu 809d4b8a7f Fixed backend test
Run Tests on Branches / Detect Changes (push) Successful in 12s
Run Tests on Branches / Frontend Tests (push) Has been skipped
Run Tests on Branches / Frontend Mobile Tests (push) Successful in 1m34s
Run Tests on Branches / Backend Tests (push) Successful in 1m36s
2026-07-14 13:38:16 +02:00
Antoni Nuñez Romeu e281bd4fa8 fix: skip Redis connection in test mode — prevents CI hang
Run Tests on Branches / Frontend Mobile Tests (push) Successful in 1m58s
Run Tests on Branches / Detect Changes (push) Successful in 12s
Run Tests on Branches / Backend Tests (push) Failing after 1m58s
Run Tests on Branches / Frontend Tests (push) Has been skipped
The top-level await redisClient.connect() in redis-client.js was
blocking module import when no Redis server is available (CI env).
Add NODE_ENV guard + reconnect strategy with max retries.
2026-07-14 13:25:17 +02:00
Antoni Nuñez Romeu 52b5b72cfb ci: optimize test performance — from ~3h to 3.5s
- Lazy-load tesseract.js only in OCR route (skips 30MB WASM download)
- Conditional tracing.js import (skip OTel gRPC in test mode)
- Remove unused barcode-detector import
- Add testTimeout/openHandlesTimeout to jest.config.js
- Add --forceExitTimeout=30000 to test script
- Split CI test jobs into parallel workflows (backend/frontend/mobile)
- Add timeout-minutes: 15 to all test jobs
- Use npm ci --ignore-scripts + selective native rebuild
2026-07-14 13:24:19 +02:00
Ichitux 84bf5f3f79 Merge branch 'main' into feat/observability-metrics-monitoring
Run Tests on Branches / Run Tests (push) Failing after 3h11m0s
2026-07-13 23:08:19 +00:00
Ichitux ee42562e13 Merge branch 'main' into feat/observability-metrics-monitoring
Run Tests on Branches / Detect Changes (push) Successful in 14s
Run Tests on Branches / Frontend Tests (push) Has been skipped
Run Tests on Branches / Frontend Mobile Tests (push) Successful in 2m5s
Run Tests on Branches / Backend Tests (push) Failing after 3h10m31s
2026-07-13 18:52:58 +00:00
Antoni Nuñez Romeu 1318243841 fix(backend): use string resource attribute keys instead of semantic-conventions named exports
Run Tests on Branches / Detect Changes (push) Successful in 13s
Run Tests on Branches / Frontend Tests (push) Has been cancelled
Run Tests on Branches / Frontend Mobile Tests (push) Has been cancelled
Run Tests on Branches / Backend Tests (push) Has been cancelled
The resolved @opentelemetry/semantic-conventions version in CI does not
export ATTR_SERVICE_NAMESPACE/ATTR_SERVICE_NAME as named exports, breaking
the backend test import. Use plain 'service.name'/'service.namespace'
string keys so the code is independent of the semantic-conventions version.
2026-07-13 16:35:45 +02:00
Antoni Nuñez Romeu b8b8655634 Package json outdated
Run Tests on Branches / Detect Changes (push) Successful in 9s
Run Tests on Branches / Backend Tests (push) Failing after 2m18s
Run Tests on Branches / Frontend Tests (push) Has been skipped
Run Tests on Branches / Frontend Mobile Tests (push) Successful in 2m17s
2026-07-13 16:23:20 +02:00
Antoni Nuñez Romeu 839c64c12a feat: add end-to-end observability (metrics, health, mobile RUM, dashboards, alerts)
Run Tests on Branches / Detect Changes (push) Successful in 10s
Run Tests on Branches / Backend Tests (push) Failing after 20s
Run Tests on Branches / Frontend Tests (push) Has been skipped
Run Tests on Branches / Frontend Mobile Tests (push) Failing after 20s
- Backend: OTel metrics via OTLP -> Alloy -> Prometheus (OTEL_METRICS_EXPORTER=otlp)
- New business metrics (src/metrics.js): searches, CIMA latency/errors, cache
  hits/misses, logins, rate-limits, pharmacy writes/links, push sent/failed,
  DB + Redis timings/errors, HTTP req count/duration, heartbeat
- Backend health endpoints /healthz and /readyz
- Mobile (Expo): Grafana Faro RUM via @grafana/faro-react-native
- redis/postgres exporters in docker-compose + Prometheus scrape jobs
- Grafana dashboards (backend, datastores, mobile RUM, overview)
- Prometheus alert rules (farmafinder_*) -> existing Alertmanager (Telegram)
- Design/spec saved to docs/superpowers/specs/
2026-07-13 15:57:52 +02:00