Notes
This release of the Python agent provides fixes for early activation in Django instrumentation, server side overrides for max_samples_stored being ignored, and guards against crashes from trace_cache.pop().
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
Prevents early activation in Django instrumentation
- Remove calls to
application_settings()in Django instrumentation to prevent issues with early activations in pre-fork applications.
- Remove calls to
Fix server configuration to local configuration sync issues
- This fixes a bug created when
event_harvest_config.harvest_limits.*settings were deprecated in favor of*.max_samples_storedsettings. Some server side configurations were not overriding the client side configurations, resulting in data being sent to the collector despite the user disabling this.
- This fixes a bug created when
Guard against crashes from
trace_cache.pop()- In the
ContextOfclass, there was an unsafe access of thetrace_cacheviapop(key)without a default value. This caused crashes when theweakrefin the dictionary was already garbage collected.
- 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
Caution
This version of the agent has been withdrawn.
This release of the Python agent makes the following changes:
- Removes support for Python 3.7
- Removes and or deprecates various APIs and settings
- Deprecates aioredis instrumentation
- Raises the minimum supported version of
setuptoolsandsetuptools_scm - Adds new instrumentation for AutoGen
- Adds new instrumentation for Pyzeebe
- Adds new MCP (Model Context Protocol) named spans
- Fixes a crash in psycopg
- Ensures MCP spans are only recorded when AI monitoring is enabled
Install the agent using easy_install/pip/distribute via the Python Package Index or download it directly from the New Relic download site.
Removed features
Removes support for Python 3.7
- Python 3.7 was EOL'd June 27, 2023. The Python agent has dropped support for it.
Removes various deprecated APIs
The following APIs have been removed:
Legacy API Replacement API accept_distributed_trace_payloadaccept_distributed_trace_headersadd_custom_parameteradd_custom_attributeadd_custom_parametersadd_custom_attributescreate_distributed_trace_payloadinsert_distributed_trace_headersget_browser_timing_footerThe functionality of this has been wrapped into get_browser_timing_header()record_exceptionnotice_error()NewRelicLogHandlerNewRelicLogForwardingHandlerlambda_handler&LambdaHandlerWrapperThese APIs have moved to the newrelic-lambdapackage.
Removes various deprecated settings
The following settings have been removed:
Legacy Setting Replacement Setting transaction_tracer.capture_attributestransaction_tracer.attributes.enablederror_collector.capture_attributeserror_collector.attributes.enabledbrowser_monitoring.capture_attributesbrowser_monitoring.attributes.enabledanalytics_events.enabledtransaction_events.enabledanalytics_events.capture_attributestransaction_events.attributes.enablederror_collector.ignore_errorserror_collector.ignore_classesstrip_exception_messages.whiteliststrip_exception_messages.allowlistsslThis is now hardcoded to trueso it has been removed as a setting option.ignored_paramsUse newrelic.attributes.exclude = request.parameters.{name}instead. Add each request parameter key to thenewrelic.attributes.excludelist, delimited by commas. Be sure to prepend the key withrequest.parameters.agent_limits.merge_stats_maximumThis is now completely ignored in favor of serverside config.
Deprecated features
Instrumentation for aioredis has been deprecated
Deprecates some existing harvest settings to match other language agents
In order to be more consistent with the conventions of the other language agents, the following harvest settings are now deprecated:
Legacy Setting Replacement Setting event_harvest_config.harvest_limits.analytic_event_datatransaction_events.max_samples_storedevent_harvest_config.harvest_limits.span_event_dataspan_events.max_samples_storedevent_harvest_config.harvest_limits.error_event_dataerror_collector.max_event_samples_storedevent_harvest_config.harvest_limits.custom_event_datacustom_insights_events.max_samples_storedevent_harvest_config.harvest_limits.log_event_dataapplication_logging.forwarding.max_samples_storedThis is a revert of a previous change that renamed these settings from
*.max_samples_storedto theevent_harvest_config.harvest_limits.*form. This decision has been reversed, and the original settings named have been restored to match the other language agents who did not change these settings names. The deprecated settings will continue to work for now, but they will be removed in a future release.
Deprecates configuration of the agent through the WSGI environ dictionary
The following settings which were previously possible to configure through the WSGI environ dictionary are now deprecated. Please configure these settings through environment variables or the config file.
newrelic.set_background_tasknewrelic.suppress_apdex_metricnewrelic.suppress_transaction_tracenewrelic.capture_request_paramsnewrelic.disable_browser_autorum
Deprecates support for building the agent with
setuptools<61.2orsetuptools_scm<6.4- The minimum supported versions of
setuptoolsandsetuptools_scmhave been increased to61.2and6.4respectively. This is to support the use ofpyproject.tomlfor configuring the package metadata and building instructions. The agent can now be built with more modern build tools which will no longer log warnings about the lack of apyproject.tomlfile. - This change adds new version attributes to the packages,
newrelic.__version__andnewrelic.__version_tuple__, which can be used to programmatically check the version of the agent at runtime.
- The minimum supported versions of
New features
Adds new instrumentation for AutoGen
- Adds instrumentation (named spans and custom
Llmevents) for agents and tools in AutoGen
- Adds instrumentation (named spans and custom
Adds new instrumentation for Pyzeebe
- Adds automatic instrumentation and framework-specific agent attributes for Pyzeebe
Adds new MCP (Model Context Protocol) named spans
- Adds new named spans for MCP (Model Context Protocol) tool calls made via tool manager to support Streamable HTTP
Bug fixes
Fixes a crash in
psycopg>=3.2.0when callingas_string()- Fixes an issue in
psycopg>=3.2.0where theas_string()method no longer required arguments, causing a potential crash. This has been fixed, and both signatures of this method are supported.
- Fixes an issue in
Ensures MCP (Model Context Protocol) spans are only recorded when AI monitoring is enabled
- Ensures MCP (Model Context Protocol) spans are only recorded when the setting
ai_monitoring.enabledis enabled.
- Ensures MCP (Model Context Protocol) spans are only recorded when the setting
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 the following:
- Custom tasks in Celery
- Graphene-Django monitoring
- Middleware filtering in Django
- AWS Bedrock Converse API
- W3CTraceParent header sampled flag
This release also provides the following fixes:
- Safeguards for the deepest unique path in GraphQL
- Safeguards for web URL request parsing
- Fallback for ElasticSearch and GraphQL when
trace.settings==None - Remove
optionsmethod from async ElasticSearch client list
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
Adds support for custom tasks in Celery
Adds support for Graphene-Django
- Add monitoring support for synchronous schemas created with Graphene-Django. Previously, schemas created with Graphene-Django would only be partially monitored, resulting in missing GraphQL related attributes.
Adds support for middleware filtering in Django
Users are now able to filter which Django middleware to monitor. There are now three additional settings:
instrumentation.middleware.django.enabled(Default istrue)instrumentation.middleware.django.excludeinstrumentation.middleware.django.include
See the Django Middleware Filtering page for more information and examples.
Adds support for AWS Bedrock Converse API
- Add monitoring support for non-streaming Converse API. This includes support for
conversechat completion calls made usingboto3andaioboto3clients.
- Add monitoring support for non-streaming Converse API. This includes support for
Adds support for W3CTraceParent header sampled flag
- When an upstream service sends the W3CTraceParent header with the sampling flag set, New Relic will take into account that sampling decision when deciding whether the current transaction will be sampled.
Added support for sampling decisions based on whether the remote parent is sampled
Added support for two new configuration options:
distributed_tracing.sampler.remote_parent_sampleddistributed_tracing.sampler.remote_parent_not_sampled
defaultis the default behavior and behaves as it did before this change (it passes the sampling decision to the adaptive sampling algorithm to determine whether the transaction will be sampled).always_onmeans that the trace that has a remote parent sampled or remote parent not sampled will always be sampled.always_offmeans that the trace that has a remote parent sampled or remote parent not sampled will never be sampled.
Bug fixes
Add safeguard for deepest unique path in GraphQL
- Some users were experiencing issues with the deepest unique path in GraphQL not being generated due to a field name returning
None. This issue has been fixed.
- Some users were experiencing issues with the deepest unique path in GraphQL not being generated due to a field name returning
Add safeguard for web request parsing
- Some users experienced a parsing error when
request_uriwas malformed or contained invalid characters. This can happen at this point if therequest_uriin the request header is invalid and does not match the (valid) URL originally given. While this safeguard has now been put in place in New Relic,urllibhas resolved this issue for versions of Python released after Jan 31, 2025.
- Some users experienced a parsing error when
Fix crash in ElasticSearch and GraphQL when
trace.settings==None- In cases where
trace.settingsisNone, the instrumentation for ElasticSearch crashed the application. Aglobal_settingsfallback has been put in place. This also resolves the same issue found in GraphQL.
- In cases where
Remove
optionsmethod from async ElasticSearch client list- The previous instrumentation of ElasticSearch caused a crash because
optionswas in the list of async methods. This method is no longer wrapped in aDatastoreTracesince it is not one that conducts any datastore operations/requests.
- The previous instrumentation of ElasticSearch caused a crash because
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 new Redis functions, convert all internal paths from os.path to pathlib.Path, and fixes an issue with JSON encoding PosixPaths.
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
Adds support for new Redis functions
- Add instrumentation for new Redis functions.
Convert all internal paths from
os.pathtopathlib.Path- Convert all internal usage of string based paths and
os.pathtopathlib.Pathin preparation to support Windows paths.
- Convert all internal usage of string based paths and
Bug fixes
Fix issue with JSON encoding PosixPath
- Some users were experiencing issues with JSON encoding
PosixPathconfiguration settings. This issue has been fixed.
- Some users were experiencing issues with JSON encoding
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 oracledb, fixes a bug in Kombu and Kafka where MessageTransaction object has no attribute destination_name, and fixes the disappearance of utilization metadata with AWS.
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
Adds support for oracledb
- Add instrumentation for oracledb.
Bug fixes
Fix "
MessageTransactionobject has no attributedestination_name" bug- Fix a bug in MessageBroker instrumentations where the serialize methods were looking for the
destination_nameattribute on theMessageTransactionand it did not exist.
- Fix a bug in MessageBroker instrumentations where the serialize methods were looking for the
Fix AWS utilization metadata issue when running AWS and K8s together
- Due to permissions settings in K8s pods running on AWS EC2 instances, the utilization metadata is able to be retrieved the first time. However, if the application is left running continuously, the agent will reconnect and the utilization metadata fails to load. In cases like these, the utilization metadata is cached per agent instance and is able to be retrieved.
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 Function Apps and protobuf v6.
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
Adds support for Azure Function Apps
- Adds support for Azure Function Apps for HTTPTrigger types.
Bug fixes
Adds pb2 files to enable protobuf v6 support
- Previously, several google packages were not compatible with New Relic due to the lack of protobuf v6 support. This has now been resolved.
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 the Model Context Protocol (MCP) and fixes import logic for importlib.metadata and pkg_resources.
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 Model Context Protocol (MCP)
Bug fixes
Fix import logic for
importlib.metadataandpkg_resources- Updates logic around import of
importlib.metadatato also attempt to use theimportlib_metadatabackport before falling back topkg_resources.*. This also removes use ofsys.versionconditionals and fixes issues where Python 3.9 could only usepkg_resourcesdespite havingimportlib.metadataavailable.
- Updates logic around import of
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 v6.0.0 and fixes conflicts with the opentelemetry-proto package.
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 Redis v6.0.0
- Adds support for all client methods introduced in Redis v6.0.0.
Bug fixes
Fix conflicts with opentelemetry-proto package
- Fixes an issue where the agent's internal copy of opentelemetry-proto would conflict with any other packages relying on opentelemetry-proto (such as ChromaDB). This should now be treated as a separate package by OpenTelemetry and prevent any conflicts.
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 Google Gemini via the Google Generative AI SDK and instruments new Kinesis methods.
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 Google Gemini via Google Generative AI SDK
- Adds support for google-genai. The agent will automatically instrument
embed_contentcalls for synchronous and asynchronous embeddings. The agent also now supports synchronous and asynchronous text generations for text inputs in non-streaming cases. This includes calls made togenerate_contentfor single text-only inputs and calls tosend_messagefor multi-turn conversations.
- Adds support for google-genai. The agent will automatically instrument
Instrument new AWS Kinesis methods
- Adds botocore instrumentation to support new AWS Kinesis methods including
tag_resource,untag_resource, andlist_tags_for_resource.
- Adds botocore instrumentation to support new AWS Kinesis methods including
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 async elasticsearch, fixes a graphql configuration parsing issue, fixes a bug in the Kombu instrumentation and re-enables the Kombu instrumentation.
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 async support for elasticsearch
- Adds support for async elasticsearch. Thanks fagnerzulin for the contribution!
Bug fixes
Add parsing of graphql config setting
- Previously, when the setting
instrumentation.graphql.capture_introspection_querieswas set in the config file, this setting did not take effect. This has been fixed.
- Previously, when the setting
Fix crash in Kombu when running with Sentry
- Fixes a crash in Kombu instrumentation where a
TypeErrorwas raised from theinspectmodule. This bug was due to a conflict in wrapping between New Relic and Sentry. The Kombu instrumentation has also been re-enabled.
- Fixes a crash in Kombu instrumentation where 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.