Comments (9)
Because concurrency is not supported in local span, it's not possible to start a local span whose parent are not the current local parent.
I assume you're interested in tracing a single thread within an asynchronous runtime, correct? Could you describe what kind of results or data you expect to collect from this process?
from minitrace-rust.
@dotansimha, I've devised an alternative solution. Can you please check if it works for you? Here's the link: #201
from minitrace-rust.
@dotansimha, I've devised an alternative solution. Can you please check if it works for you? Here's the link: #201
Interesting, thanks @andylokandy !
So I guess I should use Span
now just like before? with the new single-thread
feature enabled? (instead or with enabled
?)
from minitrace-rust.
You may set both enable
and single-thread
, and use minitrace::flush()
to manually report.
from minitrace-rust.
I assume you're interested in tracing a single thread within an asynchronous runtime, correct? Could you describe what kind of results or data you expect to collect from this process?
Yeah, that's exactly what I'm building! A single-threaded (WASM, CF Worker) with async runtime (wasm-bindgen).
The main issue is that some parts of the codebase are fully agnostic to the runtime, so it's using Span
and in_span
for the Future
s. The main issue is that these are fully ignored when LocalSpan
and the LocalCollector
are used. I only get SpanRecord
s for traces created by #[trace]
or LocalSpan::enter_with_local_parent
.
from minitrace-rust.
Local span can support concurrency but may not be easy... Currently, when a local span exits(drops), the parent of it will become the local parent. We need to add a logical parent to local span that are used to be the parent in SpanRecord, while keeping the real parent unchanged.
from minitrace-rust.
Local span can support concurrency but may not be easy... Currently, when a local span exits(drops), the parent of it will become the local parent. We need to add a logical parent to local span that are used to be the parent in SpanRecord, while keeping the real parent unchanged.
I see. Any insight on why #[trace]
does work fine in my case? I'm putting it on async
functions and it seems to work fine so far π€ My current workaround is to split my code to functions and add #[trace]
.
from minitrace-rust.
Any insight on why #[trace] does work fine in my case?
could you give a minimum reprodicible exampleοΌ
from minitrace-rust.
@andylokandy see https://github.com/dotansimha/minitrace-localspan-reproduce
Basically, I'm facing several issues here (all mentioned in code comments in the repo):
- I can't use
in_span
(FutureExt
) withLocalSpan
for async functions. - I can't create
LocalSpan
with an explicit parent (missingLocalSpan::enter_with_parent
)
UPDATE 1:
Just noticed a weird behavior, where I have an async
function with #[trace]
and it doesn't have any traces reported π€ Adding enter_on_poll = true
seems to partially fix it. Now I have more than one span created for each function call π€
UPDATE 2:
I think the main issue is the async
runtime as you mentioned @andylokandy . Seems like the async
function with the #[trace]
is eventually using the minitrace::future::FutureExt::in_span
wrapper, so it's using Span
which is not being collected by the LocalCollector
.
sync
functions with the macro are wrapped with LocalSpan::enter_with_local_parent
so I assume that's why it's working.
@andylokandy so I guess the issue is the missing async
handling for LocalSpan
? When I'm creating the spans manually with LocalSpan::enter_with_local_parent
, it seems to work pretty well with the async
functions.
from minitrace-rust.
Related Issues (20)
- Request: panic instead of noop HOT 2
- Automatically create a root span if none is present. HOT 1
- is it possible to create multiple instances of the collector? HOT 10
- WASM (`wasm32-unknown-unknown`) support? HOT 12
- `minitrace-opentelemetry` doesn't work with `opentelemetry_zipkin` exporter HOT 3
- Feature request: Span property on #[trace] macro HOT 6
- Feature request: allow to use minitrace without global collector
- Panic on wasm: time not implemented on this platform HOT 5
- `Reporter::report` should be `async fn`? π€ HOT 4
- RFC: tokio-tracing compatible layer HOT 6
- Profile-Guided Optimization (PGO) benchmark results
- `futures::Stream` and `futures::Sink` instrumentation HOT 7
- Add span tags dynamically
- WASM target support improvements HOT 5
- [BUG] LocalSpan is broken in quick functions HOT 4
- loose strict dependency version for `opentelemetry` HOT 1
- Making `futures` an optional dependency HOT 1
- Why Reporter::report gets passed a reference instead of a Vec of owned objects? HOT 1
- Check synchronization when using rtrb::Consumer::is_abandoned() HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minitrace-rust.