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
File details
Details for the file opentelemetry_instrumentation_urllib3-0.36b0.tar.gz
.
File metadata
- Download URL: opentelemetry_instrumentation_urllib3-0.36b0.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76c454937ed31c77fc6bfc5b9176c0e909e765fb17002c95f0f34ff84f0cddca |
|
MD5 | 4ad1ec0fcd980ec8db754d2b31a0a43e |
|
BLAKE2b-256 | d40a3f625c8917bb7691ce0a8c4ff20b1d3b3262b5f77cbc5b35cefa4e0c99e0 |
File details
Details for the file opentelemetry_instrumentation_urllib3-0.36b0-py3-none-any.whl
.
File metadata
- Download URL: opentelemetry_instrumentation_urllib3-0.36b0-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bad56fe60dd0055d3c130d16f1875f855fdec0d6a2e6942e638aa2e0ad6fab06 |
|
MD5 | 74df42b633284383e037745539387c70 |
|
BLAKE2b-256 | 2d473cd56f172a4d68149713eb56deaef1fb5c8c6cde817ce50ec4b735809111 |