Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/serathius/sanic-sentry
Sentry integration to sanic web server
https://github.com/serathius/sanic-sentry
raven sanic sentry
Last synced: 3 months ago
JSON representation
Sentry integration to sanic web server
- Host: GitHub
- URL: https://github.com/serathius/sanic-sentry
- Owner: serathius
- License: mit
- Created: 2017-09-09T12:53:42.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-01-06T14:18:59.000Z (about 4 years ago)
- Last Synced: 2024-10-14T10:23:37.368Z (3 months ago)
- Topics: raven, sanic, sentry
- Language: Python
- Size: 40 KB
- Stars: 30
- Watchers: 4
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
- awesome-sanic - Sanic-Sentry
README
Sanic-Sentry
============Sanic-Sentry -- Sentry integration to sanic web server.
.. image:: https://badge.fury.io/py/sanic-sentry.svg
:target: https://badge.fury.io/py/sanic-sentry.. image:: https://travis-ci.org/serathius/sanic-sentry.svg?branch=master
:target: https://travis-ci.org/serathius/sanic-sentry.. image:: https://codecov.io/gh/serathius/sanic-sentry/branch/master/graph/badge.svg
:target: https://codecov.io/gh/serathius/sanic-sentryRequirements
------------- 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__:
.. code:: python
>>> from sanic import Sanic
>>> from sanic_sentry import SanicSentry
>>> app = Sanic(__name__)
>>> plugin = SanicSentry(app)Or use `init_app` to reverse dependency:
.. code:: python
>>> 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.
.. code:: python
>>> 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/
.. code:: python
>>> app.config['SENTRY_PARAMS'] = {
... "release": "myapp_v0.4",
... "environment": "production",
... }