tracing_opentelemetry

Function layer

Source
pub fn layer<S>() -> OpenTelemetryLayer<S, NoopTracer>
where S: Subscriber + for<'span> LookupSpan<'span>,
Expand description

Construct a layer to track spans via OpenTelemetry.

ยงExamples

use tracing_subscriber::layer::SubscriberExt;
use tracing_subscriber::Registry;

// Use the tracing subscriber `Registry`, or any other subscriber
// that impls `LookupSpan`
let subscriber = Registry::default().with(tracing_opentelemetry::layer());