Skip to content

Commit

Permalink
native_layer: Don't double emit debug annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
dflemstr committed Nov 21, 2024
1 parent 4b1a9bf commit fbc2d76
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/layer/src/native_layer.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! The main tracing layer and related utils exposed by this crate.
use std::sync::atomic;
use std::{borrow, cell, env, marker, process, sync, thread, time};
use std::{borrow, cell, env, marker, mem, process, sync, thread, time};

use prost::encoding;
#[cfg(feature = "tokio")]
Expand Down Expand Up @@ -774,9 +774,9 @@ where
attrs.record(&mut debug_annotations);
self.report_counters(meta, debug_annotations.take_counters());

span.extensions_mut().insert(debug_annotations.clone());
if flavor == flavor::Flavor::Async {
if self.inner.delay_slice_begin {
span.extensions_mut().insert(debug_annotations);
span.extensions_mut().insert(DelayedSliceBegin {
timestamp_ns: trace_time_ns(),
timestamp_clock_id: trace_clock_id(),
Expand Down Expand Up @@ -842,9 +842,9 @@ where
span.extensions_mut().replace(sequence_id);

let debug_annotations = span
.extensions()
.get::<debug_annotations::ProtoDebugAnnotations>()
.cloned()
.extensions_mut()
.get_mut::<debug_annotations::ProtoDebugAnnotations>()
.map(mem::take)
.unwrap_or_default();
self.report_slice_begin(meta, track_uuid, sequence_id, debug_annotations);
}
Expand Down

0 comments on commit fbc2d76

Please sign in to comment.