1- use axum:: {
2- extract:: { Path , Request } ,
3- http:: Method ,
4- response:: Json ,
5- routing:: { get, post} ,
6- Router ,
7- } ;
1+ use axum:: { extract:: Request , http:: Method , response:: Json , routing:: get, Router } ;
82use datadog_opentelemetry;
93use dd_trace:: Config ;
10- use opentelemetry:: trace:: { Span , Tracer , TracerProvider } ;
11- use opentelemetry_sdk:: trace:: Tracer as SdkTracer ;
4+ use opentelemetry:: trace:: TracerProvider ;
125use serde:: { Deserialize , Serialize } ;
136use std:: net:: SocketAddr ;
147use tower_http:: {
158 cors:: { Any , CorsLayer } ,
169 trace:: { DefaultOnFailure , DefaultOnRequest , DefaultOnResponse , TraceLayer } ,
1710} ;
18- use tracing:: { field:: Empty , info, instrument, Level } ;
11+ use tracing:: { field:: Empty , info, instrument, level_filters :: LevelFilter , Level } ;
1912use tracing_opentelemetry:: OpenTelemetrySpanExt ;
20- use tracing_subscriber:: { layer:: SubscriberExt , util:: SubscriberInitExt } ;
13+ use tracing_subscriber:: { layer:: SubscriberExt , util:: SubscriberInitExt , Layer } ;
2114
2215#[ derive( Debug , Serialize , Deserialize ) ]
2316struct User {
@@ -61,7 +54,6 @@ async fn root() -> &'static str {
6154
6255#[ tokio:: main]
6356async fn main ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
64-
6557 info ! ( "Starting Datadog OpenTelemetry example application..." ) ;
6658
6759 // Initialize Datadog OpenTelemetry pipeline
@@ -72,14 +64,14 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
7264 . set_service ( "dd-trace-example" . to_string ( ) )
7365 . set_version ( "1.0.0" . to_string ( ) )
7466 . set_env ( "development" . to_string ( ) )
75- . set_log_level_filter ( dd_trace:: log:: LevelFilter :: Debug )
67+ . set_log_level_filter ( dd_trace:: log:: LevelFilter :: Info )
7668 . build ( ) ,
7769 )
7870 . init ( ) ;
7971
8072 info ! ( "Datadog pipeline initialized successfully" ) ;
8173 tracing_subscriber:: registry ( )
82- . with ( tracing_subscriber:: fmt:: layer ( ) )
74+ . with ( tracing_subscriber:: fmt:: layer ( ) . with_filter ( LevelFilter :: DEBUG ) )
8375 . with (
8476 tracing_opentelemetry:: layer ( ) . with_tracer ( tracer_provider. tracer ( "dd-trace-example" ) ) ,
8577 )
0 commit comments