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.