-
Notifications
You must be signed in to change notification settings - Fork 628
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
Ensure httpx non-client methods are instrumented #2538
Conversation
instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py
Show resolved
Hide resolved
If you want to share credits you can add a |
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.
Other than the CHANGELOG nit, LGTM
It was a great idea until I tried to implement it by looking at the previous MR (+ .patch) for the author's e-mail, except that it's a hidden github e-mail which doesn't have the CLA signed. 🤣 Let's just leave it as is, I hope I'll be forgiven. 😅 |
...tion/opentelemetry-instrumentation-httpx/src/opentelemetry/instrumentation/httpx/__init__.py
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.
I have a question regarding a private attribute.
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.
I have a question regarding a private attribute.
Description
This is an update of previous MR for which the original author unfortunately didn't submit the updates required for merging into
main
. We actively use this instrumentation and this instrumentation gap is quite annoying to deal with.Quote from MR
The
httpx.get
,httpx.post
, etc. methods ultimately usehttpx._api.request
, which makes instantiateshttpx._api.Client
. Buthttpx.Client
is modified during instrumentation without updating the value imported in thehttpx._api
module.Fixing this was as easy as also patching the
Client
value inhttpx._api
.All credit for the fix goes to @dmontagu.
Fixes #1742
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
httpx
withouthttpx.Client
. Uninstrumentation is also tested.Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.