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-agentpackage from your application, and remove or comment out any calls to thenewrelicnamespace. Then, recompile and restart your app.Use the
enabledconfiguration 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.)Sugerencia
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_enabledtofalse, then restart the JVM.Use the JVM command line flag:
-Dnewrelic.config.agent_enabled=falseThen restart the JVM.
Remove the
newrelic.jarornewrelic.ymlfile, then restart the JVM.Sugerencia
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
agentEnabledtofalsein the globalnewrelic.configfile, 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
agentEnabledtofalsein thenewrelic.configfile found in the Core agent’s installation directory (for Windows alongsideNewRelic.Profiler.dlland for Linux alongsideNewRelic.Profiler.so). If you use the ASP.NET Core Module, reset IIS. Otherwise, restart your Core application.Sugerencia
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_enabledtofalsein your agent config file, then restart the app server.Set the
NEW_RELIC_ENABLEDenvironment variable tofalse.Sugerencia
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.
Sugerencia
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_modeconfiguration setting. This can be done by editing the config file or by using an environment variable.Standard install with
newrelic-adminscript: Remove reference to that script in your application.Manual instrumentation: Remove the initialization script from your application.
Sugerencia
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_enabledconfiguration 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_rpmfrom 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.
Sugerencia
After you disable the agent, it may take several minutes for data to stop showing up.