Python agent API overview

The New Relic Python agent provides an API for controlling, customizing, and extending its functionality. If you are able to use the standard install process and run the New Relic admin script via the command line, you will have out-of-the-box monitoring and may never have a need to use the Python agent API.

You will, however, need the APIs if you want to do one of the following:

  • Manually instrument a non-supported framework/setup or third-party system
  • Add additional custom instrumentation to supplement the out-of-the-box instrumentation

If your goal is custom instrumentation, be aware you can add instrumentation by adding functions and class methods to your New Relic config file. That method doesn't require touching your application code, but is not as robust or powerful as the API.

All publicly available API calls can be found in the newrelic.agent Python module. The APIs are grouped into approximate categories based on their functionality. APIs include:

For more help

Join the discussion about Python in the New Relic Online Technical Community! The Technical Community is a public platform to discuss and troubleshoot your New Relic toolset.

If you need additional help, get support at