Muffin-Sentry
Muffin-Sentry – Sentry Integration for Muffin framework
Requirements
python >= 3.8
Installation
Muffin-Sentry should be installed using pip:
pip install muffin-sentry
Usage
from muffin import Application
import muffin_sentry
# Create Muffin Application
app = Application('example')
# Initialize the plugin
# As alternative: jinja2 = Jinja2(app, **options)
sentry = muffin_sentry.Plugin()
sentry.setup(app, dsn="DSN_URL")
# Use it inside your handlers
# The exception will be send to Sentry
@app.route('/unhandled')
async def catch_exception(request):
raise Exception('unhandled')
# Capture a message by manual
@app.route('/capture_message')
async def message(request):
sentry.capture_message('a message from app')
return 'OK'
# Capture an exception by manual
@app.route('/capture_exception')
async def exception(request):
sentry.capture_exception(Exception())
return 'OK'
# Update Sentry Scope
@app.route('/update_user')
async def user(request):
scope = sentry.current_scope.get()
scope.set_user({'id': 1, 'email': 'example@example.com'})
sentry.capture_exception(Exception())
return 'OK'
Options
Name |
Default value |
Desctiption |
dsn |
"" |
Sentry DSN for your application |
sdk_options |
{} |
Additional options for Sentry SDK Client. See https://docs.sentry.io/platforms/python/configuration/options/ |
ignore_errors |
[ResponseError, ResponseRedirect] |
Exception Types to Ignore |
You are able to provide the options when you are initiliazing the plugin:
sentry.setup(app, dsn='DSN_URL')
Or setup it inside Muffin.Application config using the SENTRY_ prefix:
SENTRY_DSN = 'DSN_URL'
Muffin.Application configuration options are case insensitive
Bug tracker
If you have any suggestions, bug reports or annoyances please report them to the issue tracker at https://github.com/klen/muffin-sentry/issues
Contributing
Development of Muffin-Sentry happens at: https://github.com/klen/muffin-sentry
Contributors
klen (Kirill Klenov)
License
Licensed under a MIT license.
Metadata
Release files for muffin-sentry 0.5.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| muffin-sentry-0.5.8.tar.gz | 5.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| muffin_sentry-0.5.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.7 kB
Release files / muffin-sentry-0.5.8.tar.gz
| Download URL | muffin-sentry-0.5.8.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
64044eaaa0463dbb4b5f4f3f746d69416acdf57f351473ed7027f54373be44fb
|
|
BLAKE2b-256 checksum How to use checksums |
5267aa0951f64878d384cc53b9ae7e632fa3614a7d7e2c96d5c71e55e4e0286b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5
|
Release files / muffin_sentry-0.5.8-py3-none-any.whl
| Download URL | muffin_sentry-0.5.8-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
69eaef12a29b00a392a63972fcc86e31b98c0158f822abb3ed845973d96e5f9e
|
|
BLAKE2b-256 checksum How to use checksums |
e3536a0e3d20c07fd9c413d435e8867aeb30b922d314a6146c093d18162cf3cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5
|