Pyramid

Installing Airbrake in a Pyramid application

Pyramid

The pybrake package makes it quick and easy to monitor your Pyramid app’s performance. It only takes a few minutes to start collecting real performance data so let’s jump right in!

Key Features


Installation & Configuration

Set up the Pybrake’s middleware and project config for your web application

Step 1: Install the latest version of pybrake

Airbrake for Pyramid uses our official Python notifier pybrake. To install run:

pip install -U pybrake

Step 2: Configure the Pybrake Pyramid middleware

First, import the Pyramid middleware from the pybrake package

from pybrake.middleware.pyramid import init_pybrake_config

"""
The pybrake provides middleware for error notification and APM.

:param config: Required the application configurator instance to register 
                error notifier and APM to Celery application, example as below one.
"""

Next, configure pybrake parameters and register middleware into your application

if __name__ == '__main__':
    settings = {
        'reload_all': True,
        'debug_all': True,
        'PYBRAKE': dict(
                    project_id=999999,
                    project_key='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
                    ),
    }
    with Configurator(settings=settings) as config:
        config.include('pyramid_basemodel')
        config.include('pyramid_tm')
        config.scan(".")
        config = init_pybrake_config(config)
        app = config.make_wsgi_app()
    server = make_server('0.0.0.0', 3000, app)
    server.serve_forever()

Now you are ready to start reporting errors and performance monitoring to Airbrake from your Pyramid app. Please look into sample example to get more idea.


Additional Settings

Please visit our Pybrake overview for details on useful features like:


Troubleshoot

If you have any questions or concerns, please address them here.