Sentry is an event logging platform primarily focused on capturing and aggregating exceptions, with a commercial service at https://getsentry.com
The Sentry client lib for Ruby (
) will send not all logs, but only crash reports, with a big pack of data. You can add more data, like current user and tags (more details
). At the Sentry server, this reports are grouped and displayed like a issue tracker, where you can comment, resolve, filter… and also be notified by new kind of crashes and regressions.
One big benefit is to not depend on consumers to notified about errors.
This install steps are based on https://docs.getsentry.com/on-premise/server/installation
and is focused for Debian GNU/Linux.
For more details, read: https://sentry.readthedocs.org/en/stable/getting-started/index.html
You should run this lines as root:
# Install python package installer and other dependencies
aptitude install python-dev python-pip python-libxml2 python-libxslt1 libxslt1-dev libxml2-dev libffi-dev redis-server postgresql libpq-dev
pip install --upgrade setuptools
pip install --upgrade funcsigs
# Install Sentry with PIP
pip install --upgrade sentry
# Install Postgres support
pip install --upgrade sentry[postgres]
# Create config
sentry init /etc/sentry/sentry.conf.py
Configure Sentry Server
and update this variables:
SENTRY_URL_PREFIX = 'http://my.domain.xyz' # No trailing slash!
SENTRY_ADMIN_EMAIL = 'firstname.lastname@example.org'
EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend'
EMAIL_FILE_PATH = '/tmp/sentry-mail'
# Mail conf docs: https://docs.djangoproject.com/en/1.8/topics/email/
Build the Database
su postgres -c 'createuser sentry --no-superuser --createdb --no-createrole -P'
su postgres -c 'createdb -E utf-8 sentry -O sentry'
Apply the DB shema
SENTRY_CONF=/etc/sentry/sentry.conf.py sentry upgrade
On the first update
will ask you for admin email and password, interactively. That means i don't know how to make the 100% installation automatic.
or your preferred user for web services.
SENTRY_CONF=/etc/sentry/sentry.conf.py sentry start
It is working at http://localhost:9000
To change the domain and port edit
Start the worker
SENTRY_CONF=/etc/sentry/sentry.conf.py sentry celery worker -B
Congratulations. You have a working Sentry server.
Cleanup Old Data
Add to your crontab:
0 3 * * * sentry cleanup --days=30
Adding Sentry support to Noosfero
(it is a concept proof yet)
This doc is a simple and direct quick start. For more details read:
gem install sentry-raven
(With gem while we do not pack sentry-raven)
gem 'sentry-raven', '~> 0.15.2'
Raven.configure do |config|
config.environments = ['development', 'production']
Raven.configure do |config|
config.dsn = 'http://<secret>@sentry.domain.xyz/<projet-id>'
config.sanitize_fields = Rails.application.config.filter_parameters.map(&:to_s)
# Set the user somewhere. May be on a root controller class.
Raven.user_context identifier: user.identifier, email: user.email if user
# Add context to raven setting tags over the code.
Raven.tags_context profile_type: 'big community'
# You can send a report for Sentry without a crash using methods like this:
Raven.capture_message 'Shit happens'