Notes
This release of the Python agent fixes issues with signed headers in botocore (SigV4).
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.
Bugs
Fix issues with signed headers in botocore (SigV4)
- The previous change to botocore distributed tracing headers has been reverted to avoid duplicate headers being sent.
- Previously any distributed tracing headers that were generated by other tracing libraries could cause issues with instrumentation in botocore due to header signing. This has been fixed by disabling signing for these headers within botocore.
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.
Notes
This release of the Python agent adds support for OpenSearch, Microsoft Azure SQL, new Kinesis methods, and a new browser_monitoring.version setting. Additionally, improvements have been made to Anthropic, MCP, and Google ADK instrumentation. Issues with signed headers in botocore (SigV4) and Gemini tools parsing have also been fixed for this release.
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
New instrumentation for opensearch-py
- Instrumentation was added for the official OpenSearch database connector.
New instrumentation for mssql-python
- Instrumentation was added for Microsoft Azure SQL.
New instrumentation for new Kinesis methods
- The following methods are now supported in Kinesis:
create_channeldelete_channeldescribe_channellist_channelsupdate_channel
- The following methods are now supported in Kinesis:
New setting for
browser_monitoring.version- The new setting
browser_monitoring.versionenables users to specify specific versions of our Browser Monitoring Agent to be injected. - See the list of Supported Browser Agent Versions to choose from.
- The new setting
Improved Features
Improved support for anthropic.
- Improved parsing of request parameters for the Anthropic SDK on versions 1.0.0 and above.
- New parsing for responses via
Messages.with_raw_response.createenabling improved compatibility with LangChain.
Support for mcp v2.0.0 and above.
- Instrumentation has been updated following the major refactor done in
mcpv2.0.0 and should once again work as expected.
- Instrumentation has been updated following the major refactor done in
Support for Google ADK v2.9.0 and above.
- Instrumentation has been updated for Google ADK on versions 2.9.0 and above.
Bugs
Fix issues with signed headers in botocore (SigV4)
- Previously any distributed tracing headers that were generated by other tracing libraries could cause issues with instrumentation in botocore due to header signing. This has been fixed, and distributed tracing headers are now mutated before signing.
Fix Gemini tools parsing
- Previously, some instances of tools created with Gemini would fail to parse and would silently fail, resulting in no response for that specific request. This has been fixed.
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.
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-cosmosSDK.
- The Python agent now instruments Azure Cosmos DB client operations, reporting datastore metrics and traces for database, container, and user operations performed through the
Added support for HTTPX2
Added LangChain/LangGraph streaming events instrumentation
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.
- When running the Python agent alongside OpenTelemetry (Hybrid Agent mode), the agent now reads both the legacy and newer OpenTelemetry database span attribute names (
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.
- 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
Fixed
get_linking_metadatato properly pass through the specified application- Previously, calling
newrelic.agent.get_linking_metadata(application=...)ignored theapplicationargument 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!
- Previously, calling
Fixed MySQL database name reporting when using the
databasekeyword argument- Previously, the agent only checked the legacy
dbkeyword argument when parsing the database name from mysql-connector-python connection arguments, so connections made using the moderndatabasekeyword argument reported no database name in datastore metrics. The agent now checksdatabasefirst, falling back todb.
- Previously, the agent only checked the legacy
Fixed warning when accessing LangGraph v1.1+
GraphOutputvalues- Previously, LangGraph v1.1+ instrumentation accessed
GraphOutputreturn values using deprecated item-access syntax, triggering a deprecation warning. The agent now readsGraphOutput.valuedirectly.
- Previously, LangGraph v1.1+ instrumentation accessed
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.
Notes
This release of the Python agent adds support for Redis commands introduced in Redis v8.10.0 and redis-py v8.1.0. This release also resolves the issue of missing LlmChatCompletion events in LangChain when using MCP tools.
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 Redis commands introduced in Redis v8.10.0 and redis-py v8.1.0
- The Python agent now supports the following recently added commands in Redis:
himport_discard_allhimport_discardhimport_preparelmovemnrangenrevrangequerylabelsreadsdiffcardsunioncardaliaslist
- The Python agent now supports the following recently added commands in Redis:
Bugs
Fixed missing LlmChatCompletion events in Gemini when using MCP tools
Swapped to trace cache ID in LangChain and Agent Framework
- For context propagation purposes, swap the LangChain and Agent Framework instrumentation to only store the trace cache ID rather than the full trace in a reference attribute. This is to prevent these objects from getting serialized unexpectedly in the case of leaks. The ID is a much smaller object while the trace could contain MBs of data.
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.
Notes
This release of the Python agent adds support for AI Monitoring server-side configuration, adds context propagation for Bedrock invocations made through Microsoft Agent Framework, fixes duplicate tool entities for LangChain tools backed by a remote MCP server, reduces race condition risk in the garbage collection data sampler, fixes inconsistent transaction names when using Wagtail, and removes byte encoding from outbound Kombu distributed tracing headers.
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
Add support for AI Monitoring server-side configuration
- The Python agent now supports server-side configuration of AI Monitoring. When configured, the server-side
ai_monitoring.enabled,ai_monitoring.record_content.enabled, andai_monitoring.streaming.enabledvalues take precedence over the local settings.
- The Python agent now supports server-side configuration of AI Monitoring. When configured, the server-side
Add context propagation for Bedrock invocations through Agent Framework
- Propagates trace context across thread boundaries created by Microsoft Agent Framework's Bedrock integration. This allows the agent's existing botocore instrumentation to capture LLM events for Bedrock invocations made through Agent Framework. This does not add full instrumentation of Agent Framework itself.
Bugs
Fix inconsistent transaction names when using Wagtail
- Previously, transaction names for apps built on Wagtail were inconsistent and could be the same for different page views. This has been fixed.
Fix duplicate tool entities for LangChain tools backed by a remote MCP server
- Previously, when a LangChain tool was backed by a remote MCP server that was also separately instrumented, duplicate tool entities appeared in the UI. This has been fixed by gating subcomponent attributes off of LangChain tools when a known remote tool is detected.
Fix missing User Input field for LangChain and LangGraph MCP tool calls
- Previously, when LangChain or LangGraph used tools from an MCP server, the User Input field could be missing from AI monitoring data if the input message wasn't the last message in the streamed sequence. This has been fixed, and the agent now correctly extracts the input message in these cases.
Reduce race condition risk in the garbage collection data sampler
- Previously, the agent always called
gc.get_objects()to sample garbage collector object counts, regardless of configuration. This has been changed sogc.get_objects()is only called whentop_object_count_limitis configured above0, avoiding unnecessary heap iteration for customers who don't track object types collected by the garbage collector.
- Previously, the agent always called
Remove byte encoding from outbound Kombu distributed tracing headers
- Previously, distributed tracing headers added by Kombu instrumentation were byte-encoded, which broke transports that serialize payloads with the standard library
jsonmodule (for example, SQLAlchemy-backed transports). The byte encoding has been removed so these transports work correctly.
- Previously, distributed tracing headers added by Kombu instrumentation were byte-encoded, which broke transports that serialize payloads with the standard library
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.
Notes
This release of the Python agent adds instrumentation support for Google ADK, adds token counting for multiple AI providers (Anthropic, Google GenAI, OpenAI, and AWS Bedrock), reduces outbound tracestate header size, and fixes a crash in graphql-core instrumentation.
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.
Improved Features
Added instrumentation for Google ADK
- The Python agent now instruments Google ADK (Agent Development Kit) AI agent workflows.
- Instrumented components include:
LlmAgentlinked to Gemini or VertexAI backends viagoogle.genai- User-defined
FunctionToolinstances - Sub-agent workflows including child agents and
AgentToolinstances - Multi-agent workflows including the
Workflowclass and deprecatedLoopAgent,ParallelAgent, andSequentialAgentclasses
Added token counting for Anthropic, Gemini, OpenAI, and Bedrock
- The Python agent now reports token counts for all LLM invocations across multiple AI providers:
- Anthropic SDK
- Google GenAI SDK
- OpenAI SDK
- AWS Bedrock via botocore and aiobotocore
- The Python agent now reports token counts for all LLM invocations across multiple AI providers:
Bugs
Fixed instrumentation crash for graphql-core v3.2.10
- Previously, graphql-core v3.2.10 renamed the
errorsattribute tocollected_errorsinExecutionContext, causing the agent to crash. This has been fixed, and the agent now works correctly with graphql-core v3.2.10 and later.
- Previously, graphql-core v3.2.10 renamed the
Removed
spanIdfrom outboundtracestateheader- Previously, the agent included
spanIdin the outboundtracestateheader. BecausespanIdis already present in thetraceparentheader, this was unnecessary duplication. ThespanIdhas been removed fromtracestateto reduce outbound header size.
- Previously, the agent included
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.
Notes
This release of the Python agent adds additional model information to LangChain Chain LLM events, and fixes a bug in LangGraph streaming instrumentation.
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.
Improved Features
Add additional model information to LangChain Chain LLM events
- Add
request.modelandresponse.modelattributes to LLM events produced by LangChain Chains. - This information is pulled on a best effort basis and may not always be available.
- Add
Bugs
Fix TypeError in LangGraph streaming instrumentation
- Previously, when using a subset of streaming APIs in LangGraph, the agent would encounter a
TypeErrordue to the use ofweakref.WeakMethodby LangGraph. This has been fixed, and the agent should now work correctly with those LangGraph streaming methods.
- Previously, when using a subset of streaming APIs in LangGraph, the agent would encounter a
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.
Notes
This release of the Python agent adds support for multiple new Redis commands, fixes a bug in LangGraph instrumentation, and improves handling and logging of harvest limit settings.
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.
Improved Features
Add instrumentation for new Redis v8.8.0 commands
- Add instrumentation for the following new Redis commands from redis-py v8.8.0:
- Misc commands: INCREX, XNACK
- Array commands: ARCOUNT, ARDEL, ARDELRANGE, ARGET, ARGETRANGE, ARGREP, ARINFO, ARINSERT, ARLASTITEMS, ARLEN, ARMGET, ARMSET, ARNEXT, AROP, ARRING, ARSCAN, ARSEEK, ARSET
- Add instrumentation for the following new Redis commands from redis-py v8.8.0:
Bugs
Fix crash in LangGraph instrumentation
- Previously, when using LangGraph instrumentation, the agent would crash due to an issue with context propagation to jobs in AsyncBackgroundExecutor. This has been fixed, and the agent should now work correctly with LangGraph.
Improved handling and logging of harvest limit settings
- The agent now more accurately reports the list of harvest methods and limits to the Environment tab in New Relic One.
- The agent now has more consistent debug logging on startup for harvest limit settings.
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.
Notes
This release of the Python agent fixes a context propagation issue in LangChain and LangGraph, an OpenAI chat completion recording issue, and an issue when using OpenAI(https://pypi.org/project/openai) streaming through LiteLLM as a proxy.
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.
Bugs
Fix context propagation in LangChain and LangGraph
Fix an OpenAI chat completion recording issue
- OpenAI reintroduced logic that closes the streaming response even if the consumer hasn't read all data. Previously, the chat completion data was only recorded when reaching the stream's end which resulted in chat completion data not being recorded at the closing of the stream. Logic has now been added to capture the chat completion data even if the stream has not been fully read.
Fix an issue when using OpenAI streaming through LiteLLM as a proxy
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.
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.statusattribute inWebTransactions is considered deprecated and will be removed in the upcoming 14.0.0 release. It is being replaced byhttp.statusCode. We recommend replacing all references toresponse.statuswithhttp.statusCode.
New features
Exclude the
newrelicheader by default- The
newrelicdistributed tracing header is now no longer sent by default. Only the W3Ctraceparentandtracestateheaders will be sent.
- The
Add exclude and include settings for Hybrid Agent traces
opentelemetry.traces.includefor the configuration file orNEW_RELIC_OPENTELEMETRY_TRACES_INCLUDEto be used as an environment variableopentelemetry.traces.excludefor the configuration file orNEW_RELIC_OPENTELEMETRY_TRACES_EXCLUDEto 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
- Adds instrumentation support for 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 package.
Add
http.statusCodeattribute to transaction events- To conform with the rest of the language agents, the Python agent now sends the http status to the
WebTransactionattributehttp.statusCode. The Python agent will continue to send the attribute toresponse.statusas well, but theresponse.statusattribute will be removed in the future.
- To conform with the rest of the language agents, the Python agent now sends the http status to the
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+.
- Adds a flag to prevent re-entrant calls to
Enable task propagation in async generators
- Fixes an issue where
AsyncGeneratorProxywould not properly handle transaction context propagation if spread over multiple tasks.
- Fixes an issue where
Fix Starlette context propagation in
StreamingResponse- Adds trace context propagation to starlette
StreamingResponsefor both synchronous and asynchronous generators.
- Adds trace context propagation to starlette
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.