Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

native_layer: Don't double emit debug annotations #17

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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