Skip to main content

Muffin-Sentry

Muffin-Sentry – Sentry Integration for Muffin framework

Tests Status PYPI Version Python Versions

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

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

# 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 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for muffin-sentry 1.3.0
File Size Uploaded Provenance Actions
muffin-sentry-1.3.0.tar.gz 5.3 kB Without provenance Details for muffin-sentry-1.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for muffin-sentry 1.3.0
File Interpreter ABI Platform Actions
muffin_sentry-1.3.0-py3-none-any.whl Python 3 none any Details for muffin_sentry-1.3.0-py3-none-any.whl

Total release size: 10.5 kB

Release files / muffin-sentry-1.3.0.tar.gz

Download URL muffin-sentry-1.3.0.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b999c5552ac2dd7dd3de87769cd1b0f9571ee3e1f4694520eff69a9b2eed13b0
BLAKE2b-256 checksum
How to use checksums
2b6ea804cba2e3b4f60f968d0fe8a8bfb6795d3ade4f4f2104bb76c7f3d9dc13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / muffin_sentry-1.3.0-py3-none-any.whl

Download URL muffin_sentry-1.3.0-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a2a1e26a4a53331785f69feae2ba1f49a997a6c3eba6d09c02a478685b61b0ab
BLAKE2b-256 checksum
How to use checksums
9d881595297638b3f67730adf280a90089f86cdbcde1b72390aa6f1947ed7e96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Security for muffin-sentry 1.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files No provenance

0.0.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page