Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

90 lines (59 sloc) 2.254 kB

Pyramid Amon's documentation

Overview

Pyramid Amon is an add-on for the Pyramid Web Framework which allows developers to integrate their application with Amon application and system monitoring toolkit.

Installation

Install using setuptools, e.g. (within a virtualenv):

$ easy_install pyramid_amon

Setup

Once :mod:`pyramid_amon` is installed, you must use the config.include mechanism to include it into your Pyramid project's configuration. In your Pyramid project's __init__.py:

config = Configurator(.....)
config.include('pyramid_amon')

Alternately, instead of using the Configurator's include method, you can activate Pyramid by changing your application's .ini file, use the following line:

pyramid.includes = pyramid_amon

pyramid_amon obtains Amon settings from the **settings dictionary passed to the Configurator. It assumes that you've placed Amon configuration parameters prefixed with amon.config. in your Pyramid application's .ini file. For example:

[app:myapp]
.. other settings ..
amon.config.address = http://amon_instance:port
amon.config.protocol = http
amon.config.secret_key = the-secret-key-from-/etc/amon.conf

Usage

When this add-on is included into your Pyramid application, whenever a request to your application causes an exception to be raised, the add-on will send the URL that caused the exception, the exception type, and its related traceback information to an Amon monitoring service you have access.

You also can access logging facilities provided by amonpy.log instance in two ways:

request.amon.log(message, tags)

Or

from pyramid_amon import get_amon
amon = get_amon(request)
amon.log({"first_name": "John", "last_name": "Dev", "age": 29}, 'info')

See Amon documentation for more informations abour configuration and usage.

API Documentation

Indices and tables

Jump to Line
Something went wrong with that request. Please try again.