Skip to content

Add httpx support#47953

Merged
rads-1996 merged 8 commits into
Azure:mainfrom
rads-1996:add-httpx-support
Jul 9, 2026
Merged

Add httpx support#47953
rads-1996 merged 8 commits into
Azure:mainfrom
rads-1996:add-httpx-support

Conversation

@rads-1996

@rads-1996 rads-1996 commented Jul 8, 2026

Copy link
Copy Markdown
Member

Description

Add support for httpx instrumentation. Fixes - #46286

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Copilot AI review requested due to automatic review settings July 8, 2026 20:23
@github-actions github-actions Bot added Monitor - Distro Monitor OpenTelemetry Distro Monitor - Exporter Monitor OpenTelemetry Exporter labels Jul 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds httpx to the set of libraries automatically instrumented by the Azure Monitor OpenTelemetry Distro. It wires httpx into the distro's supported-instrumentation list, adds the opentelemetry-instrumentation-httpx dependency, provides a sample and a smoke test, and registers httpx in the exporter's statsbeat tracking lists. This extends existing HTTP client instrumentation (requests, urllib, urllib3) to also cover httpx.

Changes:

  • Add httpx to the distro's _FULLY_SUPPORTED_INSTRUMENTED_LIBRARIES and the opentelemetry-instrumentation-httpx package dependency, plus docs/sample/test coverage.
  • Register httpx in the exporter's statsbeat instrumentation lists (introduces a duplicate entry — see review comment).
  • Update configuration tests to expect httpx enabled by default.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
azure-monitor-opentelemetry/azure/monitor/opentelemetry/_constants.py Adds httpx to fully-supported instrumentations (alphabetically placed — correct).
azure-monitor-opentelemetry/setup.py Adds opentelemetry-instrumentation-httpx dependency.
azure-monitor-opentelemetry/dev_requirements.txt Adds httpx dev dependency for tests/samples.
azure-monitor-opentelemetry/README.md Documents the httpx instrumentation and links.
azure-monitor-opentelemetry/samples/README.md Lists the new httpx sample.
azure-monitor-opentelemetry/samples/tracing/http_httpx.py New sample instrumenting httpx.
azure-monitor-opentelemetry/samples/tracing/instrumentation_options.py Adds httpx to the instrumentation options sample.
azure-monitor-opentelemetry/tests/instrumentation/test_httpx.py New smoke test for HTTPXClientInstrumentor.
azure-monitor-opentelemetry/tests/utils/test_configurations.py Updates expected config to include httpx enabled.
azure-monitor-opentelemetry-exporter/azure/monitor/opentelemetry/exporter/_constants.py Adds httpx to statsbeat lists; introduces a duplicate httpx in _INSTRUMENTATIONS_LIST.

Additional note (not attachable to a changed line): neither azure-monitor-opentelemetry/CHANGELOG.md nor azure-monitor-opentelemetry-exporter/CHANGELOG.md has an entry under the Unreleased ### Features Added section for this new httpx support, and the PR checklist flags CHANGELOG as not updated. Consider adding a changelog entry before release.

@rads-1996 rads-1996 force-pushed the add-httpx-support branch from b0b7f29 to 5819f08 Compare July 8, 2026 20:42

@JacksonWeber JacksonWeber left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM apart from the copilot comment.

@rads-1996

Copy link
Copy Markdown
Member Author

LGTM apart from the copilot comment.

@JacksonWeber I have addressed the copilot feedback and removed the duplicate declaration.

@rads-1996 rads-1996 requested review from a team, kashifkhan and xirzec as code owners July 8, 2026 21:18
@rads-1996 rads-1996 force-pushed the add-httpx-support branch from ffdf52f to 9e5e4ad Compare July 8, 2026 21:58
@rads-1996 rads-1996 force-pushed the add-httpx-support branch from 9e5e4ad to 6996d89 Compare July 8, 2026 22:00
@rads-1996 rads-1996 merged commit dad07b5 into Azure:main Jul 9, 2026
20 checks passed
@rads-1996 rads-1996 deleted the add-httpx-support branch July 9, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Monitor - Distro Monitor OpenTelemetry Distro Monitor - Exporter Monitor OpenTelemetry Exporter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants