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.
To configure an agent to monitor some things but not others, use custom instrumentation.
Disable the APM agent
Select your agent type for instructions:
The C SDK cannot be turned on or off directly. However, you can write your code for the SDK so that a quick recompile and deploy can enable or disable your instrumentation. Follow standard procedures to disable or uninstall the C SDK.
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 the newrelic 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.)
Tip
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:
Remove the newrelic.jar or newrelic.yml file, then restart the JVM.
Tip
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 to false in the global newrelic.config file, found in C:\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 to false in the newrelic.config file found in the Core agent’s installation directory (for Windows alongside NewRelic.Profiler.dll and for Linux alongside NewRelic.Profiler.so). If you use the ASP.NET Core Module, reset IIS. Otherwise, restart your Core application.
Tip
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 to false in your agent config file, then restart the app server.
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 stanzas. Restart your app server afterward.