This commit is contained in:
Floriane TUERNAL SABOTINOV
2025-09-15 09:50:45 +02:00
parent 827591631d
commit 36b07b1bcf
2 changed files with 4 additions and 1 deletions
@@ -236,6 +236,7 @@ impl<R, S> AuthenticatedHandler<R, S> {
/// # Arguments
///
/// * `mix_packet`: packet received from the client that should get forwarded into the network.
#[instrument(skip_all)]
fn forward_packet(&self, mix_packet: MixPacket) {
let herited_span = self.root_span.as_ref().cloned().unwrap_or_else(|| tracing::Span::none());
let span = info_span!(parent: &herited_span, "forwarding_packet");
@@ -295,6 +296,7 @@ impl<R, S> AuthenticatedHandler<R, S> {
/// # Arguments
///
/// * `mix_packet`: packet received from the client that should get forwarded into the network.
#[instrument(skip_all)]
async fn handle_forward_sphinx(
&mut self,
mix_packet: MixPacket,
@@ -321,6 +323,7 @@ impl<R, S> AuthenticatedHandler<R, S> {
/// # Arguments
///
/// * `bin_msg`: raw message to handle.
#[instrument(skip_all)]
async fn handle_binary(&mut self, bin_msg: Vec<u8>) -> Message {
trace!("binary request");
let herited_span = self.root_span.as_ref().cloned().unwrap_or_else(|| tracing::Span::none());
@@ -894,12 +894,12 @@ impl<R, S> FreshHandler<R, S> {
};
let span_cx = new_span_context_with_id(trace_id);
let _context_guard = span_cx.clone().attach();
warn!("==== Context propagation successful ====");
// Build root_span with extracted context as parent
let span = info_span!("=== Manual context propagation starting point ===", %trace_id);
span.set_parent(span_cx.clone());
let context_ext = context_ext.set_root_span(span);
warn!("==== Context propagation successful ====");
context_ext
} else {
warn!("No OpenTelemetry context provided in the request");