If you do not see data with Unicorn, follow these procedures based on your New Relic Ruby agent version.
Solution
If you are using Ruby agent version 3.8.0 or higher, you should not need to do any additional configuration. If you're using a supported web framework, the agent should work out of the box regardless of your Unicorn configuration.
If you are using a Ruby agent version prior to 3.8.0 with Unicorn, you will need to do one of the following in order to get data reporting:
As noted above, versions 3.8.0 or higher of the newrelic_rpm gem should automatically work correctly regardless of your unicorn configuration.
Use the preload_app true directive in your Unicorn configuration file. For more information, refer to the Unicorn documentation for this configuration setting. You must ensure that Unicorn sees your configuration file by specifying the -c <path> option to your unicorn invocation (Heroku users: This will be in your Procfile).
Tip
The directive is preload_app true, not preload_app = true. The form with the equals sign will fail silently.
If you do not want to use preload_app true, you can manually call the New Relic Ruby agent's handler for forking web servers from an initializer file in config/initializers:
# Ensure the agent is started using Unicorn.
# This is needed when using Unicorn and preload_app is not set to true.
# See https://docs.newrelic.com/docs/ruby/no-data-with-unicorn
In order for your changes to take effect, do a "clean" restart (full stop and start). Doing a normal Unicorn restart with SIGUSR2 may not properly initialize the gem.