-
Notifications
You must be signed in to change notification settings - Fork 626
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
fix asynchonous unary call traces #536
Conversation
|
...ntation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_client.py
Outdated
Show resolved
Hide resolved
...ntation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_client.py
Outdated
Show resolved
Hide resolved
...ntation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_client.py
Outdated
Show resolved
Hide resolved
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.
Nice LGTM overall, but would be great if someone else can also take a look.
intercept_unary()
and intercept_stream()
seem to duplicate a lot of code, would it be reasonable to refactor them to share it?
...ntation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_client.py
Show resolved
Hide resolved
...ntation/opentelemetry-instrumentation-grpc/src/opentelemetry/instrumentation/grpc/_client.py
Show resolved
Hide resolved
ok i've refactored some of the code but I think it's getting into can-o-worms territory. There's stuff like |
Nice thank you for the contribution! |
the |
Description
When calling the GRPC client with
future()
, the client fails as the context object is re-entered during the asynchonous callback. Seetest_unary_unary_future
. This PR fixes that by using lower level function calls to control the re-entry of context during the synchronous and asynchonous bits.Type of change
Bug fix
How Has This Been Tested?
tox -e test-instrumentation-grpc test_client_interceptor.py::TestClientProto::test_unary_unary_future
Does This PR Require a Core Repo Change?
No.
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.
Followed the style guidelines of this project
Unit tests have been added