Python Release Notes

Python Agent Release Notes

Monday, September 24, 2018 - 15:00 Download

Notes

This release of the Python agent contains bug fixes.

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

  • The creation of sampled events sometimes raised an exception in Python 3

    When more events (Transaction, Transaction Error, Custom, or Span) were created than allowed per harvest period in Python 3, sometimes a TypeError: '<' not supported between instances of 'dict' and 'dict' was raised. This issue has now been fixed.

Tuesday, September 11, 2018 - 10:00 Download

Notes

This release of the Python agent introduces instrumentation for Sanic, and contains bug fixes.

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.

Features

  • Add instrumentation for Sanic framework

    Data is now automatically collected for applications using the Sanic framework. Data for Sanic applications will appear in both APM and Insights. Additionally, cross application tracing and distributed tracing is supported for incoming requests for Sanic applications. In addition to service maps, Sanic applications will now show the calling application in transaction traces. See the instrumented packages page for more details.

Bug Fixes

  • Explain plans were not generated when using psycopg2 named cursors

    When using named cursors in psycopg2, the agent attempted to generate an explain plan using the same named cursor. This resulted in a syntax error when the query was issued to the database. When using the default connection and cursor factories, the agent will now execute the explain query using only unnamed cursors.

  • Convert bytes-like SQL statements to strings before obfuscating

    If a bytes-like object is used instead of a string when making a SQL call, a traceback was seen in the logs with TypeError: cannot use a string pattern on a bytes-like object. This issue has now been fixed.

  • Save settings to MessageTrace objects

    If an external call using an instrumented http external library (for example requests) was used within a MessageTrace, a traceback was seen in the logs with AttributeError: 'MessageTrace' object has no attribute 'settings'. This issue has now been fixed.

Tuesday, July 31, 2018 - 09:30 Download

Notes

This release of the Python agent introduces distributed tracing, adds improvement to our Pyramid instrumentation, adds support for custom CA bundles, and contains bug fixes.

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.

Features

  • Distributed tracing support

    Distributed tracing lets you see the path that a request takes as it travels through your distributed system. By showing the distributed activity through a unified view, you can troubleshoot and understand a complex system better than ever before.

    Distributed tracing is available with an APM Pro or equivalent subscription. To see a complete distributed trace, you need to enable the feature on a set of neighboring services. Enabling distributed tracing changes the behavior of some New Relic features, so carefully consult the transition guide before you enable this feature.

    To enable distributed tracing, add distributed_tracing.enabled = true to your newrelic.ini file or use the environment variable NEW_RELIC_DISTRIBUTED_TRACING_ENABLED=true.

  • Add support for tracing Pyramid tweens

    Pyramid tweens are now automatically timed and added to the transaction detail view. The time spent in a Pyramid tween will be displayed in the transaction breakdown table and in the trace details of a transaction trace.

  • Provide configuration option for custom CA bundle

    Customers can now use the ca_bundle_path configuration option or set the NEW_RELIC_CA_BUNDLE_PATH environment variable to set the path to a local CA bundle. This CA bundle will be used to validate the SSL certificate presented by New Relic's data collection service.

Bug Fixes

  • Custom Insights event data attached to transactions in excess of 100 events were omitted

    The agent may have failed to send custom event data (record_custom_event) to insights when recorded as part of a Transaction containing over 100 custom events. This issue has now been corrected.

Monday, July 23, 2018 - 15:30 Download

Notes

This release of the Python agent removes previously deprecated APIs, and removes support for Python 2.6 and Python 3.3.

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

  • Removed previously deprecated APIs

    The following APIs have been removed:

    • Transaction.add_user_attribute (use Transaction.add_custom_parameter)
    • Transaction.add_user_attributes (use Transaction.add_custom_parameters)
    • wrap_callable (use FunctionWrapper)
  • Removed support for Python 2.6 and Python 3.3

    Python 2.6 and Python 3.3 are no longer supported. Please consider upgrading your application to a supported version of Python in order to continue to receive updates to the Python Agent.

Thursday, July 12, 2018 - 10:00 Download

Notes

This release of the Python agent adds support for Python 3.7 and contains various bug fixes.

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

  • Support Python 3.7

    The New Relic Python Agent now supports Python 3.7.

Bug Fixes

  • Agent raises a KeyError: 'NEW_RELIC_ADMIN_COMMAND' exception causing a crash

    Under certain conditions, using the newrelic-admin wrapper script could cause an application to crash shortly after startup with a KeyError exception. The cause of the crash has been addressed.

  • Agent raises an AttributeError on Python 3 when using WSGI overrides with multiple app names

    When using WSGI environ overrides to specify multiple app names as described in the docs https://docs.newrelic.com/docs/agents/manage-apm-agents/app-naming/use-m... the agent will raise an AttributeError. This error has been corrected.

  • Agent raises an AttributeError exception under rare conditions when halting a trace

    Under certain rare conditions, the agent might raise an exception when trying to trace an external call in a transaction that has been forcibly halted. The cause of the exception has been addressed.

  • Agent raises a RuntimeError exception under particular conditions when using the Tornado r3 instrumentation

    When attempting to yield many times from a wrapped tornado.gen.coroutine when using Tornado's r3 instrumentation, a RuntimeError due to hitting the maximum recursion limit can occur. The cause of this exception has been patched.

Monday, June 11, 2018 - 14:00 Download

Notes

This release of the Python agent contains various bug fixes.

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

  • Improved handling of celery max-tasks-per-child

    Data recorded by the Python Agent may not have been reported when celery was operated with the max-tasks-per-child setting. All data is now reported independent of the max tasks per child setting.

  • Improve support for PyMongo v3.x

    PyMongo v3 added many new methods on the pymongo.Collection object that did not exist in v2. These methods have now been instrumented. Calls to these methods will now appear in APM.

  • Scheduling tasks that run after a transaction ends causes an error

    Coroutines scheduled to execute after a transaction ends using create_task or ensure_future may have caused the runtime instrumentation error and subsequent crash:

    The transaction already completed meaning a child called complete trace after the trace had been finalized.

    Coroutines that execute beyond the end of a transaction will no longer cause an error.

Wednesday, May 16, 2018 - 15:30 Download

Notes

This release of the Python agent contains various bug fixes.

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

  • Do not run explain plans for psycopg2 connections using the async_ kwarg

    As "async" is now a keyword in Python 3.7, psycopg2 now allows "async_" as an alias for its "async" kwarg for psycopg2.connect as of psycopg2 v2.7.4. Previously, explain plans were attempted for these connections and a traceback would be seen in the logs. This has now been fixed.

  • Fix traceback when using callbacks as partials in pika consumers

    When passing a callback that is a functools partial to pika channel consumers, a traceback occurred in some instances. This issue has now been fixed.

  • cx_Oracle database calls that use SessionPool objects were not recorded

    When using the cx_Oracle SessionPool interace, database transactions made through the acquired pool connection may not have been reported. Database transactions that using connections generated by SessionPool are now reported as expected.

  • SQL targets for call statements may contain a period

    For a SQL command like CALL foo.bar(:baz), APM would show metrics under the target name foo instead of the full name foo.bar. This has been fixed.

Wednesday, April 4, 2018 - 12:00 Download

Notes

This release of the Python agent adds the request.uri attribute on transaction events in insights, adds built-in cheroot instrumentation, adds support for recording flask-restful/flask-restplus exceptions, and contains bug fixes.

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.

Improved Features

  • Add request.uri attribute to transaction and error events

    The Python agent will now report request.uri as an attribute on transaction events and error events. To disable this feature, add request.uri to the attributes.exclude list in the newrelic.ini configuration file.

  • Record Flask RESTful and Flask RestPlus exceptions

    Since Flask RESTful and Flask RestPlus handle all errors that are raised in their handlers, these errors were not being captured by the normal Flask instrumentation in the Python agent. Exception handling has now been added for these two components.

  • Add instrumentation hooks for the Cheroot WSGI server

    Any customers using Cheroot with an unsupported application framework will now see data reported in New Relic APM.

Bug Fixes

  • Fix CherryPy ignore by status code for exceptions using reason phrases

    CherryPy accepts string values for HTTPError status (reason phrases). When creating HTTPError exceptions in this way, responses were not properly ignored by status code. Responses generated by HTTPError exceptions using reason phrases are now properly ignored.

  • Using send_file with Flask Compress middleware may have caused an application crash

    When using browser monitoring auto instrumentation on an application using Flask Compress, the use of the Flask send_file helper to send html files resulted in an application crash. This issue has now been resolved.

  • Fix incorrect parenting for traces of coroutines scheduled with asyncio gather/ensure_future

    Coroutines scheduled with asyncio gather/ensure_future may have been reported as being a child of the wrong function. This issue has now been corrected.

Wednesday, March 14, 2018 - 13:30 Download

Notes

This release of the Python agent removes previously deprecated APIs, makes SSL communication with New Relic mandatory, and updates support for aiohttp middleware.

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

  • Removed previously deprecated APIs

    The following APIs have been removed:

    • transaction (use current_transaction)
    • name_transaction (use set_transaction_name)
    • Application.record_metric (use Application.record_custom_metric)
    • Application.record_metrics (use Application.record_custom_metrics)
    • Transaction.notice_error (use Transaction.record_exception)
    • Transaction.record_metric (use Transaction.record_custom_metric)
    • Transaction.name_transaction (use Transaction.set_transaction_name)
  • Deprecate Transaction.add_user_attribute

    Transaction.add_user_attribute has been deprecated in favor of Transaction.add_custom_parameter. Transaction.add_user_attribute will be removed in a future release.

  • Deprecate Transaction.add_user_attributes

    Transaction.add_user_attributes has been deprecated in favor of Transaction.add_custom_parameters. Transaction.add_user_attributes will be removed in a future release.

  • Deprecate wrap_callable

    wrap_callable has been deprecated in favor of FunctionWrapper. wrap_callable will be removed in a future release.

  • Remove data-source admin command

    The platform API (used by newrelic-admin data-source) has been removed. Please use data sources in place of the platform API.

