-
Notifications
You must be signed in to change notification settings - Fork 739
fix: Fix missing metric response attributes in HTTPX instrumentation #3615
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
base: main
Are you sure you want to change the base?
Conversation
…when span not recording
From manual testing this looks good and it's a simple change. Still need to figure out unit test updates tho |
Added unit tests for both old and new sem conv ✅ |
…ed-httpx-instrumentation
instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py
Outdated
Show resolved
Hide resolved
@xrmx let me know if further changes are required |
I think you missed this comment #3615 (comment) |
@xrmx Indeed I've missed, apologize. If you check previously existing tests those attributes are only asserted when test ends in We can see this explanation in original implementation by @emdneto : #2631 Don't know if it makes sense, but it's the current behaviour. I've added a new test case so it covers all 3 scenarios according to logic previously implemented by @emdneto :
|
Description
This PR fixes an issue where HTTP response attributes (status code, http version) are only recorded in metrics if span are recording. I believe this should not be the case because metrics should not be coupled with tracing. Based myself of
requests
instrumentation here, where it even states:Fixes #3614
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
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.