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 blacklist_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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for opencensus_ext_requests-0.1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19d64fd7296126611ef9a3277b1c96816b93938a415a0bdc55ce6699e130ca09 |
|
MD5 | e13b4df478b8fd0331e8217097a9c1fb |
|
BLAKE2b-256 | c7ffe12bdbed71ac483b70219b57af483f4783a2ab7b0cd60aea069e8c2d36a0 |