Using Sentry

After nearly a month using Sentry I have to say I am very happy and impressed. :-)

If you don't know about it, Sentry is a monitoring web service platform for your web application.

It has a smooth web service collecting all the logging from your applications in the level you want(Error/Warning/Info)
and report It to you via email or in the website realtime, very handy stuff.

I have it running to monitor three different kind of applications right now, Taikoa application(which is Python/Flask), a Django application and a Symfony 2 application, all of them reporting errors to the Sentry service through Http.

Sentry is Open Source so you could install it in your server. The installation is easy if you know how to deploy Python/Django
applications.

To understand how easy is to get it running let me show you some examples.

Configuration for Flask:

You would need to install raven.

pip install raven

And then in your main app.py

SENTRY_DSN=''
# You can add the SENTRY_DSN as you like, I usually have all
# my flask settings in a different file
from raven.contrib.flask import Sentry
sentry = Sentry(app)

Configuration for Django:

pip install raven

And then in the config:

# Set your DSN value
RAVEN_CONFIG = {
    'dsn': '',
}
# Add raven to the list of installed apps
INSTALLED_APPS = INSTALLED_APPS + (
    # ...
    'raven.contrib.django.raven_compat',
)

For Symfony 2:

You can install the Kunstmaan Sentry Bundle and define the sentry.dsn in your app/config/parameters.yml.

You can get these settings documentation from the Sentry application itself.

Javier Aguirre

Read more posts by this author.

comments powered by Disqus