Sentry is an exception monitoring service written in Python and has an SDK that supports many languages.

Here’s the official deployment documentation and compose file: github.com/getsentry/o…

When sentry is currently deployed (2019/06/20), the document is at the commit location github.com/getsentry/o…

Although the first choice for each deployment of a service is to look at the official and community-star compose file, their compose file should also be taken a quick look

Shanyue. tech/ Post/Sentry…

Although this article covers Sentry deployment, it recommends the Saas version, which is less operational and has more features

Requirements

  • The Docker 1.10.0 +
  • Compose 1.17.0 + (optional)
  • Minimum 3 GIGABytes of ram (this is the official requirement, as tested below, around 600MB)

Reverse proxy (optional)

Because I’m usingtraefikAs a direction proxy, modify directlydocker-compose.ymlTo addlabelAnd hides the port mapping

You will need to replace sentry.hostname.com with the domain you will be setting

web:
  < < : *defaults
  expose:
    - 9000
  labels:
    - "traefik.frontend.rule=Host:sentry.hostname.com"
Copy the code

If nginx is used as the reverse proxy, set proxy-pass.

The deployment of

Here’s the official deployment documentation and compose file: github.com/getsentry/o… Here are my deployment orders

#Before installing, take a look at memory usage
$ free -hTotal Used Free shared buff/ Cache available Mem: 3.7G 1.0g 204M 140M 2.5g 2.2g Swap: 0B 0B 0B
$ git clone [email protected]:getsentry/onpremise.git
$ cd onpremise

#Create a name volume to facilitate persistence. In fact, the directory specified during mounting is the same.
$ docker volume create --name=sentry-data && docker volume create --name=sentry-postgres
sentry-data
sentry-postgres

#'-n' stands for not overwriting files, which can be understood as the 'setnx' command of 'redis'
$ cp -n .env.example .env

#Generate the key and place it in the.env file
$ docker-compose run --rm web config generate-secret-key

#Generate the database and set up the superuser in this step
$ docker-compose run --rm web upgrade

#Start the service
$ docker-compose up -d

#If traefik is not set, the PORTS column will map the port number to Host
$ docker psCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 0ACC4DEDF59f onpremise_web "/ entryPoint.sh run..." 4 seconds ago Up 3 seconds 9000/ TCP onpremise_web_1 8EEbadc9e2ff onpremise_worker "/entrypoint.sh run..." 2 minutes ago Up 2 minutes 9000/ TCP onpremise_worker_1 9cce91ae40d3 onpremise_cron "/entrypoint.sh run..." 2 minutes ago Up 2 minutes 9000/tcp onpremise_cron_1
#Check the Host memory consumption, compared to about 600MB at the beginning
$ free -hTotal Used Free shared buff/ Cache available Mem: 3.7G 1.6G 1.0G 165M 1.1g 1.6G Swap: 0B 0B 0B
#Looking at sentry's memory consumption alone, it adds up to about 600MB, which is consistent with the data just shown
$ docker stats | head -7CONTAINER ID NAME CPU % MEM USAGE/LIMIT MEM % NET I/O BLOCK I/O PIDS 0ACC4DEDF59f onPremise_web_1 0.00% 331MiB / 3.702GiB 8.73% 328kB / 4.99MB 7.68MB / 0B 19 8EEBADC9e2FF onpremise_WORKer_1 0.00% 138.3MiB / 3.702GiB 3.65% 2.69MB / 9.54MB 34.5MB / 0B 7 9cce91ae40d3 onpremise_cron_1 0.00% 97.52MiB / 3.702GiB 2.57% 869kB / 1.24MB 37.8MB / 156kB 3 01788eEF014f onPremise_memcacheD_1 0.00% 8.871MiB / 3.702GiB 0.23% 261kB / 154kB 11.2MB / 0B 10 66a27F681AF3 Onpremise_postgres_1 0.00% 5.297MiB / 3.702GiB 0.14% 1.94MB / 1.45MB 83MB / 96.8MB 8 645FD1e25D78 onpremise_SMTP_1 0.00% 800KiB / 3.702GiB 0.02% 672B / 0B 5.27MB / 57.3KB 2Copy the code

The 15-minute memory usage chart shows a spike after deployment and then flattens out.

The reverse proxy domain name sentry.hostname.com is displayed


Welcome to pay attention to my public number shanyuexixing, here records my technical growth, welcome to exchange