opentelemetry-instrumentation-httpx
OpenTelemetry HTTPX Instrumentation
Install
opentelemetry-instrumentation-httpx on PyPI
pip
pip install opentelemetry-instrumentation-httpxuv
uv add opentelemetry-instrumentation-httpxpoetry
poetry add opentelemetry-instrumentation-httpxPackage facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — opentelemetry-api, opentelemetry-instrumentation, opentelemetry-semantic-conventions, opentelemetry-util-http, wrapt |
| Maintenance | actively maintained — 28 days since the last release |
| Last repo commit | |
| First released | |
| Popularity | one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: opentelemetry_instrumentation_httpx-0.65b0-py3-none-any.whl
About opentelemetry-instrumentation-httpx
from the package's own PyPI description — quoted content, verbatim
OpenTelemetry HTTPX Instrumentation
|pypi|
.. |pypi| image:: https://badge.fury.io/py/opentelemetry-instrumentation-httpx.svg :target: https://pypi.org/project/opentelemetry-instrumentation-httpx/
This library allows tracing HTTP requests made by the
httpx <https://www.python-httpx.org/> and
httpx2 <https://httpx2.pydantic.dev/> libraries.
If both libraries are installed, use HTTPXClientInstrumentor for
httpx clients and HTTPX2ClientInstrumentor for httpx2 clients.
The instrumentors can be enabled independently.
Installation
::
pip install opentelemetry-instrumentation-httpx
Usage
Instrumenting all clients
When using the instrumentor, all clients will automatically trace requests.
.. code-block:: python
import httpx
import asyncio
from opentelemetry.instrumentation.httpx import HTTPXClientInstrumentor
url = "https://example.com"
HTTPXClientInstrumentor().instrument()
with httpx.Client() as client:
response = client.get(url)
async def get(url):
async with httpx.AsyncClient() as client:
response =...
Read as markdown · JSON record · Source repository · Homepage
AI interpretation — verify before relying
AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page
Automatically traces HTTP requests made by httpx and httpx2 clients, integrating them into OpenTelemetry observability pipelines for distributed tracing.
Low friction installation with five stable runtime dependencies; actively maintained with a recent release 28 days ago and ongoing repository activity.
Apache-2.0 permissive license allows use in most projects, including commercial ones, with minimal restrictions beyond attribution.
Usage
pip install opentelemetry-instrumentation-httpx
from opentelemetry.instrumentation.httpx import HTTPXClientInstrumentor
HTTPXClientInstrumentor().instrument()
Requires Python 3.10 or later; httpx or httpx2 library must be installed separately.
Verdict: A well-maintained, actively developed instrumentation library for adding distributed tracing to HTTP clients. No known vulnerabilities, permissive licensing, and low install friction make it a straightforward choice for teams adopting OpenTelemetry observability.
Needs verification
- Whether the package works correctly with both httpx and httpx2 simultaneously in the same application.
- Performance overhead of instrumentation on high-throughput HTTP clients.
- Compatibility with custom transports and middleware beyond the documented examples.
Similar packages
permissive · top 1,000 on PyPI
pytest-httpxpermissive · top 1,000 on PyPI
opentelemetry-instrumentation-urllibpermissive · top 1,000 on PyPI
opentelemetry-instrumentation-flaskpermissive · top 1,000 on PyPI
opentelemetry-instrumentation-sqlalchemypermissive · top 1,000 on PyPI
opentelemetry-instrumentation-fastapipermissive · top 1,000 on PyPI
opentelemetry-instrumentation-redispermissive · top 1,000 on PyPI
opentelemetry-instrumentation-aiohttp-clientpermissive · top 1,000 on PyPI
opentelemetry-instrumentation-psycopg2permissive · top 1,000 on PyPI
httpx2permissive · top 1,000 on PyPI