# newrelic

> New Relic Python Agent

- **URL**: https://www.freshcrate.ai/projects/newrelic
- **Author**: pypi
- **Category**: AI Agents
- **Latest version**: `v13.1.0` (2026-06-01)
- **License**: Apache-2.0
- **Source**: https://github.com/newrelic/newrelic-python-agent
- **Homepage**: https://pypi.org/project/newrelic/
- **Language**: Python
- **GitHub**: 207 stars, 133 forks
- **Registry**: pypi (`newrelic`)
- **Tags**: `pypi`

## Description

<a href="https://opensource.newrelic.com/oss-category/#community-project"><picture>
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/newrelic/opensource-website/raw/main/src/images/categories/dark/Community_Plus.png">
<source media="(prefers-color-scheme: light)" srcset="https://github.com/newrelic/opensource-website/raw/main/src/images/categories/Community_Plus.png">
<img alt="New Relic Open Source community project banner." src="https://github.com/newrelic/opensource-website/raw/main/src/images/categories/Community_Plus.png">
</picture></a>

# New Relic Python Agent

[![GitHub release](https://img.shields.io/github/v/release/newrelic/newrelic-python-agent?sort=semver)](https://github.com/newrelic/newrelic-python-agent/releases)
[![image](https://img.shields.io/pypi/v/newrelic.svg)](https://pypi.python.org/pypi/newrelic)
[![image](https://img.shields.io/pypi/pyversions/newrelic.svg)](https://pypi.python.org/pypi/newrelic)
[![PyPI Downloads](https://static.pepy.tech/personalized-badge/newrelic?period=total&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=Downloads)](https://pepy.tech/projects/newrelic)

[![Tests](https://github.com/newrelic/newrelic-python-agent/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/newrelic/newrelic-python-agent/actions/workflows/tests.yml)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![MegaLinter](https://github.com/newrelic/newrelic-python-agent/actions/workflows/mega-linter.yml/badge.svg?branch=main)](https://github.com/newrelic/newrelic-python-agent/actions/workflows/mega-linter.yml)
[![codecov](https://codecov.io/gh/newrelic/newrelic-python-agent/branch/main/graph/badge.svg)](https://codecov.io/gh/newrelic/newrelic-python-agent)
[![Secured with Trivy](https://img.shields.io/badge/Trivy-secured-green)](https://github.com/aquasecurity/trivy)

The `newrelic` package instruments your application for performance
monitoring and advanced performance analytics with [New
Relic](http://newrelic.com).

Pinpoint and solve Python application performance issues down to the
line of code. [New Relic
APM](http://newrelic.com/application-monitoring) 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](http://newrelic.com/python) to learn more.

## Usage

This package can be installed via pip:

```bash
pip install newrelic
```

(These instructions can also be found online: [Python Agent Installation Guide](https://docs.newrelic.com/install/python/).)

1. Generate the agent configuration file with your [license
    key](https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys/).

    ```bash
    newrelic-admin generate-config $YOUR_LICENSE_KEY newrelic.ini
    ```

2. Validate the agent configuration and test the connection to our data
    collector service.

    ```bash
    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](https://docs.newrelic.com/docs/agents/python-agent/installation-configuration/python-agent-integration#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:

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

    Examples:

    ```bash
    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](https://docs.newrelic.com/docs/agents/python-agent/installation-configuration/python-agent-integration#manual-integration)
    by adding the following lines at the very top of your python WSGI
    script file. (This is useful if you\'re using `mod_wsgi`.)

    ``` python
    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](https://rpm.newrelic.com) to see the real time statistics
    generated from your application.

Additional resources may be found here:

- [N

## Recent releases

| Version | Date | Urgency | Changes |
| --- | --- | --- | --- |
| `v13.1.0` | 2026-06-01 | High | ## Notes  This release of the Python agent adds support for multiple new [Redis](https://redis.io/docs/latest/commands/redis-8-8-commands) commands. fixes a bug in [LangGraph](https://pypi.org/project/langgraph) instrumentation, and improves handling and logging of harvest limit settings.  Install the agent using `easy_install/pip/distribute` via the [Python Package Index](https://pypi.python.org/pypi/newrelic), using `conda` via the [Conda-Forge Package Index](https://anaconda.org/conda-for |
| `v13.0.1` | 2026-05-21 | High | ## Notes  This release of the Python agent fixes a context propagation issue in [LangChain](https://pypi.org/project/langchain) and [LangGraph](https://pypi.org/project/langgraph), an [OpenAI](https://pypi.org/project/openai) chat completion recording issue, and an issue when using OpenAI(https://pypi.org/project/openai) streaming through LiteLLM as a proxy.  Install the agent using `easy_install/pip/distribute` via the [Python Package Index](https://pypi.python.org/pypi/newrelic), using `co |
| `v13.0.0` | 2026-05-12 | High | ## Notes  This release of the Python agent removes support for Python lambda function in the config file, excludes the `newrelic` header by default, adds support for exclude and include settings for Hybrid Agent traces, [anthropic](https://pypi.org/project/anthropic/) instrumentation, [gemini](https://pypi.org/project/google-genai/) response streaming, improves caching of IS_PYPY in `gc_data.py` for performance, and adds `http.statusCode` attribute in transaction events. This release also rese |
| `12.1.0` | 2026-04-21 | Low | Imported from PyPI (12.1.0) |
| `v12.1.0` | 2026-03-26 | Medium | ## Notes  This release of the Python agent adds support for time to first token and fixes an incompatible [Flask](https://pypi.org/project/Flask/) `add_url_rule` function signature.  Install the agent using `easy_install/pip/distribute` via the [Python Package Index](https://pypi.python.org/pypi/newrelic), using `conda` via the [Conda-Forge Package Index](https://anaconda.org/conda-forge/newrelic), or download it directly from the [New Relic download site](https://download.newrelic.com/pytho |
| `v12.1.0` | 2026-03-26 | Medium | ## Notes  This release of the Python agent adds support for time to first token and fixes an incompatible [Flask](https://pypi.org/project/Flask/) `add_url_rule` function signature.  Install the agent using `easy_install/pip/distribute` via the [Python Package Index](https://pypi.python.org/pypi/newrelic), using `conda` via the [Conda-Forge Package Index](https://anaconda.org/conda-forge/newrelic), or download it directly from the [New Relic download site](https://download.newrelic.com/pytho |
| `v12.1.0` | 2026-03-26 | Low | ## Notes  This release of the Python agent adds support for time to first token and fixes an incompatible [Flask](https://pypi.org/project/Flask/) `add_url_rule` function signature.  Install the agent using `easy_install/pip/distribute` via the [Python Package Index](https://pypi.python.org/pypi/newrelic), using `conda` via the [Conda-Forge Package Index](https://anaconda.org/conda-forge/newrelic), or download it directly from the [New Relic download site](https://download.newrelic.com/pytho |
| `v12.1.0` | 2026-03-26 | Low | ## Notes  This release of the Python agent adds support for time to first token and fixes an incompatible [Flask](https://pypi.org/project/Flask/) `add_url_rule` function signature.  Install the agent using `easy_install/pip/distribute` via the [Python Package Index](https://pypi.python.org/pypi/newrelic), using `conda` via the [Conda-Forge Package Index](https://anaconda.org/conda-forge/newrelic), or download it directly from the [New Relic download site](https://download.newrelic.com/pytho |
| `v12.1.0` | 2026-03-26 | Low | ## Notes  This release of the Python agent adds support for time to first token and fixes an incompatible [Flask](https://pypi.org/project/Flask/) `add_url_rule` function signature.  Install the agent using `easy_install/pip/distribute` via the [Python Package Index](https://pypi.python.org/pypi/newrelic), using `conda` via the [Conda-Forge Package Index](https://anaconda.org/conda-forge/newrelic), or download it directly from the [New Relic download site](https://download.newrelic.com/pytho |
| `v12.1.0` | 2026-03-26 | Low | ## Notes  This release of the Python agent adds support for time to first token and fixes an incompatible [Flask](https://pypi.org/project/Flask/) `add_url_rule` function signature.  Install the agent using `easy_install/pip/distribute` via the [Python Package Index](https://pypi.python.org/pypi/newrelic), using `conda` via the [Conda-Forge Package Index](https://anaconda.org/conda-forge/newrelic), or download it directly from the [New Relic download site](https://download.newrelic.com/pytho |

## Citation

- HTML: https://www.freshcrate.ai/projects/newrelic
- Markdown: https://www.freshcrate.ai/projects/newrelic.md
- Dependencies JSON: https://www.freshcrate.ai/api/projects/newrelic/deps

_Generated by freshcrate.ai. Indexes pypi releases for AI-agent ecosystem packages._
