From 0b7513ff558524425f9adb5f93c4fbfedac4eced Mon Sep 17 00:00:00 2001 From: mfahampshire Date: Tue, 5 Aug 2025 18:43:15 +0200 Subject: [PATCH] try fix the propogation of trace_id across client-node --- .../websocket/connection_handler/fresh.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/gateway/src/node/client_handling/websocket/connection_handler/fresh.rs b/gateway/src/node/client_handling/websocket/connection_handler/fresh.rs index 34038d4a33..8f1060e595 100644 --- a/gateway/src/node/client_handling/websocket/connection_handler/fresh.rs +++ b/gateway/src/node/client_handling/websocket/connection_handler/fresh.rs @@ -913,12 +913,9 @@ impl FreshHandler { let remote_context = opentelemetry::Context::current().with_remote_span_context(span_context); - // Create span with remote context as parent - use tracing_opentelemetry::OpenTelemetrySpanExt; - let span = info_span!("authenticate_v2", - trace_id = %trace_id.to_string() - ); - span.set_parent(remote_context); + let _context_guard = remote_context.attach(); + let span = info_span!("authenticate_v2"); // this should Just Work and inherit the trace_id + Some(span) } else { warn!("AuthenticateV2 request but no trace_id provided");