Skip to main content

Module otel

Module otel 

Source
Expand description

Opt-in OTLP tracing exporter for the engine’s spans (, gated by the tracing-otel feature).

Construct a layer with install_otlp_layer and compose it into your host’s tracing_subscriber::Registry. The framework deliberately does NOT install a global subscriber - span emission, runtime ownership, and dispatch-default registration all stay with the host.

§Example

use tracing_subscriber::prelude::*;
let otel = bytesandbrains::telemetry::otel::install_otlp_layer(
    "my-service",
    "http://localhost:4317",
)?;
tracing_subscriber::registry()
    .with(tracing_subscriber::fmt::layer())
    .with(otel)
    .init();

Structs§

InstallError
Error returned when constructing the OTLP layer fails.

Functions§

install_otlp_layer
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.