muffin-sentry


Namemuffin-sentry JSON
Version 1.6.0 PyPI version JSON
download
home_pagehttps://github.com/klen/muffin-sentry
SummarySentry Integration for Muffin framework
upload_time2023-10-04 21:06:16
maintainer
docs_urlNone
authorKirill Klenov
requires_python>=3.8,<4.0
licenseMIT
keywords sentry asyncio trio asgi muffin
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Muffin-Sentry
#############

.. _description:

**Muffin-Sentry** -- Sentry_ Integration for Muffin_ framework

.. _badges:

.. image:: https://github.com/klen/muffin-sentry/workflows/tests/badge.svg
    :target: https://github.com/klen/muffin-sentry/actions
    :alt: Tests Status

.. image:: https://img.shields.io/pypi/v/muffin-sentry
    :target: https://pypi.org/project/muffin-sentry/
    :alt: PYPI Version

.. image:: https://img.shields.io/pypi/pyversions/muffin-sentry
    :target: https://pypi.org/project/muffin-sentry/
    :alt: Python Versions

.. _contents:

.. contents::

.. _requirements:

Requirements
=============

- python >= 3.8

.. _installation:

Installation
=============

**Muffin-Sentry** should be installed using pip: ::

    pip install muffin-sentry

.. _usage:

Usage
=====

.. code-block:: python

    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:

.. code-block:: python

    sentry.setup(app, dsn='DSN_URL')


Or setup it inside ``Muffin.Application`` config using the ``SENTRY_`` prefix:

.. code-block:: python

   SENTRY_DSN = 'DSN_URL'

``Muffin.Application`` configuration options are case insensitive

.. _bugtracker:

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:

Contributing
============

Development of Muffin-Sentry happens at: https://github.com/klen/muffin-sentry


Contributors
=============

* klen_ (Kirill Klenov)

.. _license:

License
========

Licensed under a `MIT license`_.

.. _links:


.. _klen: https://github.com/klen
.. _Muffin: https://github.com/klen/muffin
.. _Sentry: https://sentry.io/

.. _MIT license: http://opensource.org/licenses/MIT

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/klen/muffin-sentry",
    "name": "muffin-sentry",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "sentry,asyncio,trio,asgi,muffin",
    "author": "Kirill Klenov",
    "author_email": "horneds@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/95/7a/a289c6e87511e88facc4d3e7a3bb3f1ee3601f5b0ba6d4d2fb77a3729b3f/muffin_sentry-1.6.0.tar.gz",
    "platform": null,
    "description": "Muffin-Sentry\n#############\n\n.. _description:\n\n**Muffin-Sentry** -- Sentry_ Integration for Muffin_ framework\n\n.. _badges:\n\n.. image:: https://github.com/klen/muffin-sentry/workflows/tests/badge.svg\n    :target: https://github.com/klen/muffin-sentry/actions\n    :alt: Tests Status\n\n.. image:: https://img.shields.io/pypi/v/muffin-sentry\n    :target: https://pypi.org/project/muffin-sentry/\n    :alt: PYPI Version\n\n.. image:: https://img.shields.io/pypi/pyversions/muffin-sentry\n    :target: https://pypi.org/project/muffin-sentry/\n    :alt: Python Versions\n\n.. _contents:\n\n.. contents::\n\n.. _requirements:\n\nRequirements\n=============\n\n- python >= 3.8\n\n.. _installation:\n\nInstallation\n=============\n\n**Muffin-Sentry** should be installed using pip: ::\n\n    pip install muffin-sentry\n\n.. _usage:\n\nUsage\n=====\n\n.. code-block:: python\n\n    from muffin import Application\n    import muffin_sentry\n\n    # Create Muffin Application\n    app = Application('example')\n\n    # Initialize the plugin\n    # As alternative: jinja2 = Jinja2(app, **options)\n    sentry = muffin_sentry.Plugin()\n    sentry.setup(app, dsn=\"DSN_URL\")\n\n    # Setup custom request processors (coroutines are not supported)\n    @sentry.processor\n    def user_scope(event, hint, request):\n        if request.user:\n            event['user'] = request.user.email\n        return event\n\n    # Use it inside your handlers\n\n    # The exception will be send to Sentry\n    @app.route('/unhandled')\n    async def catch_exception(request):\n        raise Exception('unhandled')\n\n    # Capture a message by manual\n    @app.route('/capture_message')\n    async def message(request):\n        sentry.capture_message('a message from app')\n        return 'OK'\n\n    # Capture an exception by manual\n    @app.route('/capture_exception')\n    async def exception(request):\n        sentry.capture_exception(Exception())\n        return 'OK'\n\n    # Update Sentry Scope\n    @app.route('/update_user')\n    async def user(request):\n        scope = sentry.current_scope.get()\n        scope.set_user({'id': 1, 'email': 'example@example.com'})\n        sentry.capture_exception(Exception())\n        return 'OK'\n\n\nOptions\n-------\n\n=========================== ======================================= =========================== \nName                        Default value                           Desctiption\n--------------------------- --------------------------------------- ---------------------------\n**dsn**                     ``\"\"``                                  Sentry DSN for your application\n**sdk_options**             ``{}``                                  Additional options for Sentry SDK Client. See https://docs.sentry.io/platforms/python/configuration/options/\n**ignore_errors**           ``[ResponseError, ResponseRedirect]``   Exception Types to Ignore\n=========================== ======================================= =========================== \n\nYou are able to provide the options when you are initiliazing the plugin:\n\n.. code-block:: python\n\n    sentry.setup(app, dsn='DSN_URL')\n\n\nOr setup it inside ``Muffin.Application`` config using the ``SENTRY_`` prefix:\n\n.. code-block:: python\n\n   SENTRY_DSN = 'DSN_URL'\n\n``Muffin.Application`` configuration options are case insensitive\n\n.. _bugtracker:\n\nBug tracker\n===========\n\nIf you have any suggestions, bug reports or\nannoyances please report them to the issue tracker\nat https://github.com/klen/muffin-sentry/issues\n\n.. _contributing:\n\nContributing\n============\n\nDevelopment of Muffin-Sentry happens at: https://github.com/klen/muffin-sentry\n\n\nContributors\n=============\n\n* klen_ (Kirill Klenov)\n\n.. _license:\n\nLicense\n========\n\nLicensed under a `MIT license`_.\n\n.. _links:\n\n\n.. _klen: https://github.com/klen\n.. _Muffin: https://github.com/klen/muffin\n.. _Sentry: https://sentry.io/\n\n.. _MIT license: http://opensource.org/licenses/MIT\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Sentry Integration for Muffin framework",
    "version": "1.6.0",
    "project_urls": {
        "Homepage": "https://github.com/klen/muffin-sentry",
        "Repository": "https://github.com/klen/muffin-sentry"
    },
    "split_keywords": [
        "sentry",
        "asyncio",
        "trio",
        "asgi",
        "muffin"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9fea4533c062892982c5bdd0d81114165864f22dee40810e6ac55ae7bf55234c",
                "md5": "33fb89798e2a7fa1faec2c9850cb94e3",
                "sha256": "5e961e2e936bba98694c7c1a23df9797128e69f318bf8e46a16c6e45582950b8"
            },
            "downloads": -1,
            "filename": "muffin_sentry-1.6.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "33fb89798e2a7fa1faec2c9850cb94e3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 4334,
            "upload_time": "2023-10-04T21:06:15",
            "upload_time_iso_8601": "2023-10-04T21:06:15.709778Z",
            "url": "https://files.pythonhosted.org/packages/9f/ea/4533c062892982c5bdd0d81114165864f22dee40810e6ac55ae7bf55234c/muffin_sentry-1.6.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "957aa289c6e87511e88facc4d3e7a3bb3f1ee3601f5b0ba6d4d2fb77a3729b3f",
                "md5": "0f6a81beeb4c7dbd0fc103a7de7d4aa6",
                "sha256": "153e2579143611223f65540c2e4347191d13cb86e8525afb1f62b21875d336bf"
            },
            "downloads": -1,
            "filename": "muffin_sentry-1.6.0.tar.gz",
            "has_sig": false,
            "md5_digest": "0f6a81beeb4c7dbd0fc103a7de7d4aa6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 4211,
            "upload_time": "2023-10-04T21:06:16",
            "upload_time_iso_8601": "2023-10-04T21:06:16.788982Z",
            "url": "https://files.pythonhosted.org/packages/95/7a/a289c6e87511e88facc4d3e7a3bb3f1ee3601f5b0ba6d4d2fb77a3729b3f/muffin_sentry-1.6.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-04 21:06:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "klen",
    "github_project": "muffin-sentry",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "muffin-sentry"
}
        
Elapsed time: 0.13962s