sile / rustracing_jaeger

Jaeger tracing library for Rust
MIT License
83 stars 22 forks source link

Remove the requirement to use `crossbeam` #33

Open jyn514 opened 2 years ago

jyn514 commented 2 years ago

Right now, Tracer requires that you pass in a crossbeam channel. Because crossbeam is blocking, this makes it impossible to use rustracing_jaeger with an async application; you have to instead spawn a thread to avoid blocking the task. It would be nice to have the tracer just take spans directly, which lets the user decide whether they want to use threads or async (or just block on sending the span).

(maybe this should be an issue in https://github.com/sile/rustracing instead?)

sile commented 2 years ago

Thanks for creating this issue.

maybe this should be an issue in https://github.com/sile/rustracing instead?

Maybe. Actually, I have created a PR https://github.com/sile/rustracing/pull/9 that seems to relate to this issue. sile/rustracing#9 has no progress over one year. But I could restart the work if this PR (and another one that makes it possible to specify crossbeam as an optional feature) would be worth you.

jyn514 commented 2 years ago

Hmm, https://github.com/sile/rustracing/pull/9/ is a different approach than I was thinking of, it allows sending with either Tokio or with crossbeam. But I was actually suggesting removing the "send" abstraction altogether - although now that I look at how the Span drop impl is written I'm having trouble imagining how that would work ... @ObsidianMinor is the one who suggested the more flexible API originally, they might have ideas.