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

## 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 resends modules during reconnect ensuring they are recorded, guards garbage collection metrics against re-entrant calls, fixes task propagation in async generators and [starlette](https://pypi.org/project/starlette/) context propagation in `StreamingResponse`.

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).

## Removed features

-   Remove support for Python lambda functions in the config file

    -   Previously, the agent allowed specifying a Python lambda function to dynamically name transactions, background task, database trace, profile trace, external trace url and method, function trace, generator trace, and memcache trace. Since support for this feature exposes a security vulnerability in the agent this feature is being removed.

## Deprecations

-   The `response.status` attribute in `WebTransaction`s is considered deprecated and will be removed in the upcoming 14.0.0 release.  It is being replaced by `http.statusCode`. We recommend replacing all references to `response.status` with `http.statusCode`.

## New features

-   Exclude the `newrelic` header by default

    -   The `newrelic` distributed tracing header is now no longer sent by default. Only the W3C `traceparent` and `tracestate` headers will be sent.

-   Add exclude and include settings for Hybrid Agent traces

    -   `opentelemetry.traces.include` for the configuration file or `NEW_RELIC_OPENTELEMETRY_TRACES_INCLUDE` to be used as an environment variable
    -   `opentelemetry.traces.exclude` for the configuration file or `NEW_RELIC_OPENTELEMETRY_TRACES_EXCLUDE` to be used as an environment variable

    The Hybrid Agent's default behavior will be different as well.  Now, only libraries and tracers that are supported by OpenTelemetry but not already supported by New Relic will utilize OpenTelemetry's instrumentation.  Otherwise, the agent will default to the New Relic instrumentation hooks.

    More information about these settings can be found in the [Python Agent configuration](https://docs.newrelic.com/docs/apm/agents/python-agent/configuration/python-agent-configuration/#otel-settings) page as well as the [OpenTelemetry API support](https://docs.newrelic.com/docs/apm/agents/manage-apm-agents/opentelemetry-api-support/#python-config) page.

-   Add Anthropic streaming instrumentation

    -   Adds instrumentation support for [anthropic](https://pypi.org/project/anthropic/).

-   Improve caching of IS_PYPY in gc_data.py for performance

-   Now checks and caches IS_PYPY once when the module is loaded.


-   Add Gemini response streaming

    -   Add response streaming support to Gemini through the [google-genai](https://pypi.org/project/google-genai/) package.

-   Add `http.statusCode` attribute to transaction events

    -   To conform with the rest of the language agents, the Python agent now sends the http status to the `WebTransaction` attribute `http.statusCode`.  The Python agent will continue to send the attribute to `response.status` as well, but the `response.status` attribute will be removed in the future.

## Bugs

-   Resend modules during reconnect

    -   The agent previously only sent the module list periodically after the first connect cycle.  If the agent reconnected to the collector, this data would not be resubmitted, so the UI would no longer show the module data.  This has now been fixed.

-   Guard garbage collection metrics against re-entrant calls

    -   Adds a flag to prevent re-entrant calls to `_GCDataSource.record_gc()` to prevent infinite recursion on Python 3.13+.

-   Enable task propagation in async generators

    -   Fixes an issue where `AsyncGeneratorProxy` would not properly handle transaction context propagation if spread over multiple tasks.

-   Fix Starlette context propagation in `StreamingResponse`

    -   Adds trace context propagation to [starlette](https://pypi.org/project/starlette/) `StreamingResponse` for both synchronous and asynchronous generators.

## 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.
