skillfed

opentelemetry-instrumentation-httpx

OpenTelemetry HTTPX Instrumentation

opentelemetry-instrumentation-httpx Permissive license Apache-2.0 Active 1,086 v0.65b0 released

Install

opentelemetry-instrumentation-httpx on PyPI

pip

pip install opentelemetry-instrumentation-httpx

uv

uv add opentelemetry-instrumentation-httpx

poetry

poetry add opentelemetry-instrumentation-httpx

Package 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

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

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.
httpx tracing opentelemetryhttp request instrumentationdistributed tracing httpopentelemetry http clientasync http request spanshttp client telemetryopentelemetry instrumentation

Similar packages