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.29b0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a8ffbc6ed6eb7b840285dd749df90219b1c17cb8e8b240203616965d6df9fa2 |
|
MD5 | 382954af2477b02be49084882ec263bf |
|
BLAKE2b-256 | 9ffef2c7a4f4a59a4ab12707450771772b146192a9ca5c07fe119dd2a604cbbf |
Close
Hashes for opentelemetry_instrumentation_urllib3-0.29b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fdef7373082998256515d51a8facf2e8bef82e606caaa415031b974f0a042574 |
|
MD5 | c9bc2026c279415f766bd7220b439e7c |
|
BLAKE2b-256 | 435728e76f03a97841660ef4e07c100ff5ed347944595ab1634369b1182cd432 |