Skip to content
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 not continued on the client side #40

Open
epot opened this issue Jul 27, 2019 · 5 comments
Open

Span not continued on the client side #40

epot opened this issue Jul 27, 2019 · 5 comments

Comments

@epot
Copy link

epot commented Jul 27, 2019

I am using grpc version 1.22.
I have the following code on the client side:

new ClientTracingInterceptor
                .Builder()
                .withActiveSpanSource(() -> 
                        GlobalTracer.get().activeSpan()
                ).build();

but it does not continue a span that started before. I debugged the code and it seems we are in a different thread than the one that called the client when the lambda is called (so GlobalTracer.get().activeSpan() is null. I am not sure how this is supposed to work.

@malafeev
Copy link
Contributor

you need to provide another implementation of ActiveSpanSource not based on ThreadLocal

@epot
Copy link
Author

epot commented Jul 29, 2019

So I need to keep a reference somehow of the contexts ? 🤔

@malafeev
Copy link
Contributor

I can propose another approach:
would you like to try SpecialAgent: https://github.com/opentracing-contrib/java-specialagent/
it supports grpc and span context propagation between threads.
also you don't need to modify your source code, you just need to add javaagent

@goto1134
Copy link

goto1134 commented Dec 4, 2020

Is it even ok that I have to use an external java agent to run this library?

@malafeev
Copy link
Contributor

malafeev commented Dec 4, 2020

This library is not needed if you will use external java agent.
OpenTracing is in deprecation mode.
Please check OpenTelemetry and agent: https://github.com/open-telemetry/opentelemetry-java-instrumentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants