Deploy tracking

You can send a notification to Bugsnag when deploying a new version of your application to correlate releases with error rates.

Using Capistrano

If you use capistrano to deploy your apps, you can enable deploy tracking by adding the integration to your app’s Capfile:

require 'bugsnag/capistrano'

Provide an API key in config/deploy.rb:

set :bugsnag_api_key, 'api_key_here'

Using Heroku

You can easily add Bugsnag deploy tracking to your Heroku application by running the following command from your application’s directory:

$ bundle exec rake bugsnag:heroku:add_deploy_hook

If you have multiple Heroku apps, you can specify which app to add the hook for as with the HEROKU_APP environment variable:

$ bundle exec rake bugsnag:heroku:add_deploy_hook HEROKU_APP=my-app

Using Rake

You can run the following rake command from your deploy scripts.

rake bugsnag:deploy BUGSNAG_API_KEY=api-key-here BUGSNAG_RELEASE_STAGE=production BUGSNAG_REVISION=source-control-revision

The bugsnag rake tasks will be automatically available for Rails 3 or 4 apps, to make the rake tasks available in other apps, add the following to your Rakefile:

require 'bugsnag/tasks'


You can set the following environmental variables to override or specify additional deploy information:

Variable Description
BUGSNAG_API_KEY Your Bugsnag API key (required)
BUGSNAG_RELEASE_STAGE The release stage (eg, production, staging) currently being deployed.
BUGSNAG_REPOSITORY The repository from which you are deploying the code.
BUGSNAG_BRANCH The source control branch from which you are deploying the code.
BUGSNAG_REVISION The source control revision for the code you are currently deploying.
BUGSNAG_APP_VERSION The app version of the code you are currently deploying.

Using the API

If no preconfigured integration exists for your deployment configuration, the Deploy Tracking API can be integrated directly.