Notes
This release of the Python agent adds support for the latest versions of asgiref and support for AI monitoring when using the following libraries: OpenAI, AWS Bedrock, and Langchain.
Install the agent using easy_install/pip/distribute
via the Python Package Index or download it directly from the New Relic download site.
New features
Add support for asgiref 3.8.0 and above
- Asgiref released a new version that resulted in missing transaction context. This has been fixed.
AI monitoring
- New Relic AI monitoring is the industry’s first APM solution that provides end-to-end visibility for AI Large Language Model (LLM) applications. It enables end-to-end visibility into the key components of an AI LLM application. With AI monitoring, users can monitor, alert, and debug AI-powered applications for reliability, latency, performance, security and cost. AI monitoring also enables AI/LLM specific insights (metrics, events, logs and traces) which can easily integrate to build advanced guardrails for enterprise security, privacy and compliance.
- AI monitoring offers custom-built insights and tracing for the complete lifecycle of an LLM’s prompts and responses, from raw user input to repaired/polished responses. AI monitoring provides built-in integrations with popular LLMs and components of the AI development stack. This release provides instrumentation for OpenAI, AWS Bedrock, and Langchain.
- When AI monitoring is enabled with
ai_monitoring.enabled = true
, the agent will now capture AI LLM related data. This data will be visible under a new APM tab called AI Responses. See our AI Monitoring documentation for more details.
AI monitoring configuration
- New configuration options are available specific to AI monitoring. These settings include:
- ai_monitoring.enabled
- ai_monitoring.streaming.enabled
- ai_monitoring.content.enabled
- New configuration options are available specific to AI monitoring. These settings include:
AI monitoring public API methods
- Two new AI monitoring related public API methods have been added:
Add support for AWS Bedrock
- Support for AWS Bedrock Large Language Model instrumentation has been added. Chat completion and embedding data for streaming and non-streaming is recorded for the following models:
- amazon.titan-*
- ai21.j2-*
- anthropic.claude-*
- cohere.command-*
- meta.llama2-*
- amazon.titan-embed*
- cohere.embed*
- Support for AWS Bedrock Large Language Model instrumentation has been added. Chat completion and embedding data for streaming and non-streaming is recorded for the following models:
Add support for Langchain
- Support for Langchain Large Language Model instrumentation has been added. Langchain Agents, Chains, Tools, OpenAI, and Bedrock LLM data is recorded. Note streaming is not supported at this time.
Add support for OpenAI
- Support for OpenAI Large Language Model instrumentation has been added. Synchronous and asynchronous chat completion and embedding data is recorded. Note streaming is only supported in chat completions at this time.
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 bug in the NewRelicContextFormatter
where attributes were dropped from logs.
Install the agent using easy_install/pip/distribute
via the Python Package Index or download it directly from the New Relic download site.
Bug fixes
- Fix log attribute dropping in
NewRelicContextFormatter
- In v9.5.0, a bug in the
NewRelicContextFormatter
was introduced wheremessage
was added to the default set of keys to exclude. This caused extra attributes not in the default list to be dropped. This bug has been fixed.
- In v9.5.0, a bug in the
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 no longer reports attributes with None
values. It also attaches a transaction trace ID to the error traces even when distributed tracing is disabled.
Install the agent using easy_install/pip/distribute
via the Python Package Index or download it directly from the New Relic download site.
New features
Remove reporting of attributes with
None
values- Previously, the agent recorded attributes with a value of
None
type as the string "None". The agent will no longer record user or agent attributes that haveNone
type values.
- Previously, the agent recorded attributes with a value of
Bug fixes
- Add transaction trace ID to the error traces even when distributed tracing is disabled
- Previously, certain trace attributes in error traces such as stack traces were only visible in the UI if distributed tracing was enabled. Linking the transaction trace to error traces by including the transaction trace ID on the error traces allows the user to have access to the transaction trace attributes in the UI.
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 bug when specifying processors in structlog, and updates the NewRelicLogForwardingHandler
to support dictionary type logs and formatters.
Install the agent using easy_install/pip/distribute
via the Python Package Index or download it directly from the New Relic download site.
New features
Support dictionary type logs in
NewRelicLogForwardingHandler
- Dictionary type log messages are now supported in
NewRelicLogForwardingHandler
when passed as the log message, or when a custom formatter returns a dictionary. - The key
message
will be extracted if available and treated as the log message, and any other items will be considered context data attributes and prefixed withmessage.
.- These attributes are subject to the same filtering rules as other context data. The
message.
prefix is not considered when filtering attributes from logs. - To report these attributes, enable context data forwarding and optionally configure include and exclude rules to filter the allowed attributes.
- These attributes are subject to the same filtering rules as other context data. The
- Dictionary type log messages are now supported in
Support logging formatters in
NewRelicLogForwardingHandler
- Logging formatters added with
setFormatter()
are now supported, and may return a string or dicitionary log message type to be forwarded to New Relic.
- Logging formatters added with
Bug fixes
- Fix a bug when specifying processors in structlog
- Previously, there was a bug in the structlog instrumentation where
processors
was assumed to be list type. Now the instrumentation supports processors of all iterable types.
- Previously, there was a bug in the structlog instrumentation where
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 context data attributes to logs, support for dictionary type log messages, adds attribute support to record_log_event
API, and obfuscates logged license keys and user API keys.
Install the agent using easy_install/pip/distribute
via the Python Package Index or download it directly from the New Relic download site.
New features
Add context data attributes to logs
- Context data available from logging frameworks can now be recorded as attributes on logs. These attributes are prefixed with
context.
, which is not considered when filtering attributes from logs. - Context data may include extras, dictionary message attributes, and attributes provided by logging frameworks.
- To report these attributes, enable context data forwarding and optionally configure include and exclude rules to filter the allowed attributes.
- Context data available from logging frameworks can now be recorded as attributes on logs. These attributes are prefixed with
Add support for dictionary type log messages
- Dictionary type log messages are now supported for logging frameworks which support dictionary type log messages (including the builtin
logging
module andstructlog
). - The key
message
will be extracted if available and treated as the log message, and any other items will be considered context data attributes and prefixed withmessage.
. These attributes are subject to the same filtering rules as other context data.
- Dictionary type log messages are now supported for logging frameworks which support dictionary type log messages (including the builtin
Add attribute support to
record_log_event
API- The
record_log_event
API now allows passing context data in using the optionalattributes
keyword argument, and allows the message argument to be a dictionary as described above.
- The
Obfuscate license keys and user API keys in logs
- The agent now obfuscates all instances of license keys or user API keys in agent logs and audit logs.
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 nonced content security policies for browser agent injection, adds new wheels for Python 3.12 and musl Linux systems such as Alpine, deprecates the ObjectWrapper and get_browser_timing_footer
APIs, fixes a crash with Kafka instrumentation when using distributed tracing, and removes a case sensitive header check in ASGIBrowserMiddleware
.
Install the agent using easy_install/pip/distribute
via the Python Package Index or download it directly from the New Relic download site.
Deprecations
Deprecated
newrelic.agent.ObjectWrapper
API- Removes custom
newrelic.agent.ObjectWrapper
implementation and instead creates a pass through towrapt.FunctionWrapper
.
- Removes custom
Deprecated
get_browser_timing_footer
API- Previously
get_browser_timing_footer
was an API that would be used to supply information to the browser agent loaded byget_browser_timing_header
. - This step is now included in
get_browser_timing_header
, makingget_browser_timing_footer
obsolete. This function now returns an empty string to avoid breaking existing applications.
- Previously
New features
Added nonced content security policies (CSPs) for browser agent injection
- The browser agent injection API
get_browser_timing_header
has a new parameternonce
that takes a cryptographic nonce for use with content security policies. The nonce will be automatically inserted into the generated HTML.
- The browser agent injection API
Added additional wheel options for Python 3.12 and musl Linux
- Added pre-built binary wheel support for Python 3.12 as well as alternative wheels for musl-based Linux operating systems (such as Alpine).
Added
newrelic.agent.CallableObjectProxy
to public APIs- Previously
CallableObjectProxy
was never exposed for general use with custom instrumentation, but was present in internal modules used by the agent. - This API has been added to
newrelic.agent.CallableObjectProxy
for general use.
- Previously
Bug fixes
Fixed a crash with kafka-python and confluent-kafka when using distributed tracing
- Previously Kafka instrumentation packages would sometimes fail to generate distributed tracing headers and cause a crash. This has been fixed and distributed tracing headers should now generate correctly.
Removed case sensitive header check in
ASGIBrowserMiddleware
- The agent previously only supported HTML insertion for headers that were lowercase in ASGI applications. The header check is now case insensitive in compliance with the ASGI specification.
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 Python 3.12 support. It also includes support for sending utilization data for Docker with cgroups v2, adds a new synthetics information header, upgrades the agent's internal wrapt version, and includes a bug fix for structlog.
Install the agent using easy_install/pip/distribute
via the Python Package Index or download it directly from the New Relic download site.
New features
Add support for Python 3.12 The agent now supports applications running in Python 3.12.
Add support for Docker cgroups v2 The agent now includes functionality to parse Docker IDs in later versions of Docker using cgroups v2.
Add new synthetics information header The agent now retransmits and processes information contained in a new synthetics header: X-NewRelic-Synthetics-Info.
Changes
- Upgrade internal wrapt to v1.16.0 The agent's internal copy of wrapt has been upgraded to v1.16.0 in conjunction with Python 3.12 support.
Bug fixes
- Fix structlog CallsiteParameter processor bug Call site parameter values in structlog no longer produce incorrect values.
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 a new configuration option that allows users to disable capturing package and version information at agent startup.
Install the agent using easy_install/pip/distribute
via the Python Package Index or download it directly from the New Relic download site.
New features
- Add new configuration option
package_reporting.enabled
. This option allows users to disable capturing package and version information at agent startup. On some applications with a high number of packages some users were seeing a spike in CPU usage. Disabling this setting provides a workaround for that issue.
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 regression in package version performance that was introduced in 8.10.1.
Install the agent using easy_install/pip/distribute
via the Python Package Index or download it directly from the New Relic download site.
Bug fixes
- Fix package version performance regression Addressed issue that was introduced in 8.10.1 where there is increased CPU usage and time on startup and when using certain libraries at runtime.
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 generator instrumentation issue with Redis and adds caching to package versions to address some performance issues.
Install the agent using easy_install/pip/distribute
via the Python Package Index or download it directly from the New Relic download site.
New features
- Add caching to
get_package_version
to address performance issues
Bug fixes
- Fix generator and async generator instrumentation issue in
Redis.asyncio
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.