Internals: decision records
ADR-0005: Metrics, logs and bounded cardinality
- Status: Accepted (2026-10-05)
Decision
prometheus-client(official Rust client of the Prometheus project) for metrics, served as text exposition on a dedicated listener (loopback by default).tracing+tracing-subscriberwith JSON output for structured logs; one access-log event per request (targetscalws::access).- Label policy: only
tenant,app(from config, bounded),listener(config),method(normalised to a fixed set +OTHER),statusclass (1xx..5xx),handlerkind. Never URLs, query strings, user agents or Host values. Unrouted requests usetenant="_unmatched". - OpenTelemetry trace export (OTLP) is deferred until after M2 so that the dependency
footprint is justified by a working runtime platform; spans are already emitted via
tracing, so adding an OTLP layer is additive.