--- id: opentelemetry-instrumentation-urllib version: "0.65b0" license: Apache-2.0 license_treatment: permissive maintenance: active --- # opentelemetry-instrumentation-urllib — OpenTelemetry urllib instrumentation License: permissive · Maintenance: active · Popularity: top 1,000 on PyPI ## Install pip install opentelemetry-instrumentation-urllib uv add opentelemetry-instrumentation-urllib poetry add opentelemetry-instrumentation-urllib ## Description OpenTelemetry urllib Instrumentation ==================================== |pypi| .. |pypi| image:: https://badge.fury.io/py/opentelemetry-instrumentation-urllib.svg :target: https://pypi.org/project/opentelemetry-instrumentation-urllib/ This library allows tracing HTTP requests made by the `urllib `_ library. Installation ------------ :: pip install opentelemetry-instrumentation-urllib Configuration ------------- Request/Response hooks ********************** The urllib instrumentation supports extending tracing behavior with the help of request and response hooks. These are functions that are called back by the instrumentation right after a Span is created for a request and right before the span is finished processing a response respectively. The hooks can be configured as follows: .. code:: python from opentelemetry.instrumentation.urllib import URLLibInstrumentor # `request_obj` is an instance of urllib.request.Request def request_hook(span, request_obj): pass # `request_obj` is an instance of urllib.request.Request # `response` is an instance of http.client.HTTPResponse def... ## AI interpretation — verify before relying Automatically traces HTTP requests made by Python's urllib library, capturing request/response details and timing for OpenTelemetry observability. Verdict: A well-maintained, low-friction instrumentation package for urllib tracing within the OpenTelemetry ecosystem. Beta status and no known vulnerabilities make it suitable for observability-focused projects, though production deployments should verify compatibility with your tracer backend. [View on SkillFed](https://skillfed.io/packages/opentelemetry-instrumentation-urllib) · [View on PyPI](https://pypi.org/project/opentelemetry-instrumentation-urllib/)