Skip to main content

install_otlp_layer

Function install_otlp_layer 

Source
pub fn install_otlp_layer(
    service_name: &str,
    endpoint: &str,
) -> Result<OpenTelemetryLayer<Registry, Tracer>, InstallError>
Expand description

Build an OTLP-exporting tracing layer that the host can .with(...) into a tracing_subscriber::Registry. Spans emitted by the engine (engine.poll, engine.phase*, engine.invoke_one, engine.deliver_fill, …) propagate to the configured collector endpoint.

service_name becomes the OTel service.name resource attribute. endpoint is the OTLP gRPC endpoint (typically http://localhost:4317).