Honeybadger has great built-in support for heroku, including automated deployment tracking and monitoring of heroku platform errors.

There are two ways to use Honeybadger with heroku: via our heroku add-on, and via a regular Honeybadger account. Each has its own unique strengths.

  • Heroku Add-On: When you purchase the Honeybadger add-on through the Heroku marketplace, you're buying access for a single project and a single user. If this is all you need, the heroku add-on can be super convenient. But if you have several users managing errors for multiple projects, it can be a hassle...not to mention more expensive.
  • "Regular" Honeybadger Account: If you've signed up for a Honeybadger account via our website, good news! You still have access to all our Heroku-related features. We'll cover how to set that up below. You'll also get a plan that allows multiple projects and multiple users.

Converting Heroku Accounts

If you are currently a heroku add-on customer and would like to switch to a "regular" account, or if you'd like to convert your regular account to an add-on account, we can do that. Just email us at support@honeybadger.io.

Heroku Deployment Tracking

If you're a heroku add-on customer, deployment tracking was probably set up automatically for you. You can check by running heroku add-ons:info deployhooks and looking for one pointing at honeybadger.io.

With deployment tracking, Honeybadger is notified when you deploy your app. It's optional, but enabling it lets you do some really cool things, like:

  • Send alerts to Slack whenever your project is deployed.
  • Automatically resolve errors on deployment, so that any new occurrences after deployment will send you a new notification.
  • See which errors occurred after which deployments.

It's super easy to set up deployment tracking for your heroku apps. Just run the following command, making sure to add your Honeybadger api key at the end:

$ heroku addons:create deployhooks:http --url="https://api.honeybadger.io/v1/deploys?deploy[local_username]={{user}}&deploy[revision]={{head}}&deploy[repository]=git@github.com/username/projectname&deploy[environment]=production&api_key=asdf" --app app-name

If you're using our Ruby gem, you can use the honeybadger command line tool to do the same thing:

bundle exec honeybadger heroku install_deploy_notification

Heroku Platform Errors

If you're a heroku add-on customer, platform error monitoring may already be set up. To check, run heroku drains -a APP_NAME and see if it mentions Honeybadger or "logplex.honeybadger.io". If it does, you don't need to set anything else up.

Normally, Honeybadger only sees errors that happen inside your application. On heroku, we're able to go one step farther and monitor platform errors. These include the dreaded H12 timeouts and R99 errors you may have seen in your heroku logs.

To capture these errors we use heroku's log drain feature. Each line of your logs is sent to our servers in the background. We pull out the errors and throw everything else away.

To add the log drain, run the following command, replacing API_KEY with your Honeybadger project's secret token and APP_NAME with the name of your Heroku app:

heroku drains:add https://logplex.honeybadger.io/heroku/v1?api_key=API_KEY -a APP_NAME