Observability
Logging
Section titled “Logging”Python (config/logging.py) emits structured JSON logs (LOG_FORMAT=json) with OpenTelemetry trace/span IDs. Notable details:
DropRootNoiseFiltersuppresses noisy root loggers.- A dedicated filter tames the jarm coroutine warning.
- Business events log with
extra={...}payloads (e.g.report_ai_provider_unavailablecarriesreasonandprovider_type).
Rails uses lograge (~0.15) to collapse request logs to a single line per request.
Tracing
Section titled “Tracing”The Python FastAPI app is instrumented with OpenTelemetry (FastAPIInstrumentor.instrument_app), so trace and span IDs flow through every JSON log line, letting you correlate logs to a single scan/finding operation.
Error tracking
Section titled “Error tracking”Both services send errors to a Sentry-compatible endpoint — GlitchTip, self-hosted in the compose stack:
| Service | Variable |
|---|---|
| Python | SENTRY_DSN_PYTHON |
| Rails | SENTRY_DSN_RUBY |
GlitchTip runs as glitchtip-web (port 8080) plus glitchtip-worker, with its own Postgres database (brand_protect_glitchtip, created by db/init/glitchtip.sql).
Health checks
Section titled “Health checks”| Endpoint | Service | Notes |
|---|---|---|
GET /up |
Rails | Liveness; used by the e2e wait loop |
GET /health |
Python | Liveness; the only unauthenticated Python route |