mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-27 10:59:53 +00:00
Trace handling of messages
This commit is contained in:
parent
2db670308b
commit
6ef2d0fbec
1 changed files with 6 additions and 1 deletions
|
@ -47,6 +47,7 @@ use tokio::{
|
|||
time::Sleep,
|
||||
};
|
||||
use tower::ServiceBuilder;
|
||||
use tracing::info_span;
|
||||
use util::ResultExt;
|
||||
|
||||
type MessageHandler = Box<
|
||||
|
@ -156,7 +157,11 @@ impl Server {
|
|||
TypeId::of::<M>(),
|
||||
Box::new(move |server, envelope| {
|
||||
let envelope = envelope.into_any().downcast::<TypedEnvelope<M>>().unwrap();
|
||||
(handler)(server, *envelope).boxed()
|
||||
let span = info_span!(
|
||||
"handle message",
|
||||
payload_type = envelope.payload_type_name()
|
||||
);
|
||||
span.in_scope(|| (handler)(server, *envelope).boxed())
|
||||
}),
|
||||
);
|
||||
if prev_handler.is_some() {
|
||||
|
|
Loading…
Reference in a new issue