Skip to main content

OpenCensus Requests Integration

Project description

pypi

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


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

If you're not sure about the file name format, learn more about wheel file names.

opencensus_ext_requests-0.7.3-py2.py3-none-any.whl (5.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file opencensus_ext_requests-0.7.3-py2.py3-none-any.whl.

File metadata

  • Download URL: opencensus_ext_requests-0.7.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.0

File hashes

Hashes for opencensus_ext_requests-0.7.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9647988dd6c2f07685ae43e9e3c957e840ef7515ee55472ba42f7dba71893b44
MD5 93d3f9901c8b3f6d6c8a1608680366e6
BLAKE2b-256 cdb0d988645e2c5ef602e1ab0174677304c7e8639fdff18fdfd22a2a035401fa

See more details on using hashes here.

Supported by

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