ProductPromotion
Logo

Elixir

made by https://0x3d.site

GitHub - romul/airbrake-elixir: An Elixir notifier to the Airbrake/Errbit. System-wide error reporting enriched with the information from Plug and Phoenix channels.
An Elixir notifier to the Airbrake/Errbit.  System-wide error reporting enriched with the information from Plug and Phoenix channels. - romul/airbrake-elixir
Visit Site

GitHub - romul/airbrake-elixir: An Elixir notifier to the Airbrake/Errbit.  System-wide error reporting enriched with the information from Plug and Phoenix channels.

GitHub - romul/airbrake-elixir: An Elixir notifier to the Airbrake/Errbit. System-wide error reporting enriched with the information from Plug and Phoenix channels.

Airbrake Elixir

Build Status Hex Version

Capture exceptions and send them to the Airbrake or to your Errbit installation!

Installation

# 1. Add :airbrake to applications list in your projects mix.exs

# 2. Add it to your deps in your projects mix.exs
defp deps do
  [
    {:airbrake, "~> 0.6"},
    {:httpoison, "~> 1.0"} # if you use Elixir 1.8+
  ]
end

# 3. Open up your config/config.exs (or appropriate project config)
config :airbrake,
  api_key: System.get_env("AIRBRAKE_API_KEY"),
  project_id: System.get_env("AIRBRAKE_PROJECT_ID"),
  environment: Mix.env,
  host: "https://airbrake.io" # or your Errbit host

config :logger,
  backends: [{Airbrake.LoggerBackend, :error}, :console]

General usage

With Phoenix:

defmodule YourApp.Router do
  use Phoenix.Router
  use Airbrake.Plug # <- put this line to your router.ex

  # ...
end
  def channel do
    quote do
      use Phoenix.Channel
      use Airbrake.Channel # <- put this line to your web.ex
      # ...

Ignore some exceptions

To ignore some exceptions use :ignore key in config:

config :airbrake,
  ignore: MapSet.new(["Custom.Error"])

# or

config :airbrake,
  ignore: fn(type, message) ->
    type == "Custom.Error" && String.contains?(message, "silent error")
  end

# or

config :airbrake,
  ignore: :all # to disable reporting

Shared options for reporting data to Airbrake

To include with every report to Airbrake a set of optional data, include the :options key in the config. This can either be a keyword list of options or a function that returns a keyword list of options. Keyword list keys that can be used are :context, :params, :session, and :env.

Options function in config

A function for creating options for reporting should be declared in the config as a tuple of {ModuleName, :function_name, 1}. This function should take as an argument a keyword list, possibly empty and should return a keyword list. The function arity is always 1.

config :airbrake,
  options: {Web, :airbrake_options, 1}

Options keyword list in config

When options are provided as a keyword list in the configuration and a specific call to Airbrake.report/2 includes options in its parameters, the options will be merged, with the parameters taking precedence.

config :airbrake,
  options: [env: %{"SOME_ENVIRONMENT_VARIABLE" => "environment variable"}]

Custom usage examples

# Report an exception.
try do
  String.upcase(nil)
rescue
  exception -> Airbrake.report(exception)
end

With GenServer:

defmodule MyServer do
  # use Airbrake.GenServer instead of GenServer
  use Airbrake.GenServer
  # ...
end

With any process:

  Airbrake.monitor(pid)
  # or
  Airbrake.monitor(Registered.Process.Name)
  # or with spawn
  spawn(fn -> 
    :timer.sleep(500)
    String.upcase(nil)
  end) |> Airbrake.monitor

Articles
to learn more about the elixir concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here 🔥.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here 🔥.

Queries
or most google FAQ's about Elixir.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory