Sentry client for Elixir based on the new Erlang's logger. Requires Erlang 21.0 and Elixir 1.7 and later.
- Listen for events in logger (instead of deprecated error_logger and Logger);
- Uses reducers to handle formatted erlang reports, like for Ranch (you can use your own reducers);
- Custom HTTP client implementations via configuration (hackney by default);
-
Add
sparrrow
to your list of dependencies inmix.exs
:def deps do [ {:sparrow, "~> 1.0"} ] end
-
Add configuration to your app:
# config/config.exs config :sparrow, dsn: "your_sentry_dsn", # optional configuration server_name: "server_name", release: "1.14.3-rc.3", tags: %{ some: "of", your: "tags", }
After installation and configuration, Sparrow will catch the error reports in your app. But there are some insignificant (for most of us) features that are not documented yet, like custom reducers and HTTP client.
Every Logger.error
call captured too in Elixir 1.11.x and better, but you can disable this behaviour by providing sparrow: false
in metadata, like:
Logger.error("message", sparrow: false)
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request