• Log inStart now

Standard Python agent install

Our Python agent auto-instruments your code so you can start monitoring applications. You can use our launcher, or follow the instructions in this document to complete a basic Python agent installation for our supported frameworks.

Add Python data

Standard installation

These instructions are for applications on frameworks that the Python agent automatically instruments.

  • If you want to monitor non-web Python scripts, custom background tasks, or an application on a non-auto-instrumented framework, see our documentation about monitoring non-web scripts or functions.
  • If you are using Docker, install the agent within each container.

To install the New Relic Python agent for an application on an auto-instrumented framework:

  1. If you haven't already, create a New Relic account. It's free, forever.

  2. Make sure you have your New Relic license key. (If you don't yet have a New Relic account, sign up to get one.)

  3. Install the newrelic Python package using pip by running:

    pip install newrelic
  4. Generate the agent configuration file by running the command:

    newrelic-admin generate-config YOUR_LICENSE_KEY newrelic.ini
  5. If you control how your web application or WSGI server is started, use the following New Relic admin script command in front of your usual startup command options:

    NEW_RELIC_CONFIG_FILE=newrelic.ini newrelic-admin run-program YOUR_COMMAND_OPTIONS

    If you cannot run the admin script in this way, please read the advanced install instructions for more context and other install options.

  6. Start or restart your Python web application or WSGI server. Wait five minutes, then go to the New Relic UI to view your data.

For more detailed installation procedures and helpful context, see Python agent installation.

While you wait for your data to come in...

Did this doc help you install?

View logs for your APM and infrastructure data

You can also bring your logs and application's data together to make troubleshooting easier and faster. With logs in context, you can see log messages related to your errors and traces directly in your app's UI. You can also see logs in context of your infrastructure data, such as Kubernetes clusters. No need to switch to another UI page.

Other options

If you cannot use the standard install, or if you want more details and context for the install procedures, see our advanced installation documentation.

You can also install the Python agent in the following:

For more information, see Compatibility and requirements.

Copyright © 2022 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.