This 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
page load timing data.
Server-side instrumentation will be unaffected.
To prevent page load timing (sometimes referred to as real user monitoring or RUM) for all actions in a controller, add a call like this to the controller class:
Add the following to only exclude page load timing on the index action:
newrelic_ignore_enduser :only => [:index]
Add the following to exclude page load timing 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:
Additional documentation resources include Apdex: measuring user satisfaction (how Apdex is calculated).
If you need additional help, get support at support.newrelic.com.