File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88use std:: io;
99
1010use chrono:: Utc ;
11- use opentelemetry:: trace:: { SpanId , TraceContextExt , TraceId } ;
11+ use opentelemetry:: trace:: { SpanId , TraceId } ;
1212use serde:: ser:: { SerializeMap , Serializer as _} ;
1313use serde:: Serialize ;
1414use tracing:: { Event , Subscriber } ;
@@ -44,19 +44,9 @@ fn lookup_trace_info<S>(span_ref: &SpanRef<S>) -> Option<TraceInfo>
4444where
4545 S : Subscriber + for < ' a > LookupSpan < ' a > ,
4646{
47- span_ref. extensions ( ) . get :: < OtelData > ( ) . map ( |o| {
48- // If the parent ID is empty/0 - then fall back to the builder's ID
49- let parent_span_cx = o. parent_cx . span ( ) ;
50-
51- let trace_id = if parent_span_cx. span_context ( ) . trace_id ( ) != TraceId :: INVALID {
52- parent_span_cx. span_context ( ) . trace_id ( )
53- } else {
54- o. builder . trace_id . unwrap_or ( TraceId :: INVALID )
55- } ;
56- TraceInfo {
57- trace_id : trace_id. into ( ) ,
58- span_id : o. builder . span_id . unwrap_or ( SpanId :: INVALID ) . into ( ) ,
59- }
47+ span_ref. extensions ( ) . get :: < OtelData > ( ) . map ( |o| TraceInfo {
48+ trace_id : o. builder . trace_id . unwrap_or ( TraceId :: INVALID ) . into ( ) ,
49+ span_id : o. builder . span_id . unwrap_or ( SpanId :: INVALID ) . into ( ) ,
6050 } )
6151}
6252
You can’t perform that action at this time.
0 commit comments