klauthed-observability
Observability for klauthed services: structured logging/tracing, Prometheus metrics, and
OpenTelemetry trace export — all from one TelemetryConfig.
init installs the global tracing subscriber (and, per feature + config, the metrics
recorder and the OTLP trace pipeline) and returns a Telemetry handle. Keep it alive for
the program's lifetime; dropping it flushes OpenTelemetry spans.
use ;
use Profile;
let config = for_profile;
let _telemetry = init.expect;
info!;
Features
| Feature | Enables |
|---|---|
metrics |
Prometheus recorder + a /metrics render handle |
otel |
OTLP trace export + the propagation module |
With otel, the propagation module carries W3C trace context across service
boundaries: extract a parent context from an inbound request's headers, and
inject / inject_current the active span into outbound request headers. Paired
with klauthed-web's RequestTracing middleware, this stitches per-service spans
into a single distributed trace.
Part of the klauthed rust-libraries workspace.
Browse the API: cargo doc -p klauthed-observability --open.
License
Dual-licensed under MIT or Apache-2.0, at your option.