fix: Fix missing metric response attributes in HTTPX instrumentation#3615
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
|
@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 :
|
|
@xrmx any chance to review this again? |
…ed-httpx-instrumentation
…ed-httpx-instrumentation
…pen-telemetry#3615) * fix: Fix missing metric response attributes in HTTPX instrumentation when span not recording * chore: add changelog * feat: Add unit tests for old and new semconv * fix: remove deprecated span attributes * fix: add tests for both sem conv * fix: add suggestions * fix: fix unit tests * Update CHANGELOG.md --------- Co-authored-by: Emídio Neto <[email protected]> Co-authored-by: Riccardo Magliocchetti <[email protected]>
…pen-telemetry#3615) * fix: Fix missing metric response attributes in HTTPX instrumentation when span not recording * chore: add changelog * feat: Add unit tests for old and new semconv * fix: remove deprecated span attributes * fix: add tests for both sem conv * fix: add suggestions * fix: fix unit tests * Update CHANGELOG.md --------- Co-authored-by: Emídio Neto <[email protected]> Co-authored-by: Riccardo Magliocchetti <[email protected]>
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
requestsinstrumentation 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.