v13.0.0
Breaking Changes📦 new-relic-sdkView on GitHub →
⚠ 1 breaking✨ 6 features🐛 4 fixes⚡ 1 deprecations🔧 4 symbols
Summary
This release removes support for Python lambda functions in configuration for security reasons and introduces several new features, including Anthropic and Gemini streaming instrumentation, and default exclusion of the `newrelic` header. Several bugs related to context propagation and reconnect logic have also been fixed.
⚠️ Breaking Changes
- Support for Python lambda functions in the configuration file (used for dynamically naming various traces and methods) has been removed due to security vulnerabilities. Users must now use static values or other supported configuration methods instead of lambdas for naming.
Migration Steps
- If you were using Python lambda functions in your configuration file for naming traces or methods, replace them with static configuration values.
- Update code references from `response.status` to use `http.statusCode` to prepare for its removal in version 14.0.0.
✨ New Features
- The `newrelic` distributed tracing header is no longer sent by default; only W3C `traceparent` and `tracestate` headers are sent.
- Added `exclude` and `include` settings (`opentelemetry.traces.include`/`exclude` config or environment variables) for controlling Hybrid Agent traces.
- Added instrumentation support for the [anthropic](https://pypi.org/project/anthropic/) library.
- Added response streaming support for Gemini via the [google-genai](https://pypi.org/project/google-genai/) package.
- Improved caching of IS_PYPY in `gc_data.py` for better performance by checking and caching the value once upon module load.
- Added the `http.statusCode` attribute to transaction events to conform with other language agents.
🐛 Bug Fixes
- Fixed an issue where module lists were not being resent to the collector upon reconnect.
- Added a guard against re-entrant calls to `_GCDataSource.record_gc()` to prevent infinite recursion on Python 3.13+ when collecting garbage collection metrics.
- Fixed transaction context propagation issue in async generators where `AsyncGeneratorProxy` failed to handle context spread over multiple tasks.
- Fixed trace context propagation for [starlette](https://pypi.org/project/starlette/) `StreamingResponse` for both synchronous and asynchronous generators.
Affected Symbols
⚡ Deprecations
- The `response.status` attribute in `WebTransaction`s is deprecated and will be removed in the 14.0.0 release. It is being replaced by `http.statusCode`.