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.30b1.tar.gz
.
File metadata
- Download URL: opentelemetry-instrumentation-urllib3-0.30b1.tar.gz
- Upload date:
- Size: 11.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.7.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48dadf03e55f7670f85ea5310b9ec62a9a789a041fc0a1ae4ca22271f965046c |
|
MD5 | 5988c7127a5706e5a0d4eee2dc779fa1 |
|
BLAKE2b-256 | fabde587c1fc2313b81d3a64c979636da58429a00d262721f6daddc9dca4fcb6 |
File details
Details for the file opentelemetry_instrumentation_urllib3-0.30b1-py3-none-any.whl
.
File metadata
- Download URL: opentelemetry_instrumentation_urllib3-0.30b1-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.7.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39ddaabca92a152ab18468bed4b6694c9da976d3e2e7b302c74367a8d6e785b3 |
|
MD5 | 3dcbb33c28cf71eedb689208ec809aef |
|
BLAKE2b-256 | 098acf6210fdc2d71415a371d086fd2d1a23ed72555345aab41ba2eed94a52df |