From dcdc6311df0e05e046f261e900a594a5fc76b438 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Mon, 13 Jun 2022 09:06:58 +0200 Subject: [PATCH] Don't retain message payloads in span, just log the payload instead --- crates/collab/src/rpc.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/collab/src/rpc.rs b/crates/collab/src/rpc.rs index 86fe8c8512..969cd05f9f 100644 --- a/crates/collab/src/rpc.rs +++ b/crates/collab/src/rpc.rs @@ -207,9 +207,14 @@ impl Server { let envelope = envelope.into_any().downcast::>().unwrap(); let span = info_span!( "handle message", - payload_type = envelope.payload_type_name(), - payload = format!("{:?}", envelope.payload).as_str(), + payload_type = envelope.payload_type_name() ); + span.in_scope(|| { + tracing::info!( + payload = format!("{:?}", envelope.payload).as_str(), + "message payload" + ); + }); let future = (handler)(server, *envelope); async move { if let Err(error) = future.await {