context lost when tracing mongodb?
See original GitHub issuei focked this repo at https://github.com/hafeyang/zipkin-js/tree/master/packages/zipkin-instrumentation-mongodb
ctxImpl.letContext(ctx, () => {
const url = 'mongodb://localhost:27017/zipkin_test';
MongoClient.connect(url, function(err, db) {
const col = db.collection('somecollection');
ctxImpl.letContext(ctx, () => {
col.deleteMany({}, {}, function() {
ctxImpl.letContext(ctx, () => {
col.insertMany([{a: 1}, {a: 2}, {a: 3}], function() {
db.close();
const annotations = record.args.map(args => args[0]);
annotations.forEach(a => console.log(a.traceId.traceId+" "+a.traceId.spanId+" "+a.traceId.parentId));
console.log(annotations);
done();
});
});
});
});
});
});
here is my test code , annotations logged and i found traceId changed,and i got 2 traceId.
may caused by context losing
detailed err description and code pls check https://github.com/hafeyang/zipkin-js/tree/master/packages/zipkin-instrumentation-mongodb
Thanks!
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Trace context lost after mongo call #1204 - GitHub
Hi, using latest Spring versions (2.1.2.RELEASE and Cloud Greenwich.RELEASE) it looks like after calling mongo with reactive operators trace ...
Read more >Internal Tracing of Redis,Mongo or Outbound Http call are not ...
So somebody can please tell me where I am doing wrong or what I am missing in the code. I have followed this...
Read more >[GODRIVER-739] Support OpenTracing - MongoDB Jira
We trace mongodb command at the client side. We trace these three info for ... func (c *client) WrapCommand(fn func(oldProcess func(context.
Read more >java.lang.ClassNotFoundException: com.mongodb.internal ...
I'm using mongodb with spring framework and ran into a similar issue. See stack trace below. Using the dependency versions 3.2.3 and 4.2.3...
Read more >Tracing API - OpenTelemetry
A SpanContext represents the portion of a Span which must be serialized and propagated along side of a distributed context. SpanContext s are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
keep open for now as I have another topic we need to resolve which is explicit use of contexts inside instrumentation (ex
tracer.record(id, annotation)
) which can help guarantee less loss of events.Worth to revisit this @adriancole ?