Metadata-Version: 2.1
Name: opencensus-ext-pyramid
Version: 0.2.0
Summary: OpenCensus Pyramid Integration
Home-page: https://github.com/census-instrumentation/opencensus-python/tree/master/contrib/opencensus-ext-pyramid
Author: OpenCensus Authors
Author-email: census-developers@googlegroups.com
License: Apache-2.0
Platform: UNKNOWN
Classifier: Intended Audience :: Developers
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Requires-Dist: pyramid (<2.0.0,>=1.9.1)
Requires-Dist: opencensus (<1.0.0,>=0.4.0)

OpenCensus Pyramid Integration
============================================================================

|pypi|

.. |pypi| image:: https://badge.fury.io/py/opencensus-ext-pyramid.svg
   :target: https://pypi.org/project/opencensus-ext-pyramid/

Installation
------------

::

    pip install opencensus-ext-pyramid

Usage
-----

In your application, add the pyramid tween and your requests will be
traced.

.. code:: python

    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

.. code:: python

    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)


