File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,6 @@ use tracing_subscriber::{
1111 EnvFilter , Layer ,
1212} ;
1313
14- #[ cfg( feature = "otel" ) ]
15- use once_cell:: sync:: Lazy ;
1614#[ cfg( feature = "otel" ) ]
1715use opentelemetry_sdk:: trace:: Tracer ;
1816
@@ -131,16 +129,16 @@ where
131129 EnvFilter :: new ( "rustup=TRACE" )
132130 } ;
133131 tracing_opentelemetry:: layer ( )
134- . with_tracer ( TELEMETRY_DEFAULT_TRACER . clone ( ) )
132+ . with_tracer ( telemetry_default_tracer ( ) )
135133 . with_filter ( env_filter)
136134}
137135
138136/// The default `opentelemetry` tracer used across Rustup.
139137///
140138/// # Note
141- /// The initializer function will panic if not called within the context of a [`tokio`] runtime.
139+ /// This function will panic if not called within the context of a [`tokio`] runtime.
142140#[ cfg( feature = "otel" ) ]
143- static TELEMETRY_DEFAULT_TRACER : Lazy < Tracer > = Lazy :: new ( || {
141+ fn telemetry_default_tracer ( ) -> Tracer {
144142 use std:: time:: Duration ;
145143
146144 use opentelemetry:: KeyValue ;
@@ -164,4 +162,4 @@ static TELEMETRY_DEFAULT_TRACER: Lazy<Tracer> = Lazy::new(|| {
164162 )
165163 . install_batch ( opentelemetry_sdk:: runtime:: Tokio )
166164 . expect ( "error installing `OtlpTracePipeline` in the current `tokio` runtime" )
167- } ) ;
165+ }
You can’t perform that action at this time.
0 commit comments