-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
span-reporter span id generation is very slow. #18 #19
base: master
Are you sure you want to change the base?
Conversation
… span id instead of generating its own + Avoid call to context.baggageItems() twice in SpanBuilderR.findSpanId
Span-reporter uses UUID.randomUUID() to generate the span id, which internally uses SecureRandom and is very slow. Whereas tracer server like Jaeger uses Java6CompatibleThreadLocalRandom.current().nextLong() which is 10 times faster with no contention(one thread) and around 50 to 100 times faster with contention (multilple threads) compared to UUID.randomUUID(). Instead of creating its own span id, the span-reporter lib can get the span id from the tracing implementation. Can someone please review the MR? Any feedback would be highly appreciated. |
… by the wrapped tracer.
Reason behind second commit (Override toString() method) Calling toString() on the Tracer when using span-reporter does not return useful data. "GlobalTracer{io.opentracing.contrib.reporter.TracerR@5eb97ced}" However, if you do the same thing when directly using the Jaeger tracing you get: "GlobalTracer{JaegerTracer(version=Java-1.6.0, serviceName=boss, reporter=RemoteReporter(sender=HttpSender(), closeEnqueueTimeout=1000), sampler=ProbabilisticSampler(tags={sampler.type=probabilistic, sampler.param=1.0}), tags={hostname=ffff-dev, jaeger.version=Java-1.6.0, java.user.name=bmhhhh, java.version=11.0.13, boss.signature=0.1.0-SNAPSHOT/f4bc2fc3/fffff/2021-11-17T18:40:34Z, ip=**************}, zipkinSharedRpcSpan=false, expandExceptionLogs=false, useTraceId128Bit=false)}" io.opentracing.contrib.reporter.TracerR needs to implement toString and return a value that includes the data returned by the wrapped tracer. |
It has been a while since I opened the merge request. Can someone please review and provide the access to merge? |
@davidB Can you please review the pull request? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution,
I need to go back (refresh) into the API of Opentracing (like spanContext.toSpanId();
) and into the code to complete my review.
FYI, I'll not be able to publish a new release (I don't have the permissions to publish)
else { | ||
referenceId = findSpanId(spanContext); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
regarding the impl of findSpanId, referenceId
is always ""
in this case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution, I need to go back (refresh) into the API of Opentracing (like
spanContext.toSpanId();
) and into the code to complete my review. FYI, I'll not be able to publish a new release (I don't have the permissions to publish)
@davidB - Thanks for your reply. Does that mean there wont be any releases/updates on this library going forward?
It has been an eternity since I worked on this code and I can't even build it anymore, my apologies! My own efforts in the overall space are completely focused on opentelemetry these days (opentracing has been deprecated). Not the answer you're hoping for, I'm sure, but I wanted to respond at least. :-/ |
This is the PR for issue #18
Span-reporter should have an option to use the tracing implementation's span id instead of generating its own.
Span-reporter method SpanBuilderR.findSpanId calls context.baggageItems() twice.