When your application breaks, you want to know why. It is often because of a code change in a recently deployed release. Rollbar makes it easy to see when new code has been shipped, and what code changed, with the Rollbar Deploy Tracking feature.
Here are the instructions to set up automatic Deploy Tracking for applications on Heroku.
In the Rollbar UI complete the following steps
- Select the Projects menu from the Rollbar left navigation menu
- Select your Rollbar Project from the list of Projects
- Choose the Project Access Tokens menu item
- Create an access token with the scope
- Log in to the Heroku CLI
- Add the Heroku webhook using the command below ,where ROLLBAR_POST_SERVER_TOKEN is the token created above, and ROLLBAR_ENV is the name of the environment as you want it to appear in Rollbar.
heroku webhooks:add -a YOUR_HEROKU_APPLICATION_NAME -i api:release -u 'https://api.rollbar.com/api/1/webhook/heroku?access_token=ROLLBAR_POST_SERVER_TOKEN&environment=ROLLBAR_ENV' -l notify
For further information on the heroku webhooks:add command options, type
heroku webhooks:add --help
- Log in to the Heroku UI and go to https://dashboard.heroku.com/apps
- Select the Pipeline with your app
- Select the app that you want to notify Rollbar about, when it is released.
- The app Overview screen will now be displayed
- Select the More/View webhooks dropdown option from the upper right of the screen
- Select Create Webhook
- For the Payload URL use the following URL, where ROLLBAR_POST_SERVER_TOKEN is the token created above, and ROLLBAR_ENV is the name of the environment as you want it to appear in Rollbar.
- Check the
- Confirm that your Rollbar Project has been onboarded, and that the Rollbar Project has received at least 1 item
- Make a minor change to your Heroku application
- Deploy the application. For example, from the Heroku CLI:
git push heroku master
- Within a few seconds of the build completing, you should see the deploy notification in the following locations in Rollbar:
Click on the left-hand Items menu
Select the deploy from the left-hand Deploys menu
Select the Timestamp link on either of the views above
Updated about 2 months ago