Skip to content

serathius/sanic-sentry

Repository files navigation

Sanic-Sentry

Sanic-Sentry -- Sentry integration to sanic web server.

https://travis-ci.org/serathius/sanic-sentry.svg?branch=master

Requirements

  • python >= 3.6

Installation

Sanic-Sentry should be installed using pip:

pip install sanic-sentry

Usage

To initialize plugin you can pass 'app' to __init__:

>>> from sanic import Sanic
>>> from sanic_sentry import SanicSentry
>>> app = Sanic(__name__)
>>> plugin = SanicSentry(app)

Or use init_app to reverse dependency:

>>> plugin = SanicSentry()
>>> plugin.init_app(app)

Optional parameters:

SENTRY_DSN - Sentry DSN for your application:

If not set raven will fallback to SENTRY_DSN environment variable. Not setting either will disable raven.

>>> app.config['SENTRY_DSN'] = 'http://public:[email protected]/1'

SENTRY_PARAMS - Configure advanced parameters for sentry:

Explained in https://docs.sentry.io/clients/python/advanced/

>>> app.config['SENTRY_PARAMS'] = {
...     "release": "myapp_v0.4",
...     "environment": "production",
... }

About

Sentry integration to sanic web server

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages