OpenCensus Pyramid Integration
Project description
Installation
pip install opencensus-ext-pyramid
Usage
In your application, add the pyramid tween and your requests will be traced.
def main(global_config, **settings):
config = Configurator(settings=settings)
config.add_tween('opencensus.ext.pyramid'
'.pyramid_middleware.OpenCensusTweenFactory')
To configure the sampler, exporter, and propagator, pass the instances into the pyramid settings
from opencensus.trace import print_exporter
from opencensus.trace.propagation import google_cloud_format
from opencensus.trace.samplers import probability
settings = {}
settings['OPENCENSUS_TRACE'] = {
'EXPORTER': print_exporter.PrintExporter(),
'SAMPLER': probability.ProbabilitySampler(rate=0.5),
'PROPAGATOR': google_cloud_format.GoogleCloudFormatPropagator(),
}
config = Configurator(settings=settings)
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
Close
Hashes for opencensus_ext_pyramid-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53a26a5aa5151082a2eb5423576f39fa2be8a3dc8065385f888f8680cdd728d0 |
|
MD5 | 16b77c541960e8e259536f26f8613b6d |
|
BLAKE2b-256 | 86a77262d3bdb02b99f8779235c1a07a9af98198c7c331810b01339700a94319 |