PageRenderTime 43ms CodeModel.GetById 29ms RepoModel.GetById 0ms app.codeStats 0ms

Markdown | 102 lines | 60 code | 42 blank | 0 comment | 0 complexity | aa9b67db17807532bac4604e9e9275e3 MD5 | raw file
  1. # What is Sentry?
  2. Sentry is a realtime event logging and aggregation platform. It specializes in monitoring errors and extracting all the information needed to do a proper post-mortem without any of the hassle of the standard user feedback loop.
  3. > [](
  4. %%LOGO%%
  5. # How to use this image
  6. ## How to setup a full Sentry instance
  7. 1. Start a Redis container
  8. ```console
  9. $ docker run -d --name sentry-redis redis
  10. ```
  11. 2. Start a Postgres container
  12. ```console
  13. $ docker run -d --name sentry-postgres -e POSTGRES_PASSWORD=secret -e POSTGRES_USER=sentry postgres
  14. ```
  15. 3. Generate a new secret key to be shared by all `%%REPO%%` containers. This value will then be used as the `SENTRY_SECRET_KEY` environment variable.
  16. ```console
  17. $ docker run --rm sentry generate-secret-key
  18. ```
  19. 4. If this is a new database, you'll need to run `upgrade`
  20. ```console
  21. $ docker run -it --rm -e SENTRY_SECRET_KEY='<secret-key>' --link sentry-postgres:postgres --link sentry-redis:redis sentry upgrade
  22. ```
  23. **Note: the `-it` is important as the initial upgrade will prompt to create an initial user and will fail without it**
  24. 5. Now start up Sentry server
  25. ```console
  26. $ docker run -d --name my-sentry -e SENTRY_SECRET_KEY='<secret-key>' --link sentry-redis:redis --link sentry-postgres:postgres sentry
  27. ```
  28. 6. The default config needs a celery beat and celery workers, start as many workers as you need (each with a unique name)
  29. ```console
  30. $ docker run -d --name sentry-celery-beat -e SENTRY_SECRET_KEY='<secret-key>' --link sentry-postgres:postgres --link sentry-redis:redis sentry celery beat
  31. $ docker run -d --name sentry-celery1 -e SENTRY_SECRET_KEY='<secret-key>' --link sentry-postgres:postgres --link sentry-redis:redis sentry celery worker
  32. ```
  33. ### Port mapping
  34. If you'd like to be able to access the instance from the host without the container's IP, standard port mappings can be used. Just add `-p 8080:9000` to the `docker run` arguments and then access either `http://localhost:8080` or `http://host-ip:8080` in a browser.
  35. ## Configuring the initial user
  36. If you did not create a superuser during `upgrade`, use the following to create one:
  37. ```console
  38. $ docker run -it --rm -e SENTRY_SECRET_KEY='<secret-key>' --link sentry-redis:redis --link sentry-postgres:postgres sentry createuser
  39. ```
  40. ## Environment variables
  41. When you start the `%%REPO%%` image, you can adjust the configuration of the Sentry instance by passing one or more environment variables on the `docker run` command line. Please note that these environment variables are provided as a jump start, and it's highly recommended to either mount in your own config file or utilize the `%%REPO%%:onbuild` variant.
  43. A secret key used for cryptographic functions within Sentry. This key should be unique and consistent across all running instances. You can generate a new secret key doing something like:
  44. ```console
  45. $ docker run --rm sentry generate-secret-key
  46. ```
  48. Database credentials for your Postgres server. These values aren't needed if a linked `postgres` container exists.
  50. Connection information for your Redis server. These values aren't needed if a linked `redis` container exists.
  52. Connection information for a Memcache server. These values aren't needed if a linked `memcached` container exists.
  54. Directory where uploaded files will be stored. This defaults to `/var/lib/sentry/files` and is a `VOLUME` for persistent data.
  56. The email address used for `From:` in outbound emails. Default: `root@localhost`
  58. Connection information for an outbound smtp server. These values aren't needed if a linked `smtp` container exists.
  60. If you're using Mailgun for inbound mail, set your API key and configure a route to forward to `/api/hooks/mailgun/inbound/`.