Skip to main content

init

Function init 

Source
pub fn init(dev_mode: bool, otel_endpoint: Option<&str>)
Expand description

Initialize the global tracing subscriber.

In dev mode: pretty-printed stdout. In production: JSON + optional OTLP exporter (gRPC/tonic to otel_endpoint).

If otel_endpoint is Some, a batch OTLP trace exporter is installed and spans are exported to the given gRPC endpoint (e.g. http://localhost:4317). An OTLP metrics pipeline is also installed when an endpoint is provided.