Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: add tracing span for block_on futures #4094

Merged
merged 1 commit into from
Sep 9, 2021
Merged

Conversation

seanmonstar
Copy link
Member

This adds a tracing span to the future in block_on, when the unstable tracing support is enabled. While not technically a spawn, we still call it a "task spawn" with the kind set to block_on.

Unfortunately, it cannot collect the #[tokio::main] task, since even though it is instrumented, the task is entered before we can call console_subscriber::init(). But all manual usage of block_on is collected.

Closes tokio-rs/console#106

@hawkw
Copy link
Member

hawkw commented Sep 8, 2021

Unfortunately, it cannot collect the #[tokio::main] task, since even though it is instrumented, the task is entered before we can call console_subscriber::init(). But all manual usage of block_on is collected.

it would be really nice if this were not the case...but, hmm, fixing that seems like a big pile of work.

@seanmonstar seanmonstar merged commit 6ebd057 into master Sep 9, 2021
@seanmonstar seanmonstar deleted the tracing-block-on branch September 9, 2021 15:58
@Darksonn Darksonn mentioned this pull request Sep 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Instrument block_on
3 participants