---
title: python-agent-130500
source: https://docs.newrelic.com/docs/release-notes/agent-release-notes/python-release-notes/python-agent-130500
---

## 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](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/python_agent/release).

## New features

-   Added support for Azure CosmosDB

    -   The Python agent now instruments [Azure Cosmos DB](https://pypi.org/project/azure-cosmos/) 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](https://pypi.org/project/httpx2/), a fork of [HTTPX](https://pypi.org/project/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](https://pypi.org/project/langchain/) agents.
    -   Added `stream_events`/`astream_events` instrumentation for [LangChain](https://pypi.org/project/langchain/)/[LangGraph](https://pypi.org/project/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](https://github.com/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](https://pypi.org/project/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](https://pypi.org/project/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](https://docs.newrelic.com/docs/new-relic-solutions/new-relic-one/install-configure/update-new-relic-agent/) about keeping agents up to date.

See the New Relic Python agent [EOL policy](https://docs.newrelic.com/docs/apm/agents/python-agent/getting-started/python-agent-eol-policy/) for information about agent releases and support dates.
