This add-on is operated by Honeybadger Industries LLC

Modern error management and monitoring for Ruby and Rails


Last Updated: 07 May 2015

Table of Contents

Honeybadger is an add-on for tracking and reporting on errors triggered by your applications.

Rather than getting an email every time a user trips the same error in your app (or worse, not even knowing when your users encounter an error), Honeybadger groups every error occurrence by the type of error encountered and notifies you only once per error. You’ll get an email (or a Campfire notice, or a text message) the first time the error occurs.

The goal of Honeybadger is to get your error notifications to you as quickly as possible, and show the error info to you as clearly as possible, so you can fix the problems in your app in no time and delight your customers.

Provisioning the add-on

Honeybadger can be attached to a Heroku application via the CLI:

A list of all plans available can be found here.

$ heroku addons:create honeybadger
-----> Adding honeybadger to sharp-mountain-4005... done, v18

Once Honeybadger has been added a HONEYBADGER_API_KEY setting will be available in the app configuration and will contain the api key that the gem uses to authenticate with the Honeybadger server.

$ heroku config | grep HONEYBADGER_API_KEY

After installing Honeybadger the application should be configured to fully integrate with the add-on.

Using with Rails 3.0+

Ruby on Rails applications will need to add the following entry into their Gemfile specifying the Honeybadger client library.

gem 'honeybadger'

Update application dependencies with bundler.

$ bundle install

That’s it. As long as the HONEYBADGER_API_KEY environment variable is present, Honeybadger should report data in production. Please note that by default Honeybadger does NOT report data in development and test environments.

Using with Sinatra

Using honeybadger in a Sinatra app is just like a Rails app:

# Always require sinatra first.
require 'sinatra'

# Then require honeybadger.
require 'honeybadger'

# Define your application code *after* sinatra *and* honeybadger:

get '/' do
  raise "Sinatra has left the building"

Using with Rack

In order to use honeybadger in a non-Rails rack app, just load honeybadger’s configuration and use the Honeybadger::Rack::ErrorNotifier middleware:

require 'rack'

# Load the gem
require 'honeybadger'

# Write your app
app = Rack::Builder.app do
  run lambda { |env| raise "Rack down" }

# Configure and start Honeybadger
honeybadger_config = Honeybadger::Config.new(env: ENV['RACK_ENV'])

# And use Honeybadger's rack middleware
use Honeybadger::Rack::ErrorNotifier, honeybadger_config
use Honeybadger::Rack::MetricsReporter, honeybadger_config

run app

Confirm configuration

Configuration of the add-on can be confirmed by running:

$ heroku run honeybadger test


For more information on the features available within the Honeybadger dashboard please see the Honeybadger docs.

The Honeybadger dashboard allows you to configure your notification preferences, including the email address that should be used for sending errors to you, configuration for other notification methods like Campfire, and so on. You can, of course, also use the dashboard to review the errors your app has generated and sent to Honeybadger.

The dashboard can be accessed via the CLI:

$ heroku addons:open honeybadger
Opening honeybadger for sharp-mountain-4005…

or by visiting the Heroku apps web interface and selecting the application in question. Select Honeybadger from the Add-ons menu.

Migrating between plans

Use the heroku addons:upgrade command to migrate to a new plan.

$ heroku addons:upgrade honeybadger:corporate
-----> Upgrading honeybadger:corporate to sharp-mountain-4005... done, v18 ($49/mo)
       Your plan has been updated to: honeybadger:corporate

Removing the add-on

Honeybadger can be removed via the CLI.

This will destroy all associated data and cannot be undone!

$ heroku addons:destroy honeybadger
-----> Removing honeybadger from sharp-mountain-4005... done, v20 (free)


All Honeybadger support requests should be sent to support@honeybadger.io.

Additional resources

Additional resources are available at: