OpenCensus Requests Integration
Project description
OpenCensus can trace HTTP requests made with the requests package. The request URL, method, and status will be collected.
You can enable requests integration by specifying 'requests' to trace_integrations.
It’s possible to configure a list of URL you don’t want traced. By default the request to exporter won’t be traced. It’s configurable by giving an array of hostname/port to the attribute excludelist_hostnames in OpenCensus context’s attributes:
Only the hostname must be specified if only the hostname is specified in the URL request.
Installation
pip install opencensus-ext-requests
Usage
import requests
from opencensus.trace import config_integration
from opencensus.trace.tracer import Tracer
if __name__ == '__main__':
config_integration.trace_integrations(['requests'])
tracer = Tracer()
with tracer.span(name='parent'):
response = requests.get(url='https://www.wikipedia.org/wiki/Rabbit')
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
File details
Details for the file opencensus-ext-requests-0.8.0.tar.gz
.
File metadata
- Download URL: opencensus-ext-requests-0.8.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a57dd6030ce032e1ed8e7145568058076e400057d0cf44ecd0f5b0f477095a0 |
|
MD5 | 51e59951b13cda92714403573f5d5c1e |
|
BLAKE2b-256 | b3359072d30ad34fe845aae31046d33beb660470b059e69b652d893e0e9c947f |
File details
Details for the file opencensus_ext_requests-0.8.0-py2.py3-none-any.whl
.
File metadata
- Download URL: opencensus_ext_requests-0.8.0-py2.py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ace4b790e2f1950bd91f2c6fa166d69eb65ff0f0671d764d35682a07eed08c0 |
|
MD5 | 0aa3c877fdd507b24b96e0c3d4f004f9 |
|
BLAKE2b-256 | a4abd1f9e905fbdd07e00e0e7ec20d7869f43abf4b594adaded8e9a1b2f7fd0d |