Skip to content

Observability

Python (config/logging.py) emits structured JSON logs (LOG_FORMAT=json) with OpenTelemetry trace/span IDs. Notable details:

  • DropRootNoiseFilter suppresses noisy root loggers.
  • A dedicated filter tames the jarm coroutine warning.
  • Business events log with extra={...} payloads (e.g. report_ai_provider_unavailable carries reason and provider_type).

Rails uses lograge (~0.15) to collapse request logs to a single line per request.

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.

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).

Endpoint Service Notes
GET /up Rails Liveness; used by the e2e wait loop
GET /health Python Liveness; the only unauthenticated Python route