Comments (3)
Tracer implements Clone
and Send
traits, so it is possible to clone a Tracer
for multiple threads as the following code:
let (tracer, _) = Tracer::new(AllSampler);
for _ in 0..10 {
let tracer = tracer.clone();
std::thread::spawn(move || {
let span = tracer.span("foo").start();
// Do something
});
}
from rustracing_jaeger.
Ah, yes. The main thing I was looking for was the Sync
bit. I've worked around this constraint by wrapping the Tracer
in a pointer which is itself sync, and passing that pointer to the various threads. When the pointer is dereferenced, it clones the underlying Tracer
for thread local usage. Seems to be working quite well.
Traces are coming through without issue.
from rustracing_jaeger.
I'm glad the problem was solved.
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
- 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
- reporter: support for async futures-based report() HOT 6
- 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.