Skip to main content

OpenTelemetry urllib3 instrumentation

Project description

pypi

This library allows tracing HTTP requests made by the urllib3 library.

Installation

pip install opentelemetry-instrumentation-urllib3

Configuration

Request/Response hooks

The urllib3 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:

# `request` is an instance of urllib3.connectionpool.HTTPConnectionPool
def request_hook(span, request):
    pass

# `request` is an instance of urllib3.connectionpool.HTTPConnectionPool
# `response` is an instance of urllib3.response.HTTPResponse
def response_hook(span, request, response):
    pass

URLLib3Instrumentor.instrument(
    request_hook=request_hook, response_hook=response_hook)
)

References

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

File details

Details for the file opentelemetry-instrumentation-urllib3-0.30b0.tar.gz.

File metadata

File hashes

Hashes for opentelemetry-instrumentation-urllib3-0.30b0.tar.gz
Algorithm Hash digest
SHA256 cfa704a1f2f7002f80cc0e401572678d767969c35d9badd4e5f6bd65b25a9fc5
MD5 4423709f8c1d55447a774ee30369280d
BLAKE2b-256 a1ba18d747185aaed5259842c7bd31cf1fa163b9dd496e6335a4bb4e60b68d8c

See more details on using hashes here.

File details

Details for the file opentelemetry_instrumentation_urllib3-0.30b0-py3-none-any.whl.

File metadata

File hashes

Hashes for opentelemetry_instrumentation_urllib3-0.30b0-py3-none-any.whl
Algorithm Hash digest
SHA256 f5bf8fb4dd840bfb9fcc456c2b55fc9ead019995c9a947b73b6edde969de2845
MD5 9f7c4f34d765e8f05048d16174790c43
BLAKE2b-256 f75af2c6a7e2bb8dba84eb49564351a904f31e4c1e0493988afd662f3c4336ac

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page