11mod error;
22mod system_information;
33
4- use clap:: { crate_description , crate_version , Parser } ;
5- use stackable_operator:: logging :: TracingTarget ;
4+ use clap:: { Parser , crate_description , crate_version } ;
5+ use stackable_operator:: telemetry :: Tracing ;
66use std:: path:: PathBuf ;
77
88use crate :: system_information:: SystemInformation ;
9+ use stackable_operator:: telemetry:: tracing:: TelemetryOptions ;
910use std:: time:: Instant ;
1011
1112const APP_NAME : & str = "containerdebug" ;
@@ -27,9 +28,8 @@ struct Opts {
2728 #[ clap( long, short = 'o' ) ]
2829 output : Option < PathBuf > ,
2930
30- /// Tracing log collector system
31- #[ arg( long, env, default_value_t, value_enum) ]
32- pub tracing_target : TracingTarget ,
31+ #[ clap( flatten) ]
32+ pub telemetry_arguments : TelemetryOptions ,
3333}
3434
3535mod built_info {
@@ -38,11 +38,10 @@ mod built_info {
3838
3939fn main ( ) {
4040 let opts = Opts :: parse ( ) ;
41- stackable_operator:: logging:: initialize_logging (
42- "CONTAINERDEBUG_LOG" ,
43- APP_NAME ,
44- opts. tracing_target ,
45- ) ;
41+
42+ let _trace_guard = Tracing :: pre_configured ( APP_NAME , opts. telemetry_arguments )
43+ . init ( )
44+ . unwrap ( ) ;
4645
4746 // Wrap *all* output in a span, to separate it from main app output.
4847 let _span = tracing:: error_span!( "containerdebug" ) . entered ( ) ;
0 commit comments