diff --git a/docs/platforms/python/integrations/httpx2/index.mdx b/docs/platforms/python/integrations/httpx2/index.mdx new file mode 100644 index 0000000000000..beb2cba011005 --- /dev/null +++ b/docs/platforms/python/integrations/httpx2/index.mdx @@ -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. + + + +## 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+ diff --git a/docs/platforms/python/integrations/index.mdx b/docs/platforms/python/integrations/index.mdx index 6b7941469605d..ad8f9c42fbebc 100644 --- a/docs/platforms/python/integrations/index.mdx +++ b/docs/platforms/python/integrations/index.mdx @@ -93,6 +93,7 @@ The Sentry SDK uses integrations to hook into the functionality of popular libra | ------------------------------------------------------------------------------------------------------------------------------ | :--------------: | | | ✓ | | | ✓ | +| | ✓ | | | | | Python standard HTTP client (in the [Default Integrations](default-integrations/#stdlib)) | ✓ | | `Requests` HTTP instrumentation is done via the [Default Integrations](default-integrations/#stdlib). | ✓ |