Install the New Relic Ruby agent on Heroku using the New Relic add-on.
Prerequisites
Requirement | Details |
|---|---|
New Relic account | A New Relic account is created automatically when you install the Heroku add-on. |
Heroku account | A Heroku account with your Ruby app already deployed. |
Ruby version | See Ruby agent requirements and supported frameworks for supported versions. |
Install the New Relic add-on
- Go to Heroku's Add-on page for New Relic and select a subscription plan.
- Under Select an app, select your app.
- Click Submit Order Form.
Run the following command, replacing $planlevel with the appropriate subscription plan:
$heroku addons:create newrelic:$planlevelInstalling the add-on automatically creates a New Relic account and configures access for Heroku hosts.
Configure the agent
Add the newrelic_rpm gem to your Gemfile:
gem 'newrelic_rpm'Set your app name using the Heroku toolbelt:
$heroku config:set NEW_RELIC_APP_NAME='Your Application Name'The license key is set automatically by the add-on. For all other configuration options, see Ruby agent configuration.
Verify data is flowing
Restart your dyno and generate some traffic to your app:
$heroku restartWait 2–3 minutes and open one.newrelic.com > APM to look for your app by name.
Tip
App not appearing? See No data appears (Ruby).
Related articles
- Ruby agent requirements and supported frameworks — Supported Ruby versions.
- Ruby agent configuration — All available configuration settings.
- Heroku add-on for New Relic — Subscription plans and pricing.