Observability Baseline (Sprint 3 Card #37)
This is an incremental observability foundation for backend_v2 focused on practical CI/local signal quality.
Included Now
- Request correlation IDs (
X-Request-ID) echoed on all responses. - Lightweight in-process counters for request volume, 5xx errors, and latency.
- Summary endpoint for machine-readable health signal:
GET /api/system/observability/summary- Synthetic checks for critical paths:
/health/api/system/alpaca/verify/api/historical-data/dataschema sanity
Run Synthetic Checks
From backend_v2:
python cli.py synthetic-checks --in-process
Against a running backend:
python cli.py synthetic-checks --base-url http://localhost:5001
Strict Alpaca mode (credentials required):
python cli.py synthetic-checks --strict-alpaca
Write CI artifact:
python cli.py synthetic-checks --in-process --output ./artifacts/synthetics-summary.json
Exit Codes
0: checks passed (warnings allowed)1: one or more checks failed
Notes
- Non-strict mode treats missing Alpaca credentials as warning to avoid breaking local workflows.
- This baseline is intentionally minimal and does not require Grafana/OTel wiring yet.