SSL

SSL connections to New Relic are now mandatory

Prior to this version, using an SSL connection to New Relic was the default behavior. SSL connections are now enforced (not overrideable).

AIOHTTP Updates

  • Add automatic tracing of AIOHTTP 3 middleware

    In addition to the old-style middleware previously supported, the AIOHTTP 3 style middleware is now automatically traced as part of the AIOHTTP instrumentation package.

Wednesday, March 7, 2018 - 15:00 Download

Notes

This release of the Python agent includes a fix for security bulletin nr18-07.

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.

Wednesday, February 28, 2018 - 12:00 Download

Notes

This release of the Python agent adds support for AIOHTTP version 3.

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.

Improved AIOHTTP Support

  • Support for AIOHTTP 3

    AIOHTTP major version 3 is now supported by the New Relic Python agent.

Tuesday, February 20, 2018 - 15:00 Download

Notes

This release of the Python agent adds a deprecation warning for customers that disable SSL, and adds bugfixes for supported async frameworks that use asyncio.

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.

Mandatory SSL

  • Disabling SSL connections to New Relic has been deprecated

    SSL connections are enabled by default. In a future release, the option to disable SSL will be removed.

Bug Fixes

  • Using asyncio.gather or asyncio.ensure_future now tracks transaction context

    Prior to this release, using asyncio.gather or asyncio.ensure_future may result in certain traces (such as external calls) not being reported in the transaction. Traces scheduled with asyncio.gather or asyncio.ensure_future from within the context of a transaction should now be properly attributed to the transaction.

Monday, February 5, 2018 - 11:00 Download

Notes

This release of the Python agent contains improvements to the time tracing API as well as bug fixes.

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.

Time Trace API Improvements

  • Time trace APIs (such as function_trace) can now be used with coroutines

    The following decorator APIs can now be used with native coroutines and generators:

    • function_trace
    • database_trace
    • datastore_trace
    • external_trace
    • message_trace
    • memcache_trace

    Example:

    @function_trace(name='my_coroutine')
    async def my_coroutine():
      await asyncio.sleep(0.1)

Bug Fixes

  • gRPC instrumentation used on Python 2.x can cause a memory leak

    When using gRPC on Python 2, gRPC futures would not be garbage collected resulting in a memory leak. gRPC futures will now be garbage collected.

  • Instrumentation for Dropbox v8.0 and newer caused error log messages

    Dropbox client version 8.0 or higher raised instrumentation errors. These errors did not prevent metrics on Dropbox from being sent. These errors have been removed.

  • Values from negated ranges were sometimes added to ignore_status_codes

    Negated status codes not found in the current ignore_status_codes were added if they were part of a range of values. This issue has been addressed.

Tuesday, January 9, 2018 - 10:30 Download

Notes

This release of the Python agent contains security related updates as well as bug fixes.

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.

Security Updates

See the associated security bulletins for custom API parameters in high security mode and for SQL params for SQLite.

Bug Fixes

  • Using the aiohttp client may result in an application crash

    Under certain circumstances, using the aiohttp client may have resulted in an application crash. This issue has been addressed.

  • Database queries made with psycopg2 may not have been recorded

    When using the "with" statement to create a cursor, time spent on database calls may not have been properly recorded. This issue has been addressed.

  • Usage of the pika library resulted in a memory leak

    When using the pika library with New Relic, Channel objects would not be cleared from memory as expected. This would result in abnormally high memory utilization in some cases. The memory leak has now been fixed.

  • DeprecationWarning generated for async/await keywords

    Using the agent may have generated a DeprecationWarning around async/await being reserved keywords. The DeprecationWarning should no longer be generated.

Thursday, November 30, 2017 - 11:00 Download

Notes

This release of the Python agent adds improvements to django instrumentation, improvements to django rest framework instrumentation, and various bug fixes.

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.

Improved Features

  • Enabled reporting of handled exceptions in Django REST Framework

    Exceptions handled by django rest framework are now reported if the resulting response code is not ignored (see ignore_status_codes for details).

  • Add support for the error_collector.ignore_status_codes setting in Django

    Ignoring exceptions in Django was previously limited to the error_collector.ignore_errors configuration option. Ignoring exceptions by response status code is now supported for Django through the use of the error_collector.ignore_status_codes configuration option.

Bug Fixes

  • Servicing aiohttp websocket requests results in an application crash

    Servicing a websocket request in an aiohttp application may have resulted in an application crash when using the New Relic python agent. The application will now operate as expected when handling a websocket request.

  • Ignore incomplete aiohttp transactions

    In aiohttp, connections can be terminated prior to the HTTP response being generated and sent. In those cases, the request handler may be cancelled. These transactions are no longer reported.

  • Fix HTTP status reporting for Tornado transactions

    HTTP status was not properly added to Tornado transaction events and transaction traces. HTTP status is now automatically added to Tornado transaction events in Insights and transaction traces in APM.

  • Fix reporting of concurrent external requests in Tornado

    External requests that execute in parallel in a tornado application may not have been recorded. This issue has been addressed.

Monday, October 16, 2017 - 11:00 Download

Notes

This release of the Python agent adds instrumentation for aiohttp framework, adds support for displaying Heroku dyno names, and various bug fixes.

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 instrumentation for aiohttp framework

    Data is now automatically collected for applications using the aiohttp framework. Data for aiohttp applications will appear in both APM and Insights. Additionally, cross application tracing is supported for incoming requests for aiohttp applications. In addition to service maps, aiohttp applications will now show the calling application in transaction traces.

  • Add support for displaying Heroku dyno names

    Heroku-friendly logic is now applied to how dyno names are displayed. This includes being able to collapse dyno hostnames based on prefix.

Bug Fixes

  • Fix crash for gunicorn gaiohttp driver

    Using gunicorn's gaiohttp worker with New Relic Browser monitoring enabled may have resulted in an application crash. This crash has been fixed and the gaiohttp worker is now fully supported with the New Relic Python Agent.

  • Fix crash for pika versions 0.9.x and earlier

    Using the agent with pika versions 0.9.x and earlier could have resulted in an application crash. This issue has now been fixed.

Tuesday, September 19, 2017 - 13:00 Download

Notes

This release of the Python agent adds instrumentation for aiohttp client.

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 instrumentation for aiohttp client

    Outbound HTTP requests through the aiohttp library are now recorded. aiohttp Cross Application Tracing is now supported for outbound requests. In addition to Service Maps, applications accessed through the aiohttp client will now appear in transaction traces.

Bug Fixes

  • Fix crash when using psycopg2 v2.7 composable queries

    The psycopg2 library introduced a module to generate SQL dynamically (psycopg2.sql) in version 2.7. Passing a Composable type object (psycopg2.sql.Composable) to execute or executemany resulted in an application crash. The agent now correctly handles psycopg2 Composable objects.

Wednesday, September 6, 2017 - 10:00 Download

Notes

This release of the Python agent adds support for monitoring of outbound gRPC requests and adds an API for cross application tracing of custom non-HTTP transports. For details on APIs for cross application tracing see the cross application tracing document.

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 API for cross application tracing of non-HTTP external services

    A new API is now exposed for implementing cross application tracing in custom instrumentation of non-HTTP transport libraries. For usage of this API see the cross application tracing document.


  • Add instrumentation for gRPC client calls

    Outbound gRPC requests will now show up in APM under the External Services tab and in transaction traces.


Bug Fixes

  • Fixes erroneous recording of TastyPie NotFound exceptions

    
When a TastyPie API view raised a NotFound exception resulting in a 404 response, the agent may have erroneously recorded the exception. This has now been fixed.

Monday, July 31, 2017 - 14:00 Download

Notes

This release of the Python agent includes bug fixes and improvements to the builtin pika instrumentation.

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.

Improved Feature

  • Naming of Pika Message Transactions

    This release improves the naming of message transactions . Message consumer transactions are now split based on the name of the consume callback.

  • Improved metadata collection for cloud providers

    The agent now collects additional metadata when running in AWS, GCP, Azure, and PCF. This information is used to provide an enhanced experience when the agent is deployed on those platforms.

Bug Fixes

  • CherryPy WSGI Server automatic instrumentation

    This release fixes a bug where cherrypy.wsgiserver.CherryPyWSGIServer was not being instrumented. This bugfix impacts CherryPy versions v6.1.0 to v8.9.1.

Wednesday, July 12, 2017 - 14:00 Download

Notes

This release of the Python agent includes bug fixes for the pika RabbitMQ library instrumentation.

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

  • Using pika to make RPC-style calls from Tornado could result in an application crash

    When making a remote procedure call from a tornado web application using the pika RabbitMQ library's Tornado connection, it is possible for the tornado web application to crash. Pika Tornado connections no longer result in an application crash.

  • AttributeError generated from an unregistered application starting a MessageTransaction

    Applications which consume message transactions and do not call register_application can raise an AttributeError resulting in an application crash. This issue has now been fixed.

Pages