From bfa77bf7fc0bec3a179982a6b482d5a1ae8a29f0 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Mon, 28 Jul 2025 02:01:01 +0000 Subject: [PATCH] chore(snownet): log connection ID in more places (#10023) With the removal of the span in #9949, we now need to explicitly log the connection ID in a few more places to have the necessary context. --- rust/connlib/snownet/src/node.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rust/connlib/snownet/src/node.rs b/rust/connlib/snownet/src/node.rs index 55e103a8b..a9dc08de0 100644 --- a/rust/connlib/snownet/src/node.rs +++ b/rust/connlib/snownet/src/node.rs @@ -2012,7 +2012,7 @@ where self.possible_sockets.insert(source); } IceAgentEvent::IceConnectionStateChange(IceConnectionState::Disconnected) => { - tracing::debug!(grace_period = ?DISCONNECT_TIMEOUT, "Received ICE disconnect"); + tracing::debug!(%cid, grace_period = ?DISCONNECT_TIMEOUT, "Received ICE disconnect"); self.disconnected_at = Some(now); } @@ -2024,7 +2024,7 @@ where if let Some(disconnected_at) = existing { let offline = now.duration_since(disconnected_at); - tracing::debug!(?offline, "ICE agent reconnected"); + tracing::debug!(%cid, ?offline, "ICE agent reconnected"); } } IceAgentEvent::NominatedSend { @@ -2038,6 +2038,7 @@ where if source_relay.is_some_and(|r| self.relay != r) { tracing::warn!( + %cid, "Nominated a relay different from what we set out to! Weird?" ); } @@ -2144,6 +2145,7 @@ where let relay = self.relay; tracing::info!( + %cid, old = old.map(|s| s.fmt(relay)).map(tracing::field::display), new = %remote_socket.fmt(relay), duration_since_intent = ?self.duration_since_intent(now),