Skip to content

Add HTTPXWrapper backed by httpx2#23883

Draft
mwdd146980 wants to merge 1 commit into
mwdd146980/httpx-migration-basefrom
mwdd146980/phase2-httpx2-wrapper-mvp
Draft

Add HTTPXWrapper backed by httpx2#23883
mwdd146980 wants to merge 1 commit into
mwdd146980/httpx-migration-basefrom
mwdd146980/phase2-httpx2-wrapper-mvp

Conversation

@mwdd146980
Copy link
Copy Markdown
Contributor

What does this PR do?

Adds an HTTPXWrapper backed by httpx2 behind a use_httpx instance config flag. The default remains RequestsWrapper. Also widens the OpenMetrics v2 scraper to catch HTTPConnectionError alongside requests.exceptions.ConnectionError.

Motivation

Design validation for the migration RFC. httpx2 is the Pydantic-maintained successor to httpx, picking up stewardship now that the upstream project has slowed. Landing on a maintained library before any integration opts in. Supersedes the design exercise in #23822, which targeted httpx itself.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add `qa/required` if this PR needs QA validation, or `qa/skip-qa` if it does not. Exactly one of the two is required.
  • If you need to backport this PR to another branch, you can add the `backport/` label to the PR and it will automatically open a backport PR once this one is merged

This PR has been created and validated using the paired-review skill from agent-integrations. Ready for human review.

@datadog-prod-us1-6
Copy link
Copy Markdown

datadog-prod-us1-6 Bot commented May 29, 2026

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 9 Pipeline jobs failed

PR All | test / jcc7e1d2 / Nutanix   View in Datadog   GitHub Actions

🔧 Fix in code (Fix with Cursor). 3 undefined names: 'mock_resp' and 'mocker' in tests/conftest.py at lines 166 and 167.

PR All | test / j06ca546 / SNMP   View in Datadog   GitHub Actions

🔄 Retry job. This looks flaky and may succeed on retry. Failed to resolve 'ddintegrations.blob.core.windows.net'. NameResolutionError occurred during HTTP requests.

PR All | test / j46da136 / JBoss_WildFly   View in Datadog   GitHub Actions

🔄 Retry job. This looks flaky and may succeed on retry. Could not resolve hostname 'ddintegrations.blob.core.windows.net:443'.

View all 9 failed jobs.

🧪 20 Tests failed in 1 job

PR All | run   GitHub Actions

test_bulk_table from test_check.py   View in Datadog (Fix with Cursor)
HTTPSConnectionPool(host='ddintegrations.blob.core.windows.net', port=443): Max retries exceeded with url: /snmp/cisco-3850.snmprec (Caused by NameResolutionError("HTTPSConnection(host='ddintegrations.blob.core.windows.net', port=443): Failed to resolve 'ddintegrations.blob.core.windows.net' ([Errno -2] Name or service not known)"))
test_cast_metrics from test_check.py   View in Datadog (Fix with Cursor)
HTTPSConnectionPool(host='ddintegrations.blob.core.windows.net', port=443): Max retries exceeded with url: /snmp/cisco-3850.snmprec (Caused by NameResolutionError("HTTPSConnection(host='ddintegrations.blob.core.windows.net', port=443): Failed to resolve 'ddintegrations.blob.core.windows.net' ([Errno -2] Name or service not known)"))

View all 20 test failures

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 94.73%
Overall Coverage: 87.97% (+0.53%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: abf69ee | Docs | Datadog PR Page | Give us feedback!

@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented May 29, 2026

Validation Report

Validation Description Status
dep Verify dependency pins are consistent and Agent-compatible
qa-label Validate the pull request declares whether it needs QA for the next Agent release

Run ddev validate all changed --fix to attempt to auto-fix supported validations.

Passed validations (19)
Validation Description Status
agent-reqs Verify check versions match the Agent requirements file
ci Validate CI configuration and Codecov settings
codeowners Validate every integration has a CODEOWNERS entry
config Validate default configuration files against spec.yaml
http Validate integrations use the HTTP wrapper correctly
imports Validate check imports do not use deprecated modules
integration-style Validate check code style conventions
jmx-metrics Validate JMX metrics definition files and config
labeler Validate PR labeler config matches integration directories
legacy-signature Validate no integration uses the legacy Agent check signature
license-headers Validate Python files have proper license headers
licenses Validate third-party license attribution list
metadata Validate metadata.csv metric definitions
models Validate configuration data models match spec.yaml
openmetrics Validate OpenMetrics integrations disable the metric limit
package Validate Python package metadata and naming
readmes Validate README files have required sections
saved-views Validate saved view JSON file structure and fields
version Validate version consistency between package and changelog

View full run

@mwdd146980 mwdd146980 mentioned this pull request May 29, 2026
3 tasks
@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

❌ Patch coverage is 94.72817% with 32 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (mwdd146980/httpx-migration-base@f14a5ce). Learn more about missing BASE report.

Additional details and impacted files
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant