Registry / observability / newrelic

newrelic

JSON →
library13.5.0pypypi✓ verified 26d ago

Official APM agent for Python applications. Auto-instruments web frameworks (FastAPI, Django, Flask), databases (SQLAlchemy, psycopg, asyncpg), Redis, external HTTP calls, and AI/LLM libraries. Current version is 11.4.0 (Jan 2026). v12.0.0 released March 2026 with breaking removals.

pip install newrelic
INSTALL
IMPORT
SIG · NEWRELIC
N
newrelic
observabilitypythonv13.5.0
Install
2.4s avg
Import
623ms
Disk
23MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v13.5.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.646s · 24.8MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 2.4s · import 0.600s · 25MB
23MB installed
● package 23MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

initialize
import newrelic.agent
from newrelic import initialize

Agent initialization patterns. CLI wrapper is preferred. Manual init requires initialize() before all other imports.

# Option 1: CLI wrapper (recommended — handles ordering automatically) # NEW_RELIC_CONFIG_FILE=newrelic.ini newrelic-admin run-program gunicorn myapp.wsgi # Option 2: Manual init — must be absolute first lines of entry point import newrelic.agent newrelic.agent.initialize('newrelic.ini') # Framework imports AFTER initialize() from fastapi import FastAPI app = FastAPI()
newrelic-admin --version
Debug
Known issues
breakinginitialize() must be called before ALL other imports. Placing it after framework or library imports silently disables instrumentation — no exception is raised, agent appears to load but instruments nothing.
fix
Use newrelic-admin run-program wrapper, or place initialize() as the first two lines of your entry point before any other import.
affects: all
breakingCross Application Tracing (CAT) fully removed in v12.0.0. Was deprecated since v7.0.0. Old tutorials and LLM-generated code using cross_application_tracer config keys will silently do nothing.
fix
Use Distributed Tracing (DT) instead. Remove cross_application_tracer settings from newrelic.ini.
affects: < 12.0.0
breakingPython 3.8 support dropped in v12.0.0 (Python 3.8 EOL was Oct 2024).
fix
Pin to newrelic<12.0.0 if still on Python 3.8, or upgrade Python.
affects: < 12.0.0
deprecatedaioredis instrumentation deprecated. The aioredis package itself is abandoned. New Relic will remove this instrumentation in a future release.
fix
Use redis>=4.2 with redis.asyncio submodule. New Relic auto-instruments redis.asyncio.
affects: all
deprecatedConfiguring agent via WSGI environ dictionary is deprecated.
fix
Use environment variables (NEW_RELIC_LICENSE_KEY, NEW_RELIC_APP_NAME, etc.) or newrelic.ini config file.
affects: all
gotchaSSL certificates no longer bundled in v12.0.0. Environments without system CA certs (minimal Docker images) will fail to connect to New Relic.
fix
pip install newrelic[certificates]
affects: >= 12.0.0
breakingNew Relic agent initialization failed because the specified configuration file (e.g., 'newrelic.ini') could not be found or was inaccessible.
fix
Ensure the configuration file is present in the current working directory, specified by an absolute path, or use environment variables for configuration (NEW_RELIC_LICENSE_KEY, NEW_RELIC_APP_NAME, etc.) or a newrelic.ini config file managed by the deployment.
affects: all
breakingCalling `newrelic.agent.initialize(config_file)` requires the specified configuration file to exist and be accessible at the provided path. If the file is not found or cannot be read, a `newrelic.api.exceptions.ConfigurationError` will be raised.
fix
Ensure the 'newrelic.ini' configuration file is present in the application's working directory, or provide its absolute path to `newrelic.agent.initialize()`.
affects: all
Upgrade
Version history
13.5.0latest on PyPI · released Aug 21, 2026
Audit
Dependencies
newrelic[certificates]optionalSSL certificates no longer bundled in v12.0.0. Required in environments without system certs.
Agent activity
20 hits · last 30 days
node
16
OpenAI (training)
2
Resources