This is a minimal, standalone example of instrumenting Resque with the New Relic Ruby agent.
- Save the
Gemfile
,test.rb
,newrelic.yml
files together in a directory. - Edit
newrelic.yml
and replace the 'YOUR_LICENSE_KEY_HERE' text with a valid New Relic license key. Alternatively you may use your own existingnewrelic.yml
file - just be sure to have:'audit_log.enabled'
set to true. - Run
bundle install
- Run
bundle exec ruby test.rb
- Inspect the newly created
log/newrelic_audit.log
file for Resque related content. For example:grep ResqueJob log/newrelic_audit.log
.
- If the audit log does not get created or does not contain Resque related content, check for
log/newrelic_agent.log
and see if contains anyERROR
orWARN
lines that might explain what happened - To run the Resque job without New Relic, simply comment out all 'NewRelic' lines within
test.rb