Airbrake Integration

Airbrake  is an error and exception tracking service. Airbrake provides detailed reports and alerts for many programming languages. By forwarding Airbrake alerts to OpsGenie, you can notify users via iPhone and Android push notifications, email, SMS, and phone calls, track of the alert life cycle, escalate alerts, etc.

What does OpsGenie offer Airbrake users?

By using OpsGenie’s Airbrake Integration: you can forward Airbrake incidents to OpsGenie. OpsGenie can determine the right people to notify based on on-call schedules, using email, text messages (SMS), phone calls, iOS & Android push notifications, and escalating alerts until the alert is acknowledged or closed.


Functionality of the integration

  • When an error is captured in Airbrake, it creates an alert in OpsGenie.

Add Airbrake Integration in OpsGenie

  1. Please create an OpsGenie account if you haven't done so already.
  2. Go to OpsGenie's Airbrake Integration page.
  3. Specify who should be notified for Airbrake alerts using the "Teams" field. Autocomplete suggestions will be provided as you type.
  4. Copy the integration URL by clicking on the copy button or selecting. URL includes OpsGenie endpoint as well as the API key.
  5. Click on "Save Integration"

Configuration in Airbrake

  1. In Airbrake, go to "Integrations" from your project's page.
  2. Select "Webhook".
  3. Populate the webhook Url field with the integration URL you copied when saving integration.
  4. Click "Save".
  5. Alert properties can be configured from Airbrake Integration / Advanced Settings page.
  6. ​All set! You can now manage your Airbrake alerts at OpsGenie and leverage its full alerting functionality:

Sample Webhook Message from OpsGenie Airbrake

{
  "error": {
    "id": 37463546,
    "error_message": "RuntimeError: You threw an exception for testing",
    "error_class": "RuntimeError",
    "file": "[PROJECT_ROOT]/app/controllers/pages_controller.rb",
    "line_number": 35,
    "project": {
      "id": 1055,
      "name": "AirbrakeProject"
    },
    "last_notice": {
      "id": 4505303522,
      "request_method": "metot",
      "request_url": "http://airbrake.io:445/pages/exception_test",
      "backtrace": [
        "[PROJECT_ROOT]/app/controllers/pages_controller.rb:35:in `exception_tester'",
        "[PROJECT_ROOT]/app/middleware/conditional_heroku_nav.rb:19:in `_call'",
        "[PROJECT_ROOT]/app/middleware/conditional_heroku_nav.rb:11:in `call_without_newrelic'"
      ]
    },
    "environment": "production",
    "first_occurred_at": "2012-02-23T22:03:03Z",
    "last_occurred_at": "2012-03-21T08:37:15Z",
    "times_occurred": 118
  }
}

This payload is parsed by OpsGenie as:

{
  "error_id": 37463546,
  "error_message": "RuntimeError: You threw an exception for testing",
  "file": "[PROJECT_ROOT]/app/controllers/pages_controller.rb",
  "line_number": 35,
  "project_id": 1055,
  "project_name": "AirbrakeProject",
  "environment": "production",
  "first_occurred_at": "2012-02-23T22:03:03Z",
  "last_occurred_at": "2012-03-21T08:37:15Z",
  "times_occurred": 118,
  "last_notice_request_method": "metot",
  "last_notice_request_url": "http://airbrake.io:445/pages/exception_test",
  "last_notice_backtrace": [
    "[PROJECT_ROOT]/app/controllers/pages_controller.rb:35:in `exception_tester'",
    "[PROJECT_ROOT]/app/middleware/conditional_heroku_nav.rb:19:in `_call'",
    "[PROJECT_ROOT]/app/middleware/conditional_heroku_nav.rb:11:in `call_without_newrelic'"
  ]
}

Sample alert