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.30b0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfa704a1f2f7002f80cc0e401572678d767969c35d9badd4e5f6bd65b25a9fc5 |
|
MD5 | 4423709f8c1d55447a774ee30369280d |
|
BLAKE2b-256 | a1ba18d747185aaed5259842c7bd31cf1fa163b9dd496e6335a4bb4e60b68d8c |
Close
Hashes for opentelemetry_instrumentation_urllib3-0.30b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5bf8fb4dd840bfb9fcc456c2b55fc9ead019995c9a947b73b6edde969de2845 |
|
MD5 | 9f7c4f34d765e8f05048d16174790c43 |
|
BLAKE2b-256 | f75af2c6a7e2bb8dba84eb49564351a904f31e4c1e0493988afd662f3c4336ac |