Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions docs/platforms/python/integrations/httpx2/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
title: HTTPX2
description: "Learn about the HTTPX2 integration and how it adds support for the HTTPX2 HTTP client."
---

The [HTTPX2](https://httpx2.pydantic.dev/) integration instruments outgoing HTTP requests using either the sync or the async HTTPX2 clients.

Use this integration to create spans for outgoing requests and ensure traces are properly propagated to downstream services.

## Install

Install `sentry-sdk` from PyPI:

```bash {tabTitle:pip}
pip install sentry-sdk
```
```bash {tabTitle:uv}
uv add sentry-sdk
```

## Configure

The HTTPX2 integration is enabled automatically if you have the `httpx2` package installed.

<PlatformContent includePath="getting-started-config" />

## Verify

```python
import httpx2

def main():
sentry_init(...) # same as above
with sentry_sdk.start_transaction(name="testing_sentry"):
r1 = httpx2.get("https://sentry.io/")
r2 = httpx2.post("http://httpbin.org/post")

main()
```

This will create a transaction called `testing_sentry` in the Performance section of [sentry.io](https://sentry.io), and create spans for the outgoing HTTP requests.

It takes a couple of moments for the data to appear in [sentry.io](https://sentry.io).

## Supported Versions

- HTTPX2: 2.0+
- Python: 3.10+
1 change: 1 addition & 0 deletions docs/platforms/python/integrations/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ The Sentry SDK uses integrations to hook into the functionality of popular libra
| ------------------------------------------------------------------------------------------------------------------------------ | :--------------: |
| <LinkWithPlatformIcon platform="python.aiohttp" label="AIOHTTP" url="/platforms/python/integrations/aiohttp/aiohttp-client" /> | ✓ |
| <LinkWithPlatformIcon platform="python.httpx" label="HTTPX" url="/platforms/python/integrations/httpx" /> | ✓ |
| <LinkWithPlatformIcon platform="python" label="HTTPX2" url="/platforms/python/integrations/httpx2" /> | ✓ |
| <LinkWithPlatformIcon platform="python" label="pyreqwest" url="/platforms/python/integrations/pyreqwest" /> | |
| Python standard HTTP client (in the [Default Integrations](default-integrations/#stdlib)) | ✓ |
| `Requests` HTTP instrumentation is done via the [Default Integrations](default-integrations/#stdlib). | ✓ |
Expand Down
Loading