Configuration is handled using the standard Elixir configuration.
Simply add configuration to the
:sentry key in the file
config :sentry, dsn: "https://public:firstname.lastname@example.org/1"
If using an environment with Plug or Phoenix add the following to your router:
use Plug.ErrorHandler use Sentry.Plug
The name of the environment, this defaults to the
The DSN provided by Sentry.
The list of environments you want to send reports to sentry, this defaults to
~w(prod test dev)a.
The default tags to send with each report.
The release to send to sentry with each report. This defaults to nothing.
The name of the server to send with each report. This defaults to nothing.
Set this to true if you want to capture all exceptions that occur even outside of a request cycle. This defaults to false.
Set this to a module that implements the
Sentry.EventFilterbehaviour if you would like to prevent certain exceptions from being sent. See below for further documentation.
Testing Your Configuration¶
To ensure you’ve set up your configuration correctly we recommend running the included mix task. It can be tested on different Mix environments and will tell you if it is not currently configured to send events in that environment:
$ MIX_ENV=dev mix sentry.send_test_event Client configuration: server: https://sentry.io/ public_key: public secret_key: secret included_environments: [:prod] current environment_name: :dev :dev is not in [:prod] so no test event will be sent $ MIX_ENV=prod mix sentry.send_test_event Client configuration: server: https://sentry.io/ public_key: public secret_key: secret included_environments: [:prod] current environment_name: :prod Sending test event!