This tutorial details how to setup a Sentry server on a Scaleway compute instance to start error tracking in your applications.
- You have an account and are logged into console.scaleway.com
- You have configured your SSH Key
Sentry is an open source solution for error tracking in applications. It is written in Python and can provide real-time reporting of errors in applications based on a client/server architecture. You can easily integrate it into your applications via its SDK and let them automatically report the errors via common messaging tools like Slack, IRC and more. This helps to reduce the time for development of your applications and increases the user experience. You can find all reports on a dashboard which makes it easy to triage the problem - how often it occurs, which impact it has on the user experience of your application, which part of your code causes the problem and so on.
In this tutorial, we will install sentry on a Ubuntu Xenial based instance.
1 . Update the system and install the required packages:
2 . Install
3 . Select a location for the environment and configure it with
virtualenv. As exemplified, the location used is
4 . Activate the
Note: Activating the environment will adjust the
pipwill install into the virtualenv by default.
5 . Now that the environment is setup, install
sentry on the machine. Again
pip is used:
Sentry relies on a lot of dependencies, and
pip will download all the required packages. The installation can take up to a few minutes.
We need to have a database ready to use before we launch the software. Sentry uses
PostgreSQL to store all information, and we can create the database as follows:
1 . Enable
citext extension as it is required for the installation (the database creation will fail is this step is skipped):
2 . Create the sentry database in a second step:
1 . Initialize Sentry:
This command will create the configuration files in the directory
Note: You can also specify any other directory for your configuration files by replacing the part
/etc/sentry. If you run
sentry initwithout specifying the path, the files will be stored in the directory
2 . Edit the file
/etc/sentry/sentry.conf.py and add the database credentials: It should look like the following example:
3 . In order to receive mails from our Sentry instance, configure the e-mail in the file
Note: The SMTP ports are blocked by default for security reasons. You can open a support request to get them unlocked. Click here for more information.
4 . Initialize the database by running the
upgrade function of Sentry:
By default, Sentry listens on port 9000. Therefore we will configure a small nginx proxy that listens on port 80 and forwards all requests on the standard HTTP port to port 9000.
1 . Edit the file
/etc/nginx/sites-enabled/default and put the following content in it:
2 . Save the file and restart your Sentry server:
Our Sentry server is ready now, but the services have to be started manually at each time when we reboot your instance.
1 . Configure Sentry server as a service with
supervisord standard put the following configuration in the file
2 . Save the file and reload
Your Sentry server is running now, and you can integrate it with your applications. You can also add additional features by adding different Plugins into Sentry.
1 . Once the installation is finished, connect from a browser:
2 . Login with the user that you have created at the
upgrade function during the installation.
You will be requested to finish the installation by providing some additional parameters and, once you have done, the Sentry Dashboard displays:
To create a new project click on the button in the top right corner and choose your environment. Sentry will show you instructions how to implement it in your project.
Sentry is a mighty tool that can be used to automatize your workflow and increase the user experience by reducing the time to market of your applications. There are many SDK’s for various programming languages available and you can check the documentation for your favourite language.