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::{
11
11
EnvFilter , Layer ,
12
12
} ;
13
13
14
- #[ cfg( feature = "otel" ) ]
15
- use once_cell:: sync:: Lazy ;
16
14
#[ cfg( feature = "otel" ) ]
17
15
use opentelemetry_sdk:: trace:: Tracer ;
18
16
@@ -131,16 +129,16 @@ where
131
129
EnvFilter :: new ( "rustup=TRACE" )
132
130
} ;
133
131
tracing_opentelemetry:: layer ( )
134
- . with_tracer ( TELEMETRY_DEFAULT_TRACER . clone ( ) )
132
+ . with_tracer ( telemetry_default_tracer ( ) )
135
133
. with_filter ( env_filter)
136
134
}
137
135
138
136
/// The default `opentelemetry` tracer used across Rustup.
139
137
///
140
138
/// # 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.
142
140
#[ cfg( feature = "otel" ) ]
143
- static TELEMETRY_DEFAULT_TRACER : Lazy < Tracer > = Lazy :: new ( || {
141
+ fn telemetry_default_tracer ( ) -> Tracer {
144
142
use std:: time:: Duration ;
145
143
146
144
use opentelemetry:: KeyValue ;
@@ -164,4 +162,4 @@ static TELEMETRY_DEFAULT_TRACER: Lazy<Tracer> = Lazy::new(|| {
164
162
)
165
163
. install_batch ( opentelemetry_sdk:: runtime:: Tokio )
166
164
. expect ( "error installing `OtlpTracePipeline` in the current `tokio` runtime" )
167
- } ) ;
165
+ }
You can’t perform that action at this time.
0 commit comments