Skip to content

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

diogosilva30
Copy link

@diogosilva30 diogosilva30 commented Jul 4, 2025

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:

Also the decision to include status code on a histogram should
not be dependent on tracing decisions.

Fixes #3614

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

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

  • Added unit tests for both old and new sem conv
  • Ran script provided in minimum reproducible code and saw after this change behaviour is as expected

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
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

Copy link

linux-foundation-easycla bot commented Jul 4, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@diogosilva30 diogosilva30 requested a review from a team as a code owner July 4, 2025 17:18
@diogosilva30
Copy link
Author

From manual testing this looks good and it's a simple change. Still need to figure out unit test updates tho

@diogosilva30 diogosilva30 marked this pull request as draft July 5, 2025 13:13
@diogosilva30 diogosilva30 changed the title (WIP) fix: Fix missing metric response attributes in HTTPX instrumentation fix: Fix missing metric response attributes in HTTPX instrumentation Jul 5, 2025
@diogosilva30 diogosilva30 marked this pull request as ready for review July 5, 2025 14:35
@diogosilva30
Copy link
Author

Added unit tests for both old and new sem conv ✅
Should be ready for review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing HTTP response attributes in HTTPX instrumentation
1 participant