{"id":13509423,"url":"https://github.com/fazibear/airbrakex","last_synced_at":"2025-04-07T13:08:14.290Z","repository":{"id":1223592,"uuid":"41876201","full_name":"fazibear/airbrakex","owner":"fazibear","description":"Elixir client for the Airbrake service.","archived":false,"fork":false,"pushed_at":"2023-11-15T21:30:59.000Z","size":112,"stargazers_count":27,"open_issues_count":6,"forks_count":47,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T11:06:40.422Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fazibear.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-09-03T18:19:24.000Z","updated_at":"2024-05-29T05:20:49.000Z","dependencies_parsed_at":"2024-01-05T21:59:27.426Z","dependency_job_id":"e27595b8-fbd9-4001-867f-47d3cf78aa70","html_url":"https://github.com/fazibear/airbrakex","commit_stats":{"total_commits":104,"total_committers":17,"mean_commits":6.117647058823529,"dds":0.3942307692307693,"last_synced_commit":"9678ce51322bd1f276dfb827fcf62717c9a76a44"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fazibear%2Fairbrakex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fazibear%2Fairbrakex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fazibear%2Fairbrakex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fazibear%2Fairbrakex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fazibear","download_url":"https://codeload.github.com/fazibear/airbrakex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247657281,"owners_count":20974345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T02:01:07.489Z","updated_at":"2025-04-07T13:08:14.267Z","avatar_url":"https://github.com/fazibear.png","language":"Elixir","funding_links":["https://www.patreon.com/bePatron?u=6912974"],"categories":["Third Party APIs","Errors logging"],"sub_categories":[],"readme":"# Airbrakex [![Package Version](https://img.shields.io/hexpm/v/airbrakex.svg)](https://hex.pm/packages/airbrakex) [![Code Climate](https://codeclimate.com/github/fazibear/airbrakex/badges/gpa.svg)](https://codeclimate.com/github/fazibear/airbrakex) [![Build Status](https://travis-ci.org/fazibear/airbrakex.svg?branch=master)](https://travis-ci.org/fazibear/airbrakex)\nElixir client for the [Airbrake](https://airbrake.io) service!\n\n## Installation\n\nAdd Airbrakex as a dependency to your `mix.exs` file:\n\n```elixir\ndefp deps do\n  [{:airbrakex, \"~\u003e 0.1.9\"}]\nend\n```\n\nIf on Elixir 1.3 or lower you will need to add it to your applications.\n\n```elixir\ndef application do\n  [applications: [:airbrakex]]\nend\n```\n\n\nThen run `mix deps.get` in your shell to fetch the dependencies.\n\n### Configuration\n\nIt requires `project_key` and `project` parameters to be set\nin your application environment, usually defined in your `config/config.exs`.\n`logger_level` and `environment` are optional.\n\n```elixir\nconfig :airbrakex,\n  project_key: \"abcdef12345\",\n  project_id: 123456,\n  logger_level: :error,\n  environment: Mix.env\n```\n\n#### Advanced Configuration\n\nIf you want to use errbit instance, set custom url as `endpoint`.\nIf you connect through a proxy or need to pass other specific options to\n`HTTPoison` you can use `http_options`, see https://hexdocs.pm/httpoison/HTTPoison.html#request/5\nfor a list of the available options.\n\n```elixir\nconfig :airbrakex,\n  project_key: \"abcdef12345\",\n  project_id: 123456,\n  endpoint: \"http://errbit.yourdomain.com\",\n  http_options: [ssl: [cacertfile: \"/path/to/certfile.pem\"]]\n```\n\n## Usage\n\n```elixir\ntry do\n  IO.inspect(\"test\",[],\"\")\nrescue\n  exception -\u003e Airbrakex.notify(exception)\nend\n```\n\n### Logger Backend\n\nThere is a Logger backend to send logs to the Airbrake,\nwhich could be configured as follows:\n\n```elixir\nconfig :logger,\n  backends: [:console, Airbrakex.LoggerBackend]\n```\n\n### Plug\n\nYou can plug `Airbrakex.Plug` in your web application Plug stack to send all exception to Airbrake\n\n```elixir\ndefmodule YourApp.Router do\n  use Phoenix.Router\n  use Airbrakex.Plug\n\n  # ...\nend\n```\n\n### Ignore\n\nYou can ignore certain types of errors by specifying a global `:ignore` as well as an `:ignore_backend` config key:\n\n#### Global ignore\n\nThis will prevent errors from being sent from the notifier to Airbrake\n\n```elixir\nconfig :airbrakex,\n  ...\n  # List form\n  ignore: [Phoenix.Router.NoRouteError]\n  # OR\n  # Function\n  ignore: fn(error) -\u003e\n    cond do\n      error.type == Phoenix.Router.NoRouteError -\u003e true\n      String.contains?(error.message, \"Ecto.NoResultsError\") -\u003e true\n      true -\u003e false\n    end\n  end\n```\n\n#### Ignore Backend\n\nThis is only needed if you are using the [Logger Backend](#logger-backend).\n\n`:ignore_backend` prevents logs from being sent from the backend to the notifier. For example, it can be used to prevent errors that are already being logged by the plug from double logging.\n\n```elixir\nconfig :airbrakex,\n  ...\n  # Function\n  ignore_backend: fn(log) -\u003e\n    cond do\n      {_, message, _, _} = log -\u003e\n        Enum.at(message, 2) == \"MyApp.Endpoint\"\n      true -\u003e false\n    end\n  end\n```\n\n\n## Thankx\n - [Airbrake Elixir](https://github.com/romul/airbrake-elixir)\n - [AirbrakePlug](https://github.com/romul/airbrake_plug)\n - [Rollbax](https://github.com/elixir-addicts/rollbax)\n\n## Thank you!\n\n[![Become Patreon](https://c5.patreon.com/external/logo/become_a_patron_button.png)](https://www.patreon.com/bePatron?u=6912974)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffazibear%2Fairbrakex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffazibear%2Fairbrakex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffazibear%2Fairbrakex/lists"}