- Notifications
You must be signed in to change notification settings - Fork0
klen/muffin-sentry
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
- python >= 3.9
Muffin-Sentry should be installed using pip:
pip install muffin-sentry
frommuffinimportApplicationimportmuffin_sentry# Create Muffin Applicationapp=Application('example')# Initialize the plugin# As alternative: jinja2 = Jinja2(app, **options)sentry=muffin_sentry.Plugin()sentry.setup(app,dsn="DSN_URL")# Setup custom request processors (coroutines are not supported)@sentry.processordefuser_scope(event,hint,request):ifrequest.user:event['user']=request.user.emailreturnevent# Use it inside your handlers# The exception will be send to Sentry@app.route('/unhandled')asyncdefcatch_exception(request):raiseException('unhandled')# Capture a message by manual@app.route('/capture_message')asyncdefmessage(request):sentry.capture_message('a message from app')return'OK'# Capture an exception by manual@app.route('/capture_exception')asyncdefexception(request):sentry.capture_exception(Exception())return'OK'# Update Sentry Scope@app.route('/update_user')asyncdefuser(request):scope=sentry.current_scope.get()scope.set_user({'id':1,'email':'example@example.com'})sentry.capture_exception(Exception())return'OK'
Name | Default value | Desctiption |
dsn | "" | Sentry DSN for your application |
sdk_options | {} | Additional options for Sentry SDK Client. Seehttps://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 insideMuffin.Application
config using theSENTRY_
prefix:
SENTRY_DSN='DSN_URL'
Muffin.Application
configuration options are case insensitive
If you have any suggestions, bug reports orannoyances please report them to the issue trackerathttps://github.com/klen/muffin-sentry/issues
Development of Muffin-Sentry happens at:https://github.com/klen/muffin-sentry
- klen (Kirill Klenov)
Licensed under aMIT license.
About
Sentry integration to Muffin Framework.
Topics
Resources
Code of conduct
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.