Skip to content

Commit 6502b5f

Browse files
authored
track task spawn location for tokio instrumentation (#1201)
1 parent 287985e commit 6502b5f

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/runtime.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ pub(crate) use tls::TlsConfig;
5454
///
5555
/// This must be called from an async block
5656
/// or function running on a runtime.
57+
#[track_caller]
5758
pub(crate) fn spawn<F, O>(fut: F) -> AsyncJoinHandle<O>
5859
where
5960
F: Future<Output = O> + Send + 'static,

src/runtime/join_handle.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use std::{
99
pub(crate) struct AsyncJoinHandle<T>(tokio::task::JoinHandle<T>);
1010

1111
impl<T> AsyncJoinHandle<T> {
12+
#[track_caller]
1213
pub(crate) fn spawn<F>(fut: F) -> Self
1314
where
1415
F: Future<Output = T> + Send + 'static,

0 commit comments

Comments
 (0)