-
Notifications
You must be signed in to change notification settings - Fork 564
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
Add context propagation to the Zipkin tracing provider #9119
Conversation
I have asked Tomas about the test failure. The changes to the global tracer handling automatically created a functional tracer (not a no-op one) even when no |
.../zipkin/src/main/java/io/helidon/tracing/providers/zipkin/ZipkinDataPropagationProvider.java
Show resolved
Hide resolved
.../zipkin/src/main/java/io/helidon/tracing/providers/zipkin/ZipkinDataPropagationProvider.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Tim Quinn <[email protected]>
… global tracer management
…r class used in service loading
543145e
to
695a522
Compare
* Add context propagation to the Zipkin tracing provider Signed-off-by: Tim Quinn <[email protected]>
* Add context propagation to the Zipkin tracing provider Signed-off-by: Tim Quinn <[email protected]> Co-authored-by: Tim Quinn <[email protected]>
Description
Resolves #8848 for Zipkin.
Changes:
Add a context propagator implementation for Zipkin. This permits Helidon to propagate Zipkin trace information across threads within a Helidon server. (That's distinct from trace propagation via HTTP headers which is handled in other code and already worked prior to this PR.)
Correct the handling of the global tracer in the Helidon OpenTracing provider component.
Our Zipkin tracing provider component relies to some extent on our OpenTracing provider types. If a user includes the Zipkin tracing provider then OpenTracing comes along and our Zipkin implementation uses OpenTracing.
Previously, invoking
OpenTracingTracerProvider#global()
would return a new HelidonTracer
instance every time. Those instances would all wrap the single OpenTracing global tracer (whatever it is), but that's inefficient and caused failures in an existing propagation test in theprovider-tests
component. That test had been excluded for Zipkin because of the prior lack of propagation support.This PR changes two aspects of the global tracer handling in OpenTracing:
LazyValue
for the Helidon global tracer maintained by our OpenTracing provider so we reuse it appropriately rather than creating a new one on each invocation ofglobal()
.LazyValue
factory lambda and in theOpenTracingTracerProvider#global(Tracer)
method not only set or update the Helidon global tracer lazy value but also manage OpenTracing's similar mechanism. OpenTracing lets us supply code we want OpenTracing to run to create the OpenTracing global tracer. By specifying our code for this work we make sure our global Helidon tracer and the delegate global tracer in OpenTracing are in step.Remove the exclusion in the Zipkin provider
pom.xml
of the common context propagation test. The pom does now invoke it in a separate surefire execution to make sure the test has a functioning global tracer undisturbed by other tests.(Otherwise untouched for this enhancement) Add public constructor to
ZipkinTracerProvider
to clear the Javadoc warning.Documentation
Bug fix. Our tracing documentation does not discuss context propagation across threads within a server, so this PR has no doc impact.