diff --git a/tokio/src/runtime/handle.rs b/tokio/src/runtime/handle.rs index ddc170a929d..46072f381d1 100644 --- a/tokio/src/runtime/handle.rs +++ b/tokio/src/runtime/handle.rs @@ -192,20 +192,20 @@ impl Handle { let location = std::panic::Location::caller(); #[cfg(tokio_track_caller)] let span = tracing::trace_span!( - target: "tokio::task", - "task", + target: "tokio::task::blocking", + "runtime.spawn", kind = %"blocking", - function = %std::any::type_name::(), task.name = %name.unwrap_or_default(), + "fn" = %std::any::type_name::(), spawn.location = %format_args!("{}:{}:{}", location.file(), location.line(), location.column()), ); #[cfg(not(tokio_track_caller))] let span = tracing::trace_span!( - target: "tokio::task", - "task", + target: "tokio::task::blocking", + "runtime.spawn", kind = %"blocking", task.name = %name.unwrap_or_default(), - function = %std::any::type_name::(), + "fn" = %std::any::type_name::(), ); fut.instrument(span) }; diff --git a/tokio/src/util/trace.rs b/tokio/src/util/trace.rs index c51a5a72bce..61c155c5b03 100644 --- a/tokio/src/util/trace.rs +++ b/tokio/src/util/trace.rs @@ -11,17 +11,17 @@ cfg_trace! { #[cfg(tokio_track_caller)] let span = tracing::trace_span!( target: "tokio::task", - "task", + "runtime.spawn", %kind, + task.name = %name.unwrap_or_default(), spawn.location = %format_args!("{}:{}:{}", location.file(), location.line(), location.column()), - task.name = %name.unwrap_or_default() ); #[cfg(not(tokio_track_caller))] let span = tracing::trace_span!( target: "tokio::task", - "task", + "runtime.spawn", %kind, - task.name = %name.unwrap_or_default() + task.name = %name.unwrap_or_default(), ); task.instrument(span) }