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.26b1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6eead0cd32b11892954d612bdfde0600c5cd70145ae17da7c5f4ad13b9bd842 |
|
MD5 | 3e4ec38d39661c1a1f4d72ea4424e0bd |
|
BLAKE2b-256 | a81beb50612ec609b6cc485a19418252101cccb75bf0ca3efe3997cfd97824f0 |
Close
Hashes for opentelemetry_instrumentation_urllib3-0.26b1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3e8da5258d78e17772985aa6cc6a307456edbf3957c39c84edd923f123af9aa |
|
MD5 | d9a4a25eeadd4789d917fd5340ce9ee8 |
|
BLAKE2b-256 | 8d8d9dacb13b9b45a3080e9d689ba7398d7042a894ffb9d9682309192ff52d48 |