Skip to main content

Crate jerrycan_observe

Crate jerrycan_observe 

Source
Expand description

Observability for jerrycan: request IDs, structured JSON access logs, /healthz, and a Prometheus /metrics endpoint. #![forbid(unsafe_code)].

Re-exports§

pub use metrics::Metrics;

Modules§

access_log
Request-id + access logging middleware, and the Observe extension wiring /healthz and /metrics. Logging output is structured JSON via tracing; tests assert behavior (header + metrics endpoints), not log lines.
metrics
A tiny global metrics registry rendered as Prometheus text. No histogram crate: counters are atomics, latency is fixed-bucket counters.

Structs§

Observe
The observability extension: app-wide access-log middleware + health/metrics routes sharing one metrics registry.

Functions§

init_logging
Initialize JSON logging once (call from main before serving). Idempotent; honors RUST_LOG. No-op if a global subscriber is already set.