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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size opencensus_ext_requests-0.7.4-py2.py3-none-any.whl (5.4 kB) | File type Wheel | Python version py2.py3 | Upload date | Hashes View |
Filename, size opencensus-ext-requests-0.7.4.tar.gz (4.1 kB) | File type Source | Python version None | Upload date | Hashes View |
Close
Hashes for opencensus_ext_requests-0.7.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c402c492890c9c982b4893d15b6962bf4a7a53f233f3be18367a15158154565 |
|
MD5 | 49e8ba050ebead6c86b288454b615948 |
|
BLAKE2-256 | 3ac51ccc5641d019efc0c21a8ef17d3a664a67a273465be371334378d545be1f |
Close
Hashes for opencensus-ext-requests-0.7.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5da97515b8613b1740d1cbfc445b236119944505fd8f8ea328b6a273d554458 |
|
MD5 | d75664c11bef963d89d7c443f5a6014c |
|
BLAKE2-256 | ec777ffcc268c4a986a032f963abb79cc192cc9834604f8c727f999e8584d55c |