This article describes how you can selectively disable instrumentation for particular controllers or actions within your application.
newrelic_ignore to prevent a controller from being instrumented:
In the controller class, add the following line to ignore all actions in that controller:
Add the following to ignore only the index action:
newrelic_ignore :only => [:index]
Add the following to ignore all actions on the controller except index:
newrelic_ignore :except => [:index]
newrelic_ignore prevents the agent from recording any performance data for that controller action, and will also prevent the action from contributing to the overall Apdex score measurement.
newrelic_ignore_apdex to prevent a controller from factoring into your Apdex score.
If you want to prevent all actions in a controller from contributing to the Apdex score but would still like to see performance data, use:
Add the following to only exclude the index action from Apdex:
newrelic_ignore_apdex :only => [:index]
Add the following to exclude all actions except index from Apdex:
newrelic_ignore_apdex :except => [:index]
newrelic_ignore_enduser prevents the agent from automatically inserting
real user monitoring data.
Server-side instrumentation will be unaffected.
To prevent real user monitoring for all actions in a controller, add a call like this to the controller class:
Add the following to only exclude real user monitoring on the index action:
newrelic_ignore_enduser :only => [:index]
Add the following to exclude real user monitoring on all actions except index:
newrelic_ignore_enduser :except => [:index]
newrelic_ignore* methods can be used in Sinatra applications as
well, though the usage is slightly different. See our
If you get a
NoMethodError when trying to use newrelic_ignore, try including the controller instrumentation to fix this error. In your controller:
If you still have problems, submit a support ticket (for fastest service) or email support @ New Relic. Also, you may be able to find support from the community at Stack Overflow. Tag your post with