You may want to temporarily disable an APM agent for the purposes of testing or troubleshooting. This document explains procedures for temporarily turning off the APM agent.
Related procedures:
- To permanently disable APM, uninstall the agent.
- To configure an agent to monitor some things but not others, use custom instrumentation.
Disable or turn off the APM agent
Select your agent type for instructions:
There are two main ways to disable the Go agent:
Remove the import of the
github.com/newrelic/go-agent
package from your application, and remove or comment out any calls to thenewrelic
namespace. Then, recompile and restart your app.Use the
enabled
configuration setting. Then, recompile and restart your app. (This will not reduce overhead because the instrumentation is still running; it will only prevent the sending of data to the New Relic collector.)팁
After you disable the agent, it may take several minutes for data to stop showing up.
There are three main ways to disable the Java agent:
Set
agent_enabled
tofalse
, then restart the JVM.Use the JVM command line flag:
-Dnewrelic.config.agent_enabled=falseThen restart the JVM.
Remove the
newrelic.jar
ornewrelic.yml
file, then restart the JVM.팁
After you disable the agent, it may take several minutes for data to stop showing up.
The method to disable the agent depends on if you are using Framework or Core:
.NET Framework: Set
agentEnabled
tofalse
in the globalnewrelic.config
file, found inC:\ProgramData\New Relic\.NET Agent\
. If the application is IIS-hosted, restart IIS. If it's self-hosted (non-IIS), restart the application..NET Core: Set
agentEnabled
tofalse
in thenewrelic.config
file found in the Core agent’s installation directory (for Windows alongsideNewRelic.Profiler.dll
and for Linux alongsideNewRelic.Profiler.so
). If you use the ASP.NET Core Module, reset IIS. Otherwise, restart your Core application.팁
After you disable the agent, it may take several minutes for data to stop showing up.
There are two main ways to disable the Node.js agent:
Set
agent_enabled
tofalse
in your agent config file, then restart the app server.Set the
NEW_RELIC_ENABLED
environment variable tofalse
.팁
After you disable the agent, it may take several minutes for data to stop showing up.
To disable the PHP agent, set the newrelic.enabled
config setting to false
, then restart the web server or PHP.
팁
After you disable the agent, it may take several minutes for data to stop showing up.
There are three main ways to disable the Python agent, depending on your preference and setup:
Standard install: Use the
monitor_mode
configuration setting. This can be done by editing the config file or by using an environment variable.Standard install with
newrelic-admin
script: Remove reference to that script in your application.Manual instrumentation: Remove the initialization script from your application.
팁
After you disable the agent, it may take several minutes for data to stop showing up.
There are several ways to disable the Ruby agent, depending on your preference and setup.
These methods will remove most instrumentation but there will still be a small amount of activity and overhead:
Use the
agent_enabled
configuration setting. This can be done in the configuration file or in the per-environment sections. Restart your app server afterward.Do the same via an environment variable, then restart the app server.
The following methods will remove all instrumentation and overhead:
Remove
newrelic_rpm
from the Gemfile and bundle install.Set the following in the Gemfile and bundle install:
gem 'newrelic_rpm', :require => falseThis option ensures the gem is installed if it's required somewhere in the app, but doesn't install it when bundling.
팁
After you disable the agent, it may take several minutes for data to stop showing up.