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.28b0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e844b74e82696ca2e7687af073b2054887eddeaf4c91d578fae36685335d163 |
|
MD5 | afc7f5b38ec9e80044bb415fd34dea5a |
|
BLAKE2b-256 | 53feb032f4615cfbde758c8fad383e84bf09194391dec0d46b2553142a95dc52 |
Close
Hashes for opentelemetry_instrumentation_urllib3-0.28b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 300e16fd4c2ec4115c13049e5629662c186f72517991f513cedc20f9aa5692a7 |
|
MD5 | 1f689a73f4d3bd1e7f8a68ecf88c5dc7 |
|
BLAKE2b-256 | 6fef2501684f67d4408c0957d1f3e23e075e55b84dea28e0ad6fe1012ca1a053 |