Skip to content

The official Elixir SDK for Sentry (sentry.io)

License

Notifications You must be signed in to change notification settings

discord/sentry-elixir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sentry_elixir

Build Status hex.pm version

Sentry Client for Elixir which provides a simple API to capture exceptions, automatically handle Plug Exceptions and provides a backend for the Elixir Logger.

Getting Started

To use Sentry with your projects, edit your mix.exs file to add it as a dependency and add the :sentry_elixir package to your applications:

defp application do
 [applications: [:sentry_elixir, :logger]]
end

defp deps do
  [{:sentry_elixir, "..."}]
end

Setup the application environment in your config/prod.exs

config :sentry_elixir,
  dsn: "https://public:[email protected]/1",
  tags: %{
    env: "production"
  }

Capture Exceptions

Sentry.capture_exception(my_exception)

Setup with Plug or Phoenix

In your router add the following lines

use Plug.ErrorHandler
use Sentry.Plug

Use the Logger Backend.

Use this if you'd like to capture all Error messages that the Plug handler might not.

config :logger, backends: [:console, Sentry.Logger]

Configuration

Key Required Default
dsn True n/a
environment_name False MIX_ENV
included_environments False ~w(prod test dev)a
tags False %{}
release False None
server_name False None

About

The official Elixir SDK for Sentry (sentry.io)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Elixir 100.0%