Monitoring Observability

Observability conventions for xberg-io services — structured JSON logging, tracing spans and context fields, log-level semantics, Prometheus metric types and cardinality rules, and health endpoints wired to K8s probes. Load when adding logging, tracing, metrics, or health checks to a service.

kreuzberg-dev 427d116 853 B Updated

File contents

Monitoring / Observability

  • Logging: tracing crate (Rust) / structlog (Python), JSON output, key=value — never f-strings
  • Spans: #[instrument] macro, context fields (user_id, request_id)
  • Levels: ERROR (unrecoverable), WARN (degraded), INFO (state changes), DEBUG (flow), TRACE (off in prod)
  • Metrics: Prometheus — counter (requests), gauge (connections), histogram (latency), no high-cardinality labels
  • Health: /health endpoint with component status, wired to K8s liveness/readiness probes

kreuzberg-dev/ai-rulez/tree/main/modules/infrastructure/skills/monitoring-observability commit 427d116a1f

Frequently asked questions

npx skillmds@latest add kreuzberg-dev/monitoring-observability