Skip to main content

init_observability

Function init_observability 

Source
pub fn init_observability(log_level: &str) -> PrometheusHandle
Expand description

Initialises JSON tracing and the Prometheus metrics recorder.

Call once at process startup before any metrics or tracing macros are invoked. Returns the Prometheus render handle used by the /metrics HTTP handler.

Args:

  • log_level: Fallback log level (e.g. "info"). Overridden by RUST_LOG.

Usage:

let handle = std::sync::Arc::new(auths_telemetry::init_observability("info"));