Learn about the HTTPX integration and how it adds support for the HTTPX HTTP client.

The HTTPX integration instruments outgoing HTTP requests using either the sync or the async HTTPX clients.

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

Install sentry-sdk from PyPI with the httpx extra.

pip install --upgrade 'sentry-sdk[httpx]'

import sentry_sdk


The HTTPX integration is enabled automatically if you have the httpx package installed.

import httpx

def main():
    sentry_init(...)  # same as above
    with sentry_sdk.start_transaction(name="testing_sentry"):
        r1 = httpx.get("")
        r2 ="")


This will create a transaction called testing_sentry in the Performance section of, and create spans for the outgoing HTTP requests.

It takes a couple of moments for the data to appear in

  • HTTPX: 0.16+
  • Python: 3.6+
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").