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

Using TaskMonitor with spawn_blocking? #62

Open
AlJohri opened this issue Jun 24, 2024 · 0 comments
Open

Using TaskMonitor with spawn_blocking? #62

AlJohri opened this issue Jun 24, 2024 · 0 comments

Comments

@AlJohri
Copy link

AlJohri commented Jun 24, 2024

Is it possible to instrument a spawn_blocking task? I am currently getting this error when I try to instrument the closure being passed into spawn blocking:

expected an `FnOnce()` closure, found `tokio_metrics::Instrumented<{closure@amzn-eureka-broker-node/src/search.rs:604:18: 604:25}>

Our application makes heavy use of both tokio::spawn and tokio::spawn_blocking and I would like to see metrics for both parts of the application.

I think some of the metrics still make sense in the spawn_blocking context like total_first_poll_delay.

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

No branches or pull requests

1 participant