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.34b0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58bdc30230f07d05d5dc6b7f24745b3e1ee62fd5cd012c18670e4764068d4c53 |
|
MD5 | 577359864269b11c0fa35335347c8de3 |
|
BLAKE2b-256 | 73c219d59d2c93e0871c6ebad702569ca3e4dc962f4c3aab65ab8ccff35158f4 |
Close
Hashes for opentelemetry_instrumentation_urllib3-0.34b0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d2327ce87831a360da281784b652e9f1a5a4ad81fd6ec035f7e48f550c31ad0 |
|
MD5 | 8e3f4c2d45056833296d1989272eee2d |
|
BLAKE2b-256 | 15e8a967e7f8a8edc083a74b1ba18817a01676a9a7144a8f87545c94d02efba8 |