OpenCensus Django Integration
Project description
Installation
pip install opencensus-ext-django
Usage
For tracing Django requests, you will need to add the following line to the MIDDLEWARE_CLASSES section in the Django settings.py file.
MIDDLEWARE_CLASSES = [
...
'opencensus.ext.django.middleware.OpencensusMiddleware',
]
And add this line to the INSTALLED_APPS section:
INSTALLED_APPS = [
...
'opencensus.ext.django',
]
You can configure the sampler, exporter, propagator using the OPENCENSUS_TRACE setting in settings.py:
OPENCENSUS_TRACE = {
'SAMPLER': 'opencensus.trace.samplers.probability.ProbabilitySampler',
'REPORTER': 'opencensus.trace.print_exporter.PrintExporter',
'PROPAGATOR': 'opencensus.trace.propagation.google_cloud_format.'
'GoogleCloudFormatPropagator',
}
You can configure the sampling rate and other parameters using the OPENCENSUS_TRACE_PARAMS setting in settings.py:
OPENCENSUS_TRACE_PARAMS = {
'BLACKLIST_PATHS': ['/_ah/health'],
'GCP_EXPORTER_PROJECT': None,
'SAMPLING_RATE': 0.5,
'SERVICE_NAME': 'my_service',
'ZIPKIN_EXPORTER_HOST_NAME': 'localhost',
'ZIPKIN_EXPORTER_PORT': 9411,
'ZIPKIN_EXPORTER_PROTOCOL': 'http',
}
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_django-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35e8f6b7a966207ec9d1f0b815daaf58650f87005d88e3d38c2228529fa433b8 |
|
MD5 | 2db5fc453ba880aed758894a9a05bf63 |
|
BLAKE2b-256 | cb24afc56bdd65ee99ce0146677ccd42ea4ce3245b63c41138c6e35249aea347 |