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.33b0.tar.gz.

File metadata

File hashes

Hashes for opentelemetry-instrumentation-urllib3-0.33b0.tar.gz
Algorithm Hash digest
SHA256 a935513112e370484f2c52510f508a5931c359726778131256958faa018a27f0
MD5 230c569e6d653a06ea60fc0271942018
BLAKE2b-256 0e466976019d0436a6bcb6ccaa851450da4c8f2ab30b7d0f4448194f6a9771ca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_urllib3-0.33b0-py3-none-any.whl
Algorithm Hash digest
SHA256 1188ebb858ee43aab25916fa9c93fab492436d7f869e5e485891a3d3885d80e0
MD5 b47594b6f7a8b122fa714938605a0378
BLAKE2b-256 42afed44680895de07fad62f9980a77923e96f13a5b45de3a1a18f1c0cbca433

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