Sentry is designed to be very simple to get off the ground, yet powerful to grow into. If you have never used Sentry before, this tutorial will help you getting started.
Getting started with Sentry is a three step process:
Configure an SDK¶
Sentry captures data by using an SDK within your application’s runtime. These are platform specific, and allow Sentry to have a deep understanding of both how your application works. In case your environment is very specific, you can also roll your own SDK using our document SDK API.
Popular integrations are:
For exact configuration for the integration consult the corresponding documentation. For all SDKs however, the basics are the same.
About the DSN¶
After you complete setting up a project in Sentry, you’ll be given a value which we call a DSN, or Data Source Name. It looks a lot like a standard URL, but it’s actually just a representation of the configuration required by the Sentry SDKs. It consists of a few pieces, including the protocol, public and secret keys, the server address, and the project identifier.
The DSN can be found in Sentry by navigating to [Project Name] -> Project Settings -> Client Keys (DSN). Its template resembles the following:
If you are using the Hosted Sentry and signed into your account, the documentation will refer to your actual DSNs. You can select the correct one which will adjust the examples for easy copy pasting:
It is composed of five important pieces:
- The Protocol used. This can be one of the following: http or https.
- The public and secret keys to authenticate the SDK.
- The destination Sentry server.
- The project ID which the authenticated user is bound to.
You’ll have a few options for plugging the DSN into the SDK, depending
on what it supports. At the very least, most SDKs will allow you to set
it up as the
SENTRY_DSN environment variable or by passing it into the
import raven raven.Client('___DSN___')
Note: If you’re using Heroku, and you’ve added Hosted Sentry via the
standard addon hooks, most SDKs will automatically pick up the
SENTRY_DSN environment variable that we’ve already configured for you.