New Relic's Python agent monitors your application to help you identify and solve performance issues. You can also extend the agent's performance monitoring to collect and analyze business data to help you improve the customer experience and to make data-driven business decisions. With flexible options for custom instrumentation and agent-specific APIs, New Relic's Python agent offers multiple building blocks to customize the data you need for your app.
The Python agent works with a wide variety of web frameworks and hosting mechanisms, including WSGI, CherryPy, FASTCGI, Gunicorn, uWSGI, and more. After you install the agent, you can examine everything from a visual overview of your app's performance, to code-level details such as transaction traces, thread profiler sessions, and x-ray sessions (which combine detailed trace data from selected metrics with the power of thread profiling).
Install the agent
- For supported WSGI servers and web frameworks, follow the Python agent quick start guide.
- For Heroku users, see Python agent and Heroku.
- If the quick start guide does not cover your web stack, or if you have special requirements for how the package needs to be installed, see the detailed Python agent installation instructions.
Download the agent
If you are logged in to New Relic, or if you have access to New Relic's Python agent repository, you can get the most recent Python agent package. To view information about the latest release and download it, see the Python agent release notes. You can also install the Python agent by using Python packaging tools such as pip, easy_install, distribute or buildout via the Python Package Index.
Configure the agent
The most important part of agent configuration is to provide your license key and to give your app a unique name. New Relic uses this app name to aggregate metrics when you have multiple apps or servers.
The agent includes a variety of configuration options to further customize and fine-tune your installation. After changing any agent configuration options, restart your web server.
Extend agent instrumentation
After installing the agent, go further and extend the agent's instrumentation as needed. For example:
|Custom instrumentation options||Description|
|Config file||Trace the time spent in additional functions or methods of classes simply by customizing the agent config file.|
|Python agent API||Create more complex calls or customize how a function is identified within the UI by making direct calls to the agent API in your code.|
|Page load timing||Integrate the Python agent with New Relic Browser to gain visibility into end-user activity through the full life cycle of the webpage.|
|Custom metrics||Record arbitrary metrics using APIs provided by the agent; for example, metrics related to the business functions implemented by your web application, additional metrics to evaluate your app's performance, etc.|
|Background tasks||Monitor job-based or task queuing systems.|
|Business data analysis with New Relic Insights||
Use the Python agent with Insights to organize, query, and visualize your data to answer key questions about application performance and customer experience.
Troubleshoot your installation
If your web application is receiving requests, data should appear in the New Relic APM UI within two to three minutes after installation.
- If no data appears, follow the troubleshooting steps.
- If you experience issues when installing or running the Python agent on a new host, test that the package is installed correctly and that it can contact New Relic's data collector service.
- If you encounter other problems, see the full list of troubleshooting documentation..
Monitor app performance
After you install and configure the Python agent, it begins to collect data about your app. You can view the data as charts and tables in New Relic's user interface.
- View the big picture of your app.
- Monitor your app's Apdex (user satisfaction).
- Get a high-level summary of your app with New Relic APM's user interface.
- Create architectural maps of your app and its connections and dependencies, including databases and external services.
- Install New Relic Servers for Linux and view detailed server data for your app.
- Find errors and problems quickly.
- Drill down into performance details.
For more help
Additional documentation resources include: