Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Sentry integration to Muffin Framework.

NotificationsYou must be signed in to change notification settings

klen/muffin-sentry

Repository files navigation

Muffin-Sentry --Sentry Integration forMuffin framework

Tests StatusPYPI VersionPython Versions
  • 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'
NameDefault valueDesctiption
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

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp