trails/apps/journal/app/routes
Ullrich Schäfer 49aadd04a9
Add observability: health endpoints, structured logging, metrics, Grafana stack
Health endpoints:
- /api/health (Journal) and /health (Planner) with DB connectivity check
- Docker healthchecks updated to use app health endpoints

Structured logging:
- Pino with JSON output in production, pretty-print in dev
- Request logging middleware in Planner (method, path, status, duration)
- Replaced console.log/error with structured logger in email and auth flows

Prometheus metrics:
- prom-client with default Node.js metrics + custom histograms/gauges
- /metrics endpoints on both apps
- http_request_duration, planner_active_sessions, brouter_request_duration

Monitoring stack:
- Prometheus, Loki, Grafana containers in docker-compose
- Grafana provisioned with datasources, dashboards, and alert rules
- Caddy access logging (JSON to stdout for Loki)
- grafana.trails.cool with basic auth via Caddy

Dashboards and alerting:
- Overview: request rate, error rate, latency p50/p95/p99
- Planner: active sessions, connected clients, BRouter latency
- Infrastructure: memory, CPU, event loop lag
- Alerts: disk >80%, app down 2min, error rate >5%

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 22:59:44 +01:00
..
activities.$id.tsx Implement Journal activity feed (Group 10) 2026-03-24 23:20:04 +01:00
activities._index.tsx Implement Journal activity feed (Group 10) 2026-03-24 23:20:04 +01:00
activities.new.tsx Implement Journal activity feed (Group 10) 2026-03-24 23:20:04 +01:00
api.auth.login.ts Add transactional emails (SMTP) and planner features (no-go areas, notes, crash recovery) 2026-03-26 01:00:42 +01:00
api.auth.register.ts Add observability: health endpoints, structured logging, metrics, Grafana stack 2026-03-26 22:59:44 +01:00
api.health.ts Add observability: health endpoints, structured logging, metrics, Grafana stack 2026-03-26 22:59:44 +01:00
api.metrics.ts Add observability: health endpoints, structured logging, metrics, Grafana stack 2026-03-26 22:59:44 +01:00
api.routes.$id.callback.ts Fix CORS on Planner→Journal callback endpoint 2026-03-25 01:16:32 +00:00
api.routes.$id.edit-in-planner.ts Fix waypoint loading in Edit in Planner flow 2026-03-24 20:22:58 +00:00
api.routes.$id.gpx.ts Fix GPX export: use API route with direct download link 2026-03-24 20:22:58 +00:00
auth.login.tsx Wire up i18n in both apps 2026-03-25 01:47:58 +00:00
auth.logout.tsx Implement Journal auth: passkeys + magic links, no passwords 2026-03-23 17:38:46 +01:00
auth.register.tsx Wire up i18n in both apps 2026-03-25 01:47:58 +00:00
auth.verify.tsx Implement Journal auth: passkeys + magic links, no passwords 2026-03-23 17:38:46 +01:00
home.tsx Sentry improvements: context, tracing, source maps, privacy manifest 2026-03-25 03:11:07 +01:00
privacy.tsx Add transactional emails (SMTP) and planner features (no-go areas, notes, crash recovery) 2026-03-26 01:00:42 +01:00
routes.$id.edit.tsx Implement Journal route management (Group 8) 2026-03-23 22:25:10 +01:00
routes.$id.tsx Wire up i18n in both apps 2026-03-25 01:47:58 +00:00
routes._index.tsx Wire up i18n in both apps 2026-03-25 01:47:58 +00:00
routes.new.tsx Implement Journal route management (Group 8) 2026-03-23 22:25:10 +01:00
users.$username.tsx Implement Journal auth: passkeys + magic links, no passwords 2026-03-23 17:38:46 +01:00