Skip to main content

New Relic Python Agent

Project description

The newrelic package instruments your application for performance monitoring and advanced performance analytics with New Relic.

Pinpoint and solve Python application performance issues down to the line of code. New Relic APM is the only tool you’ll need to see everything in your Python application, from the end user experience to server monitoring. Trace problems down to slow database queries, slow 3rd party APIs and web services, caching layers, and more. Monitor your app in a production environment and make sure your app can stand a big spike in traffic by running scalability reports.

Visit Python Application Performance Monitoring with New Relic to learn more.

Installation

$ pip install newrelic

Usage

(These instructions can also be found online: Python Agent Quick Start.)

  1. Generate the agent configuration file with your license key.

    $ newrelic-admin generate-config $YOUR_LICENSE_KEY newrelic.ini
  2. Validate the agent configuration and test the connection to our data collector service.

    $ newrelic-admin validate-config newrelic.ini
  3. Integrate the agent with your web application.

    If you control how your web application or WSGI server is started, the recommended way to integrate the agent is to use the newrelic-admin wrapper script. Modify the existing startup script, prefixing the existing startup command and options with newrelic-admin run-program.

    Also, set the NEW_RELIC_CONFIG_FILE environment variable to the name of the configuration file you created above:

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

    Examples:

    $ NEW_RELIC_CONFIG_FILE=newrelic.ini newrelic-admin run-program gunicorn -c config.py test_site.wsgi
    
    $ NEW_RELIC_CONFIG_FILE=newrelic.ini newrelic-admin run-program uwsgi uwsgi_config.ini

    Alternatively, you can also manually integrate the agent by adding the following lines at the very top of your python WSGI script file. (This is useful if you’re using mod_wsgi.)

    import newrelic.agent
    newrelic.agent.initialize('/path/to/newrelic.ini')
  4. Start or restart your Python web application or WSGI server.

  5. Done! Check your application in the New Relic UI to see the real time statistics generated from your application.

Resources

License

New Relic for Python is free-to-use, proprietary software. Please see the LICENSE file in the distribution for details on the New Relic License agreement and the licenses of its dependencies.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

newrelic-5.0.2.126.tar.gz (718.9 kB view details)

Uploaded Source

File details

Details for the file newrelic-5.0.2.126.tar.gz.

File metadata

  • Download URL: newrelic-5.0.2.126.tar.gz
  • Upload date:
  • Size: 718.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.9

File hashes

Hashes for newrelic-5.0.2.126.tar.gz
Algorithm Hash digest
SHA256 9d6d3bf2e125410d485fd91279e1b0f50e8f0f5887284b345aed4ec81db33c0a
MD5 35753aa4595f40b7da63f6f1a8a10767
BLAKE2b-256 31a7f5929d934c1049418952510543f733fd3d5c417d74cc401206dcbaba810e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page