File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -980,7 +980,10 @@ impl Processor {
980980
981981 // Set the extracted trace context to the spans
982982 if let Some ( sc) = & context. extracted_span_context {
983- context. invocation_span . trace_id = sc. trace_id as u64 ;
983+ #[ allow( clippy:: cast_possible_truncation) ] // Datadog protocol uses lower 64 bits
984+ {
985+ context. invocation_span . trace_id = sc. trace_id as u64 ;
986+ }
984987 context. invocation_span . parent_id = sc. span_id ;
985988
986989 // Set the right data to the correct root level span,
@@ -1210,7 +1213,10 @@ impl Processor {
12101213 // If we have a trace context, this means we got it from
12111214 // distributed tracing
12121215 if let Some ( sc) = & context. extracted_span_context {
1213- trace_id = sc. trace_id as u64 ;
1216+ #[ allow( clippy:: cast_possible_truncation) ] // Datadog protocol uses lower 64 bits
1217+ {
1218+ trace_id = sc. trace_id as u64 ;
1219+ }
12141220 parent_id = sc. span_id ;
12151221 tags. extend ( sc. tags . clone ( ) ) ;
12161222 }
Original file line number Diff line number Diff line change @@ -218,10 +218,14 @@ impl Listener {
218218 fn inject_span_context_to_headers ( headers : & mut HeaderMap , span_context : & SpanContext ) {
219219 headers. insert (
220220 DATADOG_TRACE_ID_KEY ,
221- ( span_context. trace_id as u64 )
222- . to_string ( )
223- . parse ( )
224- . expect ( "Failed to parse trace id" ) ,
221+ {
222+ #[ allow( clippy:: cast_possible_truncation) ] // Datadog protocol uses lower 64 bits
223+ let trace_id = span_context. trace_id as u64 ;
224+ trace_id
225+ }
226+ . to_string ( )
227+ . parse ( )
228+ . expect ( "Failed to parse trace id" ) ,
225229 ) ;
226230
227231 if let Some ( priority) = span_context. sampling . priority {
You can’t perform that action at this time.
0 commit comments