Don't retain message payloads in span, just log the payload instead

This commit is contained in:
Antonio Scandurra 2022-06-13 09:06:58 +02:00
parent 3b8388dcdd
commit dcdc6311df

View file

@ -207,9 +207,14 @@ impl Server {
let envelope = envelope.into_any().downcast::<TypedEnvelope<M>>().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 {