minitrace-rust
minitrace-rust copied to clipboard
minitrace does not work on monoio
minitrace = 0.4.0 monoio = 0.0.4
collector.collect().await
does not return
Some notes:
GlobalCollector receives and processes the command, but the callback via futures::channel::oneshot::channel
fails. Investigating why now.
Edit:
- tested that this does not work by substituting
tokio::sync::oneshot::channel
- works with
std::sync::mpsc::channel
(unbounded)
Can you provide a minimal reproducible example?
Yes
let mut rt_ = monoio::RuntimeBuilder::new().build().unwrap();
rt_.block_on(async move {
let (root, collector) = Span::root("hi!");
let spans = collector.collect().await;
println!("spans: {:?}", spans);
});
If you instrument, commit_collect
, you will see that rx.await
never gets polled successfully.
For this example, I'm afraid it's a misuse of minitrace.
The root
span should be dropped before collect
, or the collection will be never performed.
You can try:
let mut rt_ = monoio::RuntimeBuilder::new().build().unwrap();
rt_.block_on(async move {
let (root, collector) = Span::root("hi!");
drop(root);
let spans = collector.collect().await;
println!("spans: {:?}", spans);
});
my apologies, it fails with drop(root)
and
fn().in_span(root).await;
too.
Note that for these cases, it works when I swap out oneshot::channel
with std::sync::mpsc::channel
.
I have not tried tokio and futures unbounded/bounded channels.
my apologies, it fails with
drop(root)
andfn().in_span(root).await;
too.
Note that for these cases, it works when I swap out
oneshot::channel
withstd::sync::mpsc::channel
. I have not tried tokio and futures unbounded/bounded channels.
Got. Seems an issue from monoio. We can discuss this further over here.