@@ -22,13 +22,10 @@ use anyhow::Result;
2222use opentelemetry:: { otel_debug, otel_info} ;
2323use std:: fs:: { self , File , OpenOptions } ;
2424use std:: os:: unix:: fs:: PermissionsExt ;
25- use std:: sync:: { Arc , Mutex , Once , OnceLock } ;
25+ use std:: sync:: { Arc , Mutex , OnceLock } ;
2626use testcontainers:: core:: wait:: HttpWaitStrategy ;
2727use testcontainers:: core:: { ContainerPort , Mount } ;
2828use testcontainers:: { core:: WaitFor , runners:: AsyncRunner , ContainerAsync , GenericImage , ImageExt } ;
29- use tracing_subscriber:: layer:: SubscriberExt ;
30- use tracing_subscriber:: util:: SubscriberInitExt ;
31- use tracing_subscriber:: { EnvFilter , Layer } ;
3229
3330// Static references for container management
3431static COLLECTOR_ARC : OnceLock < Mutex < Option < Arc < ContainerAsync < GenericImage > > > > > = OnceLock :: new ( ) ;
@@ -37,28 +34,8 @@ pub static METRICS_FILE: &str = "./actual/metrics.json";
3734pub static LOGS_FILE : & str = "./actual/logs.json" ;
3835pub static TRACES_FILE : & str = "./actual/traces.json" ;
3936
40- static INIT_TRACING : Once = Once :: new ( ) ;
41-
42- fn init_tracing ( ) {
43- INIT_TRACING . call_once ( || {
44- // Info and above for all, debug for opentelemetry
45- let filter_fmt =
46- EnvFilter :: new ( "info" ) . add_directive ( "opentelemetry=debug" . parse ( ) . unwrap ( ) ) ;
47- let fmt_layer = tracing_subscriber:: fmt:: layer ( )
48- . with_thread_names ( true )
49- . with_filter ( filter_fmt) ;
50-
51- // Initialize the tracing subscriber with the OpenTelemetry layer and the
52- // Fmt layer.
53- tracing_subscriber:: registry ( ) . with ( fmt_layer) . init ( ) ;
54- otel_info ! ( name: "tracing::fmt initializing completed! SDK internal logs will be printed to stdout." ) ;
55- } ) ;
56- }
57-
5837#[ allow( clippy:: await_holding_lock) ]
5938pub async fn start_collector_container ( ) -> Result < ( ) > {
60- init_tracing ( ) ;
61-
6239 let mut arc_guard = COLLECTOR_ARC
6340 . get_or_init ( || Mutex :: new ( None ) )
6441 . lock ( )
0 commit comments