HTTPX

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

Install sentry-sdk from PyPI with the httpx extra.

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

Configure

Add HttpxIntegration() to your integrations list:

Copied
import sentry_sdk
from sentry_sdk.integrations.httpx import HttpxIntegration

sentry_sdk.init(
    dsn="https://examplePublicKey@o0.ingest.sentry.io/0",
    integrations=[
        HttpxIntegration(),
    ],
)

Supported Versions

  • 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!) to suggesting an update ("yeah, this would be better").