-
Notifications
You must be signed in to change notification settings - Fork 607
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
Sync hook used as async hook in opentelemetry-instrumentation-httpx causing TypeError #2734
Comments
Can you assign this one to me? |
@shijiadong2022 looking forward your PR |
@shijiadong2022 have you started working on this? |
I am working on it and will submit a PR soon |
Don't default to sync hooks for async hooks, then check that they are actually async. Fixes open-telemetry#2734
@horw Could you please double check if the fix works for you? To have the desired outcome with the updated code you should provide yourself the |
Describe your environment
OS: Ubuntu
Python 3.10.12
Name: opentelemetry-instrumentation-httpx
Version: 0.46b0
What happened?
code from lib
If you set up
request_hook
, it will also be used forasync_request_hook
if you don't initializeasync_request_hook
. This could lead to issues because you don't want to pass an async function torequest_hook
. If a non-async function is passed, it may not work as expected. It seems that there needs to be a wrapper aroundrequest_hook
to check if it is not async and then wrap it accordingly.Steps to Reproduce
Expected Result
Both requests completed
Actual Result
Additional context
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: