Notes
This release of the Python agent enables Distributed Tracing by default, deprecates Cross Application Tracing.
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
Reservoir sizes now configurable using settings and environment variables
Reservoir sizes for span events, transaction events, error events, and custom events are now configurable via environment variables. These reservoirs limit both the maximum number of events that can be sent as well as local memory usage.
The agent reservoir can be expanded to accommodate more spans in case more traces are needed or there are dropped spans. The default setting for
event_harvest_config.harvest_limits.span_event_data
has been increased from 1000 to 2000 for better performance. This variable can be increased up to a size of 10,000.These settings previously existed via config file but were undocumented. For details, see the new documentation.
Deprecations
Cross Application Tracing is now deprecated, and disabled by default
Distributed Tracing is replacing Cross Application Tracing as the default means of tracing between services. Cross Application Tracing will soon be removed entirely with a future release.
The default setting for
cross_application_tracer.enabled
is now False, disabling Cross Application Tracing.To continue using it temporarily while transitioning to Distributed Tracing, enable it with
cross_application_tracer.enabled = True
anddistributed_tracing.enabled = False
.
Changes
Distributed Tracing is enabled by default
The default setting for
distributed_tracing.enabled
is now True, enabling Distributed Tracing by default.To disable Distributed Tracing, please set the
distributed_tracing.enabled
setting to False.
Notes
This release of the Python agent adds new instrumentation for the GraphQL frameworks Strawberry and Ariadne, updates to Graphene and Starlette GraphQL instrumentation, a change to logging configuration, and includes bug fixes.
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 instrumentation for Strawberry
GraphQL applications built using Strawberry will now be automatically instrumented.
Add new instrumentation for Ariadne
GraphQL applications built using Ariadne will now be automatically instrumented.
Improvements
Add new and changed metrics for Graphene applications
Metrics specifying the framework details for Graphene have been added, and GraphQL metrics now include Graphene as a product field.
(eg.
GraphQL/operation/Graphene/query/<query_name>/<query_path>
)Improve tracing in Starlette GraphQL applications
GraphQL applications using Starlette now support all executor classes. Previously, only async executor classes were supported.
Changes
New Relic agent logs no longer propagate to the root logger by default
Previously, logs using the
logging
module sent to thenewrelic
logger would propagate to the root logger, potentially causing duplicate logs to appear or be sent to New Relic. This has been changed to no longer propagate to the root logger by default.To reverse this behavior, in your application you can run
logging.getLogger("newrelic").propagate = True
at any point after initializing the agent. If you use thenewrelic-admin
wrapper, this can be done at any time inside your application.
Bug Fixes
TimeTrace.str recursion
A case of infinite recursion with
TimeTrace.__str__
has been corrected in this release. Callingstr()
,repr()
orprint()
on aTimeTrace
object or subclass instance will now display helpful debugging information about it.
Notes
This release of the Python agent updates the log file location in the default newrelic.ini
file, and includes multiple bug fixes.
The agent can be installed using easy_install/pip/distribute via the Python Package Index, or it can be downloaded directly from the New Relic download site.
Improved Features
Update log_file location in default
newrelic.ini
The
newrelic.ini
generated usingnewrelic-admin generate-config
has been updated to set the defaultlog_file
location tostdout
for improved initial visibility. This setting can still be customized to log tostderr
or a user-specified file as well.
Bug Fixes
Handle
cherryPy.HTTPRedirects
cherrypy.HttpRedirects
were incorrectly being reported as errors. This has now been corrected thanks to a contribution from @bdeeney!Address
DeprecationWarning
for invalid escape sequenceA deprecation warning concerning unrecognized escape sequences in Python 3.6 (and higher) has been fixed. Thank you @urianchang for your contribution!
Notes
This release of the Python agent adds ARM64 wheels and fixes a crash in unsupported GraphQL versions.
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 wheel support for ARM64 (a.k.a. AArch 64, ARMv8)
The agent now provides prebuilt wheels for ARM64 for Python versions >=3.6. This requires a version of pip>=19.3.
Bug Fixes
Fix a crash in unsupported GraphQL versions
A crash in GraphQL could occur when using an older version not supported by our instrumentation (ie.
graphql-core<2.1
). This has been corrected.
Notes
This release of the Python agent adds new GraphQL instrumentation support for the Graphene library and Graphene schemas created in Starlette/ FastAPI.
The agent can be installed using easy_install/pip/distribute via the Python Package Index or can be downloaded directly from the New Relic download site.
New Features
Add support for Graphene
Graphene applications will now be automatically instrumented.
Add support for Graphene schemas in Starlette/FastAPI with use of an AsyncioExecutor
Starlette/ FastAPI applications using GraphQL in conjunction with an AsyncioExecutor will now be automatically instrumented.
Notes
This release of the Python agent adds wildcarding to instrumentation config and fixes a crash in the memory metric sampler.
Install the agent using easy_install/pip/distribute
via the Python Package Index or download it directly from the New Relic download site.
Improvements
Add wildcard matching to instrumentation via config file
The agent now supports wildcards for classes and functions when instrumenting via config file. Note: this does not include module paths.
Bug Fixes
Fix a crash in memory sampling on BSD kernels
A crash in the memory metric sampler was possible when using kernels besides MacOS and Linux. This has been corrected.
Notes
This release of the Python agent includes a bug fix related to middleware and background tasks in Starlette/ FastAPI.
The agent can be installed using easy_install/pip/distribute via the Python Package Index or can be downloaded directly from the New Relic download site.
Bug Fixes
Fix Starlette/ FastAPI transaction naming and classification
Starlette/ FastAPI routes that contained middleware and background tasks were being incorrectly classified as non-web transactions and named after the background task rather than the route. This has been corrected in this release.
Notes
This release of the Python agent updates Sanic instrumentation to support all available versions.
Install the agent using easy_install/pip/distribute
via the Python Package Index or download it directly from the New Relic download site.
Improvements
Update Sanic instrumentation
The agent has updated support for all Sanic versions, with testing done on all versions >=18.12.0. Additionally, blueprint middleware is now supported.
Update Pyramid transaction naming
Previously, transaction names from exception views overrode route names. We've reversed this priority to be more in line with other instrumentation.
Bug Fixes
Fix inspect.formatargspec deprecation warning
A deprecation warning concerning
inspect.formatargspec
has been fixed.Fix HTTPX crash
Initializing the agent after creating an HTTPX client could cause a crash in HTTPX. This has been corrected.
Notes
This release of the Python agent adds support for Flask v2, improves logging for HTTP exceptions, and includes a bug fix.
The agent can be installed using easy_install/pip/distribute via the Python Package Index or can be downloaded directly from the New Relic download site.
New Features
Add support for Flask v2
The agent will automatically instrument error handlers, nested blueprints, and async views.
Improvements
Improve logging for 410 status codes
The agent now logs the content of a data collector response which specifies the reason for a disconnect for 410 status codes.
Bug Fixes
Reintroduce non-PID specific memory metrics
In agent version v6.2.0.156, memory metrics were modified to add the PID to each metric name. This release reintroduces non-PID specific memory metrics.
Notes
This release of the Python agent deprecates the old record_exception
API, replaces the error_collector.ignore_errors
setting, adds a new notice_error
API, adds expected errors functionality, improves the NewRelicContextFormatter, and fixes multiple bugs including a few potential crashes.
The agent can be installed using easy_install/pip/distribute via the Python Package Index or can be downloaded directly from the New Relic download site.
Deprecations
Deprecated
record_exception
APIrecord_exception
has been superseded by the newnotice_error
API. The old API will forward exceptions tonotice_error
with a deprecation warning.Deprecated
error_collector.ignore_errors
settingerror_collector.ignore_errors
has been replaced witherror_collector.ignore_classes
to match other agents. Please update your config files to use the new setting. The old setting will continue to function with a deprecation warning.
New Features
Added new
notice_error
APIThis new API falls much more in line with other language agents.
It also includes expected errors functionality and a status code parameter.
To see all changes, view the documentation for this API.
Added new expected errors feature
This feature implements expected errors as documented here. To enable them, use the following new settings.
Improved Features
Improved NewRelicContextFormatter
Adds new
log_record_to_dict
function to separate logic for JSON serialization and converting to a dictionary, enabling custom formatters to access the data more easily.Custom attributes now attempt JSON serialization by default and fallback to strings, meaning dictionaries and other serializable types are now supported.
Thank you to @chrislawlor and @qvik-olli for your contributions!
error_collector.ignore_status_codes
is now configurable in server-side configurationPreviously this setting was only available in the config file, but is now available via server-side configuration.
Bug Fixes
Infinite tracing crash fix
Crashes had occurred in infinite tracing following the inclusion of some startup timeout changes in v6.0.0. These changes have been rolled back.
RuntimeInstrumentationError crash removed
Crashes occurred when a
RuntimeInstrumentationError
was reached, indicating a potential problem with existing instrumentation. The exception is now caught and replaced with error level log messages to avoid crashing applications.SQLite instrumentation consumes generator objects passed to
executemany
A generator passed to
Connection.executemany
would unexpectedly be consumed by our instrumentation. This has been corrected and generators are now properly supported.
Known Issues
Flask v2.0.0 support
Flask released a new major version recently that we do not yet support, but expect to in the near future.
Sanic support
Sanic has released large changes to the framework recently that have broken some of our instrumentation on certain versions, and can crash the agent on others. We expect to correct these issues in the near future.