Comments (6)
I think that it's somewhat dangerous to depend on tokio
heavily because some users (including me) may want to use this crate outside of the asynchronous world (e.g., with the regular thread model). Besides, indeed, tokio
seems a defact standard async runtime, but there are some alternatives (e.g., async-std) that provide its own channel implementation. Some user may want to use rustracing
with one of the alternatives.
Instead of switching the channel implementation to tokio based one, IMO, it seems good to extend Tracer
and SpanReceiver
to allow arbitrary channel type as a type parameter (I have no plan to implement this feature in the near future though...).
By the way, just FYI, this crate now uses crossbeam
as the channel implementation (see sile/rustracing#4).
from rustracing_jaeger.
It seems interesting to support futures
. But currently, rustracing_jaeger
(and rustracing
) heavily depends on std::sync::mpsc
, so it is difficalt to integrated with futures
smoothly.
If your are not annoying to spawn a thread dedicated for the reporting, it will be easiest way to use the thread as follows:
let (tracer, span_rx) = Tracer::new(rustracing::sampler::AllSampler);
// Spawns a reporting thread at the initialization phase in your application
std::thread::spawn(move || {
let mut reporter = track_try_unwrap!(JaegerCompactReporter::new("example"));
while let Ok(span) = span_rx.recv() {
if reporter.report(&[span][..]).is_err() {
break;
}
}
});
// The operations of `tracer` are not blocked, so it can be used in asynchronous code.
from rustracing_jaeger.
@sile Any update on this? Rust has had async/await for a while now and you could use Tokio's mpsc instead of std's.
from rustracing_jaeger.
Instead of switching the channel implementation to tokio based one, IMO, it seems good to extend Tracer and SpanReceiver to allow arbitrary channel type as a type parameter
I tried implementing this idea in sile/rustracing#9. If you think this PR is good, I'll merge it. > @andrewbanchich
from rustracing_jaeger.
That makes sense to me.
I've actually just switched to using the official opentelemetry
crate alongside tracing
and tracing-opentelemetry
.
Thank you though!
from rustracing_jaeger.
@andrewbanchich No problem! Thank you for letteing me know that.
from rustracing_jaeger.
Related Issues (18)
- Example incorrect HOT 3
- Allow connecting to non-local agents HOT 2
- Enable injectors and extractors bound to tracer HOT 1
- Constructing TraceId from String HOT 2
- Ability to send spans directly to collector over HTTP HOT 1
- What is the expected way of using this library across threads? HOT 3
- Automatically set ip tag HOT 4
- Example panics HOT 1
- Bind to localhost instead of INADDR_ANY for reporter UDP socket creation HOT 7
- Help wanted: Span never received from actix-web thread HOT 3
- Logs & Tags not coming through to Jaeger UI. HOT 1
- Make it possible to retrieve `flags` HOT 1
- Remove the requirement to use `crossbeam` HOT 2
- Running into an error when using an alternative SocketAddr. HOT 11
- Allow generating span from known TraceId HOT 4
- Impl OpenTracing default carrier traits for SpanContextState. HOT 1
- Help wanted: Use span and Sub-span 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 rustracing_jaeger.