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.28b1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52f451d0399f4c63ddc79325f6695941e617615f4c331a1a45b63e21b27ba1dc |
|
MD5 | 0c113d94f35d5b7ee8e1cf0c5768f3c7 |
|
BLAKE2b-256 | c0f34f198ba31a999774b7fcd6c6fa75c9e00fce8a2b0a43a0dcb9830cedf771 |
Close
Hashes for opentelemetry_instrumentation_urllib3-0.28b1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7457273a18ee48d182448d14f8ec0b6e21bb52becaf0ec4ffdb4fbe4dc7d6682 |
|
MD5 | 359199b87cee7873e88b26c39c06e119 |
|
BLAKE2b-256 | 7fd5e503a89f865f8695b9f84502b143eb2a83eb6def3ff4804449fe8a75bcb6 |