• /
  • EnglishEspañolFrançais日本語한국어Português
  • Se connecterDémarrer

Python agent v13.0.0

May 7, 2026Download

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 instrumentation, gemini 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 context propagation in StreamingResponse.

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.

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 WebTransactions 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 page as well as the OpenTelemetry API support page.

  • Add Anthropic streaming instrumentation

  • 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 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 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 about keeping agents up to date.

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

Droits d'auteur © 2026 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.