Skip to main content

OpenCensus Pyramid Integration

Project description

pypi

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')

Additional configuration can be provided, please read Customization for a complete reference.

from opencensus.trace import print_exporter
from opencensus.trace import samplers

settings = {
    'OPENCENSUS': {
        'TRACE': {
            'EXPORTER': print_exporter.PrintExporter(),
            'SAMPLER': samplers.ProbabilitySampler(rate=0.5),
        }
    }
}

config = Configurator(settings=settings)

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 Distribution

opencensus-ext-pyramid-0.7.2.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

opencensus_ext_pyramid-0.7.2-py2.py3-none-any.whl (5.6 kB view hashes)

Uploaded Python 2 Python 3

Supported by

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