Observability
| Signal | Implementation | Destination (production) |
|---|---|---|
| Logs | pkg/logging: slog JSON on stdout, enriched with trace and span IDs | Loki |
| Traces | pkg/telemetry: OpenTelemetry SDK, OTLP gRPC export when OTEL_EXPORTER_OTLP_ENDPOINT is set; Gin instrumented with otelgin | Tempo |
| Metrics | OpenTelemetry → Prometheus exporter, served on METRICS_ADDR (/metrics, private listener) | Prometheus |
| Alerts | — (planned: Alertmanager → notifications service + alert mailing list) |
- Correlation: the request ID (
pkg/httpx) travels in the principal token (rid) and in audit records (request_id,trace_id). Incoming HTTP requests are traced byotelgin; Kafka events carry the W3Ctraceparent(CloudEvents) and consumers continue the trace. - Gap: the authz ConnectRPC client (
pkg/authzclient) is a plainhttp.Clientwithout trace propagation, so permission checks are not linked to the caller trace yet. - Health:
/healthz(liveness, always 200) and/readyz(readiness: MongoDB, Kafka, Permify, immudb… registered per service). Health requests are excluded from access logs. - vision (Python): JSON logs, OpenTelemetry tracing over OTLP/HTTP, Prometheus
/metricson the main port.
The monitoring stack (Grafana, Loki, Tempo, Prometheus, Alertmanager) is not part of the local compose file.