OpenTelemetry urllib3 instrumentation
Project description
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
Release history Release notifications | RSS feed
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
Close
Hashes for opentelemetry-instrumentation-urllib3-0.27b0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6cb3a9a7b29e0f01f4cd077c8f6e85d16ae130955dce956f0dedbeb1e8a09696 |
|
MD5 | 0735a9280441f1b99e7a1663ac5240be |
|
BLAKE2b-256 | 8f0cb1d7dafa422d5fb42e1bb9542853fb57013947cfbc5c8e2d0f4fb66cfe7a |
Close
Hashes for opentelemetry_instrumentation_urllib3-0.27b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37c17ce53d766aa26f35ea91e7c12fe7864b6bf31b1e67b794e79691880ff072 |
|
MD5 | 4ca50e6b9b0656e89af7707e27ffd4a1 |
|
BLAKE2b-256 | 34f3fc59f90770a4664a0ac09dde03ac7c26fdc7836ba6bb8bec02843f290be0 |