logo
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());