Warning
This documentation and stacks are currently a work-in-progress.
Users and logs provide clues. Sentry provides answers.
Docker Stack deployment for Sentry, feature-complete and packaged up for low-volume deployments and proofs-of-concept.
Sentry is a developer-first error tracking and performance monitoring platform that helps developers see what actually matters, solve quicker, and learn continuously about their applications.
https://develop.sentry.dev/self-hosted/
- Docker Swarm Cluster (with 1 Manager and 5 Worker nodes)
- 2 CPU Cores for each node
- 2 GB RAM for each node
- 20 GB Free Disk Space for each node
You need to have the following services running before you can install Sentry:
- redis
- kafka
- postgres
- clickhouse
Set the following environment variables in .env file and point them to the correct host:
# Leave it as show if you plan to use the development stack.
# Otherwise, set it to the external host of each service.
export REDIS_HOST=redis
export CLICKHOUSE_HOST=clickhouse
export KAFKA_DEFAULT_BROKERS="kafka:9092"Note
If you on plan to run a proof-of-concept, there a development stack which will deploy a single replicas of each service mentioned above.
Run make dev/deploy to deploy the development stack.
The official Sentry Docker image is continuously updated as nightly. It is recommended to use a pinned version of Sentry Docker image for production deployment.
By default this stack will use the nightly image but it will not attempt to pull the image from the Docker Registry.
You can pull the image manually by running the following command:
# This will pull the latest nightly Sentry image.
$ make sentry/pull
# or
# This will pull both development stack images and Sentry images.
$ make dev/pullThere is not one-click installation for Sentry, but it's not hard to install either. You can install Sentry by following the steps below.
This stack is designed to be easy to understand and extend. It's not meant to be used in production, but it can be used as a starting point for your own production deployment.
You might need to create swarm-scoped overlay network called sentry for all the stacks to communicate if you haven't already.
On the manager node, run the following command:
$ docker network create --scope=swarm --driver overlay --attachable sentry
# or
$ makePlease peform the following stpes before continuing:
Generate a secret key for Sentry
$ docker run -it --rm getsentry/sentry:nightly config generate-secret-keyCopy the output of the above command and save it to SENTRY_SECRET_KEY in .env.
Generate a credentials for Relay
$ docker run -it --rm getsentry/relay:nightly credentials generate --stdout
# or
$ make relay/configsCopy the output json of the above command and save it to relay/configs/credentials.json.
Generate config files for sentry, symbolicator and relay
# This command also trigger `relay/configs` recipe.
$ make configsEdit .env file and set the following variables:
The following command will run database migrations and create topic for kafka using the Docker Swarm replicated-job deployment.
$ make migrationsNote
Please give it a few minutes for the database migrations to complete before continuing.
You can check the status of the job by running docker service logs -f <service> on the following services:
sentry_sentry_database-migration replicated job 0/1 (1/1 completed)
sentry_snuba_create-kafka-topics replicated job 0/1 (1/1 completed)
sentry_snuba_snuba-bootstrap replicated job 0/1 (1/1 completed)
sentry_snuba_snuba-migrations replicated job 0/1 (1/1 completed)
And run docker service ls to see if the jobs are still running or complated.
Run the following command to deploy Sentry and all necessary services:
$ make deployNote
The deployment will take a few minutes to complete. You can check the status of the deployment by running docker service ls to check the progress.
Run the following command to create an admin user:
$ make sentry/credentials