fn init_telemetry() {
    let app_name = "tracing-actix-web-demo";

    global::set_text_map_propagator(TraceContextPropagator::new());
    let tracer = opentelemetry_jaeger::new_pipeline()
        .with_service_name(app_name)
        .install_batch(TokioCurrentThread)
        .expect("Failed to install OpenTelemetry tracer.");

    let env_filter = EnvFilter::try_from_default_env().unwrap_or(EnvFilter::new("info"));
    let telemetry = tracing_opentelemetry::layer().with_tracer(tracer);
    let formatting_layer = BunyanFormattingLayer::new(app_name.into(), std::io::stdout);
    let subscriber = Registry::default()
        .with(env_filter)
        .with(telemetry)
        .with(JsonStorageLayer)
        .with(formatting_layer);
    tracing::subscriber::set_global_default(subscriber)
        .expect("Failed to install `tracing` subscriber.")
}
/// Init a `tracing` subscriber that prints spans to stdout as well as
/// ships them to Jaeger.
///
/// Check the `opentelemetry` example for more details.
Init a `tracing` subscriber that prints spans to stdout as well as
ships them to Jaeger.

Check the `opentelemetry` example for more details.
Init a ` tracing ` subscriber that prints spans to stdout as well as ships them to Jaeger . Check the ` opentelemetry ` example for more details .
fn init_telemetry() {
    let app_name = "tracing-actix-web-demo";
    global::set_text_map_propagator(TraceContextPropagator::new());
    let tracer = opentelemetry_jaeger::new_pipeline()
        .with_service_name(app_name)
        .install_batch(TokioCurrentThread)
        .expect("Failed to install OpenTelemetry tracer.");
    let env_filter = EnvFilter::try_from_default_env().unwrap_or(EnvFilter::new("info"));
    let telemetry = tracing_opentelemetry::layer().with_tracer(tracer);
    let formatting_layer = BunyanFormattingLayer::new(app_name.into(), std::io::stdout);
    let subscriber = Registry::default()
        .with(env_filter)
        .with(telemetry)
        .with(JsonStorageLayer)
        .with(formatting_layer);
    tracing::subscriber::set_global_default(subscriber)
        .expect("Failed to install `tracing` subscriber.")
}
fn init_telemetry ( ) { let app_name = " " ; global :: set_text_map_propagator ( TraceContextPropagator :: new ( ) ) ; let tracer = opentelemetry_jaeger :: new_pipeline ( ) . with_service_name ( app_name ) . install_batch ( TokioCurrentThread ) . expect ( " " ) ; let env_filter = EnvFilter :: try_from_default_env ( ) . unwrap_or ( EnvFilter :: new ( " " ) ) ; let telemetry = tracing_opentelemetry :: layer ( ) . with_tracer ( tracer ) ; let formatting_layer = BunyanFormattingLayer :: new ( app_name . into ( ) , std :: io :: stdout ) ; let subscriber = Registry :: default ( ) . with ( env_filter ) . with ( telemetry ) . with ( JsonStorageLayer ) . with ( formatting_layer ) ; tracing :: subscriber :: set_global_default ( subscriber ) . expect ( " " ) }
Init a `tracing` subscriber that prints spans to stdout as well as
ships them to Jaeger.
Init a ` tracing ` subscriber that prints spans to stdout as well as ships them to Jaeger .