Skip to main content

OpenTelemetry urllib3 instrumentation

Project description

pypi

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


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

File details

Details for the file opentelemetry-instrumentation-urllib3-0.29b0.tar.gz.

File metadata

  • Download URL: opentelemetry-instrumentation-urllib3-0.29b0.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.12

File hashes

Hashes for opentelemetry-instrumentation-urllib3-0.29b0.tar.gz
Algorithm Hash digest
SHA256 9a8ffbc6ed6eb7b840285dd749df90219b1c17cb8e8b240203616965d6df9fa2
MD5 382954af2477b02be49084882ec263bf
BLAKE2b-256 9ffef2c7a4f4a59a4ab12707450771772b146192a9ca5c07fe119dd2a604cbbf

See more details on using hashes here.

File details

Details for the file opentelemetry_instrumentation_urllib3-0.29b0-py3-none-any.whl.

File metadata

  • Download URL: opentelemetry_instrumentation_urllib3-0.29b0-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.12

File hashes

Hashes for opentelemetry_instrumentation_urllib3-0.29b0-py3-none-any.whl
Algorithm Hash digest
SHA256 fdef7373082998256515d51a8facf2e8bef82e606caaa415031b974f0a042574
MD5 c9bc2026c279415f766bd7220b439e7c
BLAKE2b-256 435728e76f03a97841660ef4e07c100ff5ed347944595ab1634369b1182cd432

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page