Skip to main content

Sentry Integration for Muffin framework

Project description

Muffin-SentrySentry Integration for Muffin framework

Tests Status PYPI Version Python Versions


  • python >= 3.8


Muffin-Sentry should be installed using pip:

pip install muffin-sentry


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")

# Setup custom request processors (coroutines are not supported)
def user_scope(event, hint, request):
    if request.user:
        event['user'] =
    return event

# Use it inside your handlers

# The exception will be send to Sentry
async def catch_exception(request):
    raise Exception('unhandled')

# Capture a message by manual
async def message(request):
    sentry.capture_message('a message from app')
    return 'OK'

# Capture an exception by manual
async def exception(request):
    return 'OK'

# Update Sentry Scope
async def user(request):
    scope = sentry.current_scope.get()
    scope.set_user({'id': 1, 'email': ''})
    return 'OK'



Default value




Sentry DSN for your application



Additional options for Sentry SDK Client. See


[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:


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


Development of Muffin-Sentry happens at:


  • klen (Kirill Klenov)


Licensed under a MIT license.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

muffin-sentry-1.3.0.tar.gz (5.3 kB view hashes)

Uploaded source

Built Distribution

muffin_sentry-1.3.0-py3-none-any.whl (5.1 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page