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.
record_exceptionhas been superseded by the new
notice_errorAPI. The old API will forward exceptions to
notice_errorwith a deprecation warning.
error_collector.ignore_errorshas been replaced with
error_collector.ignore_classesto match other agents. Please update your config files to use the new setting. The old setting will continue to function with a deprecation warning.
This 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.
log_record_to_dictfunction 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.
error_collector.ignore_status_codesis now configurable in server-side configuration
Previously this setting was only available in the config file, but is now available via server-side configuration.
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
RuntimeInstrumentationErrorwas 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
A generator passed to
Connection.executemanywould unexpectedly be consumed by our instrumentation. This has been corrected and generators are now properly supported.
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 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.