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.37b0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3db3413c8dc85441132486aa17907b122facfe6b0d8cad5f92fee2e5465694f5 |
|
MD5 | 464142492db8c7092342e76db5556775 |
|
BLAKE2b-256 | dcf0fa31a106903b60375a3cb3b215f770ece50b462e35aa1e0508bca0c41c23 |
Close
Hashes for opentelemetry_instrumentation_urllib3-0.37b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 607abc86272784b80ad6a28aa6d2c799c57efa21c11a462b29dce1cdada80bd4 |
|
MD5 | 193efe33c8470b615d9921adcce37297 |
|
BLAKE2b-256 | 28864669bab600b191f0d226db003fb4a6b5204768faff8fa13180b707a99f04 |