Rack

Installing Airbrake in a Rack application

Features

  • Simple to install and configure
  • Automatic reporting of unhandled exceptions
  • Ignore specific errors and filter out sensitive information
  • Append information from Rack requests

View the full list of features on GitHub.

Install with bundler

Add the Airbrake Ruby gem to your Gemfile and run bundle install:

gem 'airbrake'

Manual installation

Invoke the following command from your terminal:

gem install airbrake

Configuration

To send exceptions to Airbrake from any Rack application, simply use our Rack middleware, and configure with your PROJECT ID and PROJECT API KEY available from your project’s settings page.

require 'airbrake'

Airbrake.configure do |c|
  c.project_id = '<Your PROJECT ID>'
  c.project_key = '<Your PROJECT API KEY>'
end

use Airbrake::Rack::Middleware

Note: be aware that by default the library doesn’t filter any parameters, including user passwords. To filter out passwords add a filter.

Going further

For advanced configuration options like ignoring errors with add_filter, appending info from Rack requests, configuring multiple notifiers for subprojects, and more please visit the airbrake-ruby and airbrake GitHub repos.