{"id":447,"library":"opentelemetry-util-http","title":"OpenTelemetry HTTP Utilities","description":"Provides HTTP-related utilities for OpenTelemetry instrumentation, currently at version 0.61b0, with a beta release cadence.","status":"active","version":"0.61b0","language":"python","source_language":"en","source_url":"https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/opentelemetry-util-http","tags":["OpenTelemetry","HTTP","Instrumentation","Python"],"install":[{"cmd":"pip install opentelemetry-util-http","lang":"bash","label":"Install opentelemetry-util-http"}],"dependencies":[{"reason":"Provides the OpenTelemetry API for instrumentation.","package":"opentelemetry-api"},{"reason":"Provides the OpenTelemetry SDK for telemetry data processing.","package":"opentelemetry-sdk"}],"imports":[{"note":"Ensure correct import path to avoid ImportError.","symbol":"HttpInstrumentation","correct":"from opentelemetry.instrumentation.httpx import HttpInstrumentation"}],"quickstart":{"code":"import os\nfrom opentelemetry.instrumentation.httpx import HttpInstrumentation\n\n# Initialize the HTTPX instrumentation\nhttpx_instrumentor = HttpInstrumentation()\nhttpx_instrumentor.enable()\n\n# Your application code here\n# For example, making an HTTP request using httpx\nimport httpx\n\nclient = httpx.Client()\nresponse = client.get('http://example.com')\nprint(response.status_code)\n\n# Disable the instrumentation when done\nhttpx_instrumentor.disable()","lang":"python","description":"A basic example of using OpenTelemetry's HTTPX instrumentation to monitor HTTP requests."},"warnings":[{"fix":"Update your instrumentation and observability tools to handle the new attribute names 'url.path' and 'url.query'.","message":"The 'http.target' attribute has been split into 'url.path' and 'url.query' as part of the stabilization of HTTP Semantic Conventions. Ensure your instrumentation and observability tools are updated accordingly.","severity":"breaking","affected_versions":">=0.61b0"},{"fix":"Replace instances of 'http.client_ip' with 'client.address' in your codebase.","message":"The 'http.client_ip' attribute has been replaced with 'client.address' in the latest semantic conventions. Update your code to use 'client.address' for client IP information.","severity":"deprecated","affected_versions":">=0.61b0"},{"fix":"Install the required OpenTelemetry packages using pip: `pip install opentelemetry-api opentelemetry-sdk opentelemetry-instrumentation-httpx`.","message":"The OpenTelemetry instrumentation module could not be found. This typically means the necessary OpenTelemetry packages (e.g., opentelemetry-api, opentelemetry-sdk, and specific instrumentation packages like opentelemetry-instrumentation-httpx) are not installed in the environment.","severity":"breaking","affected_versions":">=0.61b0"},{"fix":"Ensure that the necessary OpenTelemetry packages are installed. For example, run 'pip install opentelemetry-sdk opentelemetry-instrumentation-httpx'.","message":"The 'opentelemetry.instrumentation' module was not found. This typically indicates that required OpenTelemetry packages, such as 'opentelemetry-sdk' or specific instrumentation packages like 'opentelemetry-instrumentation-httpx', are not installed in the environment.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-05-12T13:52:42.544Z","next_check":"2026-06-26T00:00:00.000Z","problems":[{"fix":"Ensure all installed OpenTelemetry-related packages are compatible by either upgrading all of them to their latest versions or pinning them to a known compatible set, often by using `pip install opentelemetry-sdk==X.Y.Z opentelemetry-api==X.Y.Z opentelemetry-util-http==A.B.C` where versions are aligned. Check release notes for breaking changes and dependency requirements.","cause":"This error typically occurs due to version incompatibility between different OpenTelemetry packages, where a newer version of the OpenTelemetry SDK or API has removed or renamed the '_ExtendedAttributes' symbol from 'opentelemetry.util.types', while dependent packages like `opentelemetry-util-http` (or other instrumentations) still expect it.","error":"ImportError: cannot import name '_ExtendedAttributes' from 'opentelemetry.util.types'"},{"fix":"Upgrade all OpenTelemetry packages, including `opentelemetry-util-http` and any instrumentations, to their latest compatible versions. If using auto-instrumentation, ensure the `opentelemetry-distro` and other core packages are up-to-date.","cause":"This error indicates that the `_once` module, which was an internal utility, is no longer available or has been refactored in newer versions of the OpenTelemetry Python SDK, leading to import failures if older code or instrumentation tries to access it.","error":"ModuleNotFoundError: No module named 'opentelemetry.util._once'"},{"fix":"Install the core OpenTelemetry packages using `pip install opentelemetry-api opentelemetry-sdk` (and `opentelemetry-util-http` if it's a direct dependency), and ensure your application is running in the correct Python environment where these packages are installed.","cause":"This fundamental error means that the base `opentelemetry` package, which is required by `opentelemetry-util-http` and all other OpenTelemetry components, is not installed or not accessible in the current Python environment.","error":"ModuleNotFoundError: No module named 'opentelemetry'"},{"fix":"Ensure that `opentelemetry-sdk` and `opentelemetry-exporter-otlp-proto-http` (and other related `opentelemetry-*` packages including `opentelemetry-util-http`) are installed in compatible versions. Upgrading all OpenTelemetry packages to their latest versions, or explicitly pinning them to a known working set, usually resolves this.","cause":"This `ImportError` often arises from version mismatches between the `opentelemetry-sdk` and exporter packages, particularly `opentelemetry-exporter-otlp-proto-http`, where a specific environment variable or symbol expected by the exporter is missing or has changed in the installed SDK version.","error":"ImportError: cannot import name 'OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE' from 'opentelemetry.sdk.environment_variables'"}],"ecosystem":"pypi","meta_description":null,"install_score":0,"install_tag":"stale","quickstart_score":0,"quickstart_tag":"stale","pypi_latest":null,"install_checks":{"last_tested":"2026-05-12","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null}]},"quickstart_checks":{"last_tested":"2026-04-23","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}}