https://github.com/nameko/nameko-sentry
https://github.com/nameko/nameko-sentry
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/nameko/nameko-sentry
- Owner: nameko
- License: apache-2.0
- Created: 2015-07-28T15:24:45.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2023-12-05T10:28:14.000Z (over 2 years ago)
- Last Synced: 2025-02-25T21:56:20.438Z (over 1 year ago)
- Language: Python
- Size: 157 KB
- Stars: 28
- Watchers: 7
- Forks: 9
- Open Issues: 4
-
Metadata Files:
- Readme: README.rst
- License: LICENSE.txt
Awesome Lists containing this project
README
nameko-sentry
=============
Extension for `nameko `_ that sends entrypoint exceptions to a `sentry `_ server.
Usage
-----
Add your sentry DSN and optional client configuration to your nameko config file:
.. code-block:: yaml
# config.yaml
SENTRY:
DSN: ...
CLIENT_CONFIG:
site: "my site name"
processors:
- myapp.processors.SanitizePasswordsProcessor
...
Include the ``SentryReporter`` dependency in your service class:
.. code-block:: python
# service.py
from nameko.web.handlers import http
from nameko_sentry import SentryReporter
class Service(object):
name = "demo"
sentry = SentryReporter()
@http("GET", "/broken")
def broken(self, request):
raise SomeException("boom")
Run your service, providing the config file:
.. code-block:: shell
$ nameko run service --config config.yaml
Exceptions in entrypoints will be sent to your sentry server:
.. code-block:: shell
$ curl -i http://localhost:8000/broken
HTTP/1.1 500 INTERNAL SERVER ERROR
Content-Type: text/plain; charset=utf-8
Content-Length: 23
Date: Tue, 28 Jul 2015 13:34:06 GMT
Error: SomeException: boom
.. image:: screenshot.png
:alt: Screenshot of reported error