pypi newrelic 13.5.0
v13.5.0

one hour ago

Notes

This release of the Python agent adds support for Azure CosmosDB, adds instrumentation for HTTPX2 and new LangChain/LangGraph streaming events APIs, adds support for newer OpenTelemetry database semantic conventions, and resolves several issues including incomplete package reporting, a package lookup performance penalty, and a MySQL database name reporting bug.

Install the agent using easy_install/pip/distribute via the Python Package Index, using conda via the Conda-Forge Package Index, or download it directly from the New Relic download site.

New features

  • Added support for Azure CosmosDB

    • The Python agent now instruments Azure Cosmos DB client operations, reporting datastore metrics and traces for database, container, and user operations performed through the azure-cosmos SDK.
  • Added support for HTTPX2

    • The Python agent now supports HTTPX2, a fork of HTTPX actively maintained by the Pydantic team. External call instrumentation for HTTPX2 mirrors the agent's existing HTTPX support for both synchronous and asynchronous clients.
  • Added LangChain/LangGraph streaming events instrumentation

    • Added astream_events instrumentation support for LangChain agents.
    • Added stream_events/astream_events instrumentation for LangChain/LangGraph v3, covering iteration over GraphRunStream objects.
  • Added support for newer OpenTelemetry database semantic conventions

    • When running the Python agent alongside OpenTelemetry (Hybrid Agent mode), the agent now reads both the legacy and newer OpenTelemetry database span attribute names (db.name/db.namespace, db.statement/db.query.text, db.mongodb.collection/db.collection.name), so database tracing continues to work correctly regardless of which semantic convention version the OpenTelemetry instrumentation library emits.

Bugs

  • Fixed incomplete package reporting to New Relic

    • Previously, the Python agent could omit some installed packages from the Environment data reported to New Relic if module discovery took longer than the fixed time window allotted during the slow harvest cycle, and the package list wasn't refreshed after an agent restart. Package capture now runs during the fast harvest cycle and is fully re-captured on agent shutdown/restart, so the reported package list is complete.
  • Reduced overhead of package version lookups

    • Previously, looking up installed package versions rescanned the filesystem for every package on every lookup, incurring an O(n^2) time penalty that scaled with the number of installed packages during agent initialization. The result of importlib.metadata.packages_distributions() is now cached after the first lookup to avoid this overhead.
  • Fixed get_linking_metadata to properly pass through the specified application

    • Previously, calling newrelic.agent.get_linking_metadata(application=...) ignored the application argument and always returned linking metadata for the default application. This affected processes reporting to more than one application. The specified application is now correctly passed through.
    • Thank you ckarnell for the contribution!
  • Fixed MySQL database name reporting when using the database keyword argument

    • Previously, the agent only checked the legacy db keyword argument when parsing the database name from mysql-connector-python connection arguments, so connections made using the modern database keyword argument reported no database name in datastore metrics. The agent now checks database first, falling back to db.
  • Fixed warning when accessing LangGraph v1.1+ GraphOutput values

    • Previously, LangGraph v1.1+ instrumentation accessed GraphOutput return values using deprecated item-access syntax, triggering a deprecation warning. The agent now reads GraphOutput.value directly.

Support statement

We recommend updating to the latest agent version as soon as it's available. If you can't upgrade to the latest version, update your agents to a version no more than 90 days old. Read more about keeping agents up to date.

See the New Relic Python agent EOL policy for information about agent releases and support dates.

Don't miss a new newrelic release

NewReleases is sending notifications on new releases.