Syntax
NewRelic.Api.Agent.NewRelic.StartAgent()
Start the agent if it hasn't already started. Usually unnecessary.
Requirements
Agent version 5.0.136.0 or higher.
Compatible with all app types.
Description
Starts the agent if it hasn't already been started. This call is usually unnecessary, since the agent starts automatically when it hits an instrumented method unless you disable autoStart
. If you use SetApplicationName()
, ensure you set the app name before you start the agent.
Tip
This method starts the agent asynchronously (that is, it won't block app startup) unless you enable syncStartup
or sendDataOnExit
.
Examples
NewRelic.Api.Agent.NewRelic.StartAgent();
For more help
If you need more help, check out these support and learning resources:
- Browse the Explorers Hub to get help from the community and join in discussions.
- Find answers on our sites and learn how to use our support portal.
- Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS.
- Review New Relic's and and documentation.