-
Notifications
You must be signed in to change notification settings - Fork 858
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
Context propagation lost using parallel streams #12000
Comments
can you try this: try (Scope ignored = Context.current().makeCurrent()) { // **makeCurrent()**
assert Context.current() == ctx;
...
} |
are you also using the Java agent? |
Yes, we have the java agent too |
Hi @heyams, I don't know what is "ctx" to create the assert |
@ajaparicio don't worry about that assert statement, can you try this instead:
please let me know if that works. |
@heyams yes, setting the scope and then call the method works, thanks! We can use this workaround. Do you thing in the future we will have the propagation automatically? |
Context propagation is done automatically in these instrumentations It is not handled automatically in this case. I don't know if it can be implemented in the future. It will require some investigation. |
Thank you for the response, @heyams. |
Hi, it seems that the context propagation is not done when using parallel streams, as only one of the child threads are getting it. I'm testing this using version 2.6.0 of the opentelemetry-instrumentation-api artifact.
This is the test:
And the output:
The text was updated successfully, but these errors were encountered: