Skip to content

feat: Support httpx2#6463

Merged
sentrivana merged 10 commits into
masterfrom
ivana/add-httpx2-integration
Jun 1, 2026
Merged

feat: Support httpx2#6463
sentrivana merged 10 commits into
masterfrom
ivana/add-httpx2-integration

Conversation

@sentrivana

@sentrivana sentrivana commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Description

Support httpx2.

Copy our httpx integration and tests and use that as the basis for the new integration, so that if the new fork diverges, we can only edit the dedicated integration.

Changes compared to HttpxIntegration:

  • Renamed all httpx -> httpx2 (duh)
  • Needed a replacement for pytest-httpx. Picked httpx2-pytest since it's drop-in. Since it's a new project, pinned it to the current version for additional safety.
  • The tests needed adapting to be 3.14 compatible (httpx isn't tested on 3.14): asyncio.get_event_loop().run_until_complete -> asyncio.run

Docs: getsentry/sentry-docs#17940

Issues

Reminders

@linear-code

linear-code Bot commented Jun 1, 2026

Copy link
Copy Markdown

PY-2502

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

7 passed | Total: 7 | Pass Rate: 100% | Execution Time: 1.20s

📊 Comparison with Base Branch

Metric Change
Total Tests 📉 -69
Passed Tests 📉 -69
Failed Tests
Skipped Tests

All tests are passing successfully.

✅ Patch coverage is 99.17%. Project has 16930 uncovered lines.
✅ Project coverage is 26.47%. Comparing base (base) to head (head).

Files with missing lines (1)
File Patch % Lines
sentry_sdk/integrations/httpx2.py 99.17% ⚠️ 1 Missing and 6 partials
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    25.79%    26.47%    +0.68%
==========================================
  Files          190       191        +1
  Lines        22905     23025      +120
  Branches      7856      7902       +46
==========================================
+ Hits          5907      6095      +188
- Misses       16998     16930       -68
- Partials       544       554       +10

Generated by Codecov Action

Comment thread scripts/populate_tox/config.py Outdated
Comment thread sentry_sdk/integrations/httpx2.py
Comment thread tests/integrations/httpx2/test_httpx2.py
Comment thread tests/integrations/httpx2/__init__.py Outdated
Comment thread tests/integrations/httpx2/test_httpx2.py
@sentrivana sentrivana changed the title feat: Add support for httpx2 feat: Support httpx2 Jun 1, 2026
@sentrivana sentrivana marked this pull request as ready for review June 1, 2026 09:26
@sentrivana sentrivana requested a review from a team as a code owner June 1, 2026 09:26
Comment thread sentry_sdk/integrations/httpx2.py
Comment thread tests/integrations/httpx2/test_httpx2.py
@sentrivana sentrivana marked this pull request as draft June 1, 2026 09:43
@sentrivana sentrivana marked this pull request as ready for review June 1, 2026 09:49
@sentrivana sentrivana merged commit 25272c9 into master Jun 1, 2026
165 of 167 checks passed
@sentrivana sentrivana deleted the ivana/add-httpx2-integration branch June 1, 2026 10:04
sentrivana added a commit to getsentry/sentry-docs that referenced this pull request Jun 8, 2026
We've added a new integration to the Python SDK in
getsentry/sentry-python#6463. This adds the docs
page for it. Note: It's just a copy of the existing HTTPX page as the
new package (HTTPX2) is a fork.

Preview:
- integrations table:
https://sentry-docs-git-ivana-add-httpx2-integration.sentry.dev/platforms/python/integrations/#http-clients
- integrations page:
https://sentry-docs-git-ivana-add-httpx2-integration.sentry.dev/platforms/python/integrations/httpx2/

## IS YOUR CHANGE URGENT?  

Help us prioritize incoming PRs by letting us know when the change needs
to go live.
- [x] Urgent deadline (GA date, etc.): June 8
- [ ] Other deadline: <!-- ENTER DATE HERE -->
- [ ] None: Not urgent, can wait up to 1 week+

## SLA

- Teamwork makes the dream work, so please add a reviewer to your PRs.
- Please give the docs team up to 1 week to review your PR unless you've
added an urgent due date to it.
Thanks in advance for your help!

## PRE-MERGE CHECKLIST

*Make sure you've checked the following before merging your changes:*

- [x] Checked Vercel preview for correctness, including links
- [ ] PR was reviewed and approved by any necessary SMEs (subject matter
experts)
- [ ] PR was reviewed and approved by a member of the [Sentry docs
team](https://github.com/orgs/getsentry/teams/docs)

## LEGAL BOILERPLATE

<!-- Sentry employees and contractors can delete or ignore this section.
-->

Look, I get it. The entity doing business as "Sentry" was incorporated
in the State of Delaware in 2015 as Functional Software, Inc. and is
gonna need some rights from me in order to utilize my contributions in
this here PR. So here's the deal: I retain all rights, title and
interest in and to my contributions, and by keeping this boilerplate
intact I confirm that Sentry can use, modify, copy, and redistribute my
contributions, under Sentry's choice of terms.

## EXTRA RESOURCES

- [Sentry Docs contributor guide](https://docs.sentry.io/contributing/)
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.

Add support for httpx2

2 participants