Python release notes

Python agent release notes

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.

Thursday, July 6, 2017 - 14:00 Download

Notes

This release of the Python agent adds built-in instrumentation for the pika RabbitMQ library, a message broker API which can be used to add custom instrumentation for additional message brokers, 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

  • Pika Instrumentation

    The RabbitMQ pika library is now automatically instrumented. The agent will report data for messages sent and received by an application. Data on messages is available in both APM and Insights. Applications connected through a RabbitMQ exchange will now also be visible on Service Maps as part of Cross Application Tracing.

  • Message Broker API

    A Message Broker API is now available for use in custom instrumentation. The Message Broker API will send data to APM and Insights (through message.routingKey and message.queueName attributes) for message broker related operations.

  • Tornado 4.5 Support

    The Python Agent's out-of-the-box Tornado 4 instrumentation now supports Tornado version 4.5.

  • Tornado AsyncIO Loop

    In addition to the Tornado PollIOLoop, the AsyncIO loop is now supported as part of our Tornado instrumentation. When Tornado is configured to use the AsyncIO loop, data will now be sent to New Relic. Note that AsyncIO is not yet generally supported.

Bug Fixes

  • SQL comments beginning with a "--" resulted in an improperly parsed query

    When executing SQL queries with comments that used the "--" comment syntax, the database operation and table was not properly parsed resulting in queries being absent from the Databases tab. Queries with "--" comments should now show up in the Database tab.

  • AttributeError generated when using Tornado 4 HTTPRequest objects in an external web call

    When using the Tornado 4 HTTPRequest object as an argument to HTTPClient.fetch, it was possible to generate an AttributeError. The web call now completes as expected.

  • Slow network connections may result in lost data

    When, due to a slow network, a 408 error is returned from New Relic data was not retransmitted. Data is now retransmitted when a 408 is received.

Friday, May 26, 2017 - 11:00 Download

Notes

This release of the Python agent includes various bug fixes as described below.

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

  • Handle exceptions generated by Tornado 4 AsyncHTTPClient during fetch

    Exceptions generated by a call to the AsyncHTTPClient resulted in an agent instrumentation error. Exceptions generated by AsyncHTTPClient are now recorded and properly handled.

  • Using gevent/eventlet on Python 3.6 resulted in a RecursionError

    Python 3.6 introduced a change to the ssl library. This change can result in a recursion error when the New Relic agent imports ssl prior to eventlet/gevent patching the ssl library (as is the case with use of the newrelic-admin script). This recursion error has been fully mitigated.

Tuesday, May 23, 2017 - 12:00 Download

Notes

This release is the same as 2.86.0.65 except it has been re-published to pypi due to an issue with 2.86.1.66.

Wednesday, May 17, 2017 - 14:00 Download

Notes

This release has been superseded. Please use version 2.86.2.68 or higher.

This release of the Python agent includes various bug fixes as described below.

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

  • Handle exceptions generated by Tornado 4 AsyncHTTPClient during fetch

    Exceptions generated by a call to the Tornado 4 AsyncHTTPClient resulted in an agent instrumentation error. Exceptions generated by AsyncHTTPClient are now recorded and properly handled.

  • Using gevent/eventlet on Python 3.6 resulted in a RecursionError

    Python 3.6 introduced a change to the ssl library. This change can result in a recursion error when the New Relic agent imports ssl prior to eventlet/gevent patching the ssl library (as is the case with use of the newrelic-admin script). This recursion error has been mitigated when using newrelic-admin to start applications.

Wednesday, May 3, 2017 - 12:00 Download

Notes

This release of the Python agent includes improvements to our introductory support for Tornado 4 applications 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.

New Feature

  • Tornado 4 Outbound Cross Application Tracing

    Tornado 4 Cross Application Tracing is now supported for outbound web transactions. In addition to Service Maps, Tornado 4 transaction traces will now contain links to the application it called. With this update, Cross Application Tracing is now fully supported for Tornado 4 applications.

Bug Fixes

  • Django 1.10+ browser monitoring with new-style gzip middleware

    Browser monitoring was not automatically inserted when using new style Django 1.10+ gzip middleware. Browser monitoring code is now inserted as expected.

  • Using motor versions 1.X generated instrumentation errors

    Motor 1.0 removed the MotorReplicaSetClient class which resulted in the New Relic Python Agent generating an instrumentation error when attempting to access that class. The instrumentation has been fixed.

Tuesday, April 25, 2017 - 15:00 Download

Notes

This release of the Python agent includes bug fixes and improvements to the precision of the duration data recorded for transaction traces.

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

  • Transaction trace precision

    This release improves the precision of transaction traces. Duration of functions in a transaction trace are now recorded at sub-millisecond precision.

Bug Fixes

  • Custom classmethod traces may incorrectly return the parent class

    Wrapping classmethods in classes that are subclassed could cause the subclassed classmethod to be improperly bound to the parent class. This would result in the classmethod returning an instance of the parent class when the method was called on a child class.

  • Handle incomplete Tornado coroutine traces

    Tracing a Tornado coroutine that never completed and was later garbage collected, could result in an application hang. This has been fixed.

Monday, April 17, 2017 - 15:00 Download

Notes

This release of the Python agent includes a bug fix for our introductory support for Tornado 4 applications.

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

  • Ending Tornado 4 transactions inside of a traced function results in an internal agent error

    Ending a Tornado 4 web transaction within a traced function previously resulted in the generation of an agent traceback. The agent now completes tracing the function before ending the transaction, resulting in the correct reporting of these transactions to New Relic.

Wednesday, March 15, 2017 - 14:00 Download

Notes

This release of the Python agent improves our introductory support for Tornado 4 applications by adding Cross Application Tracing for web transactions that are sent to a Tornado 4 application.

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 Feature

  • Tornado 4 applications will now appear in Service Maps

    Tornado 4 Cross Application Tracing is now supported for inbound web transactions. In addition to Service Maps, the calling application's APM will now have links to the Tornado 4 application it called in the External Services tab and in Transaction Traces.

Bug Fixes

  • Record exceptions outside of view handlers in Django 1.10

    Unhandled exceptions that occurred outside of a view handler in Django 1.10 were not reported. In addition to middleware exceptions, these unhandled exceptions can be generated when a view handler returns a TemplateResponse and rendering that template would result in an exception.

  • Consistent WSGI/Application and WSGI/Response segments

    Prior to this release, the agent would group segments under WSGI/Application and WSGI/Response differently, depending on whether or not browser monitoring was enabled. This has now been made consistent.

  • Improved New Relic WSGI middleware behavior

    The New Relic agent is now resilient when called by non-conforming middleware. Transactions will continue to be reported normally when the New Relic agent is called by WSGI middleware that does not call the close() method as described in the PEP 333 specification.

Monday, February 27, 2017 - 15:15 Download

Notes

This release of the Python agent is a hotfix release to address a problem with the Tornado 4 instrumentation for curl_httpclient introduced in our last release (v2.80.0.60). Under the circumstances described below, calling CurlAsyncHTTPClient.fetch_impl() could result in an agent error.

The agent can be installed using easy_install/pip/distribute via the Python Package Index or can be downloaded directly from our download site.

Bug Fix

  • Fix CurlAsyncHTTPClient.fetch_impl() instrumentation

    If fetch_impl() was called by passing the request argument positionally, but passing callback as a keyword argument, then the agent would throw an error. In practice, this only affected customers who implemented a custom version of fetch_impl(), but for those affected customers, this is now fixed.

Thursday, February 23, 2017 - 13:15 Download

Notes

This release of the Python agent enhances our introductory support for Tornado 4, most notably by adding support for tornado.curl_httpclient.

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

  • Tornado 4 curl_httpclient support

    Previously, the agent's Tornado 4 instrumentation only supported the default tornado.simple_httpclient. With this release, support has been added for tornado.curl_httpclient as well.

  • Tornado 4 ZeroMQ IOLoop support

    Using ZMQIOLoop in place of the default Tornado IOLoop is now supported for Tornado 4 applications.

Improved Feature

  • Improved transaction names for Django REST Framework

    When using the Python agent with Django REST Framework and Python 3, function-based views wrapped with the rest_framework.decorators.api_view decorator would result in transactions with names based on the decorator (WrappedAPIView.handler) rather than names based on the original view function. (This did not affect applications running with Python 2.)

    With this release, the transaction names for these wrapped views are now based on the name of the original view function in both Python 2 and Python 3.

Bug Fix

  • End transactions correctly with Tornado 4 @asynchronous decorator

    When the agent records a transaction for a Tornado 4 RequestHandler method that is decorated with the @tornado.web.asynchronous decorator, the transaction should remain open until RequestHandler.finish() is called. Prior to this release, there were some circumstances where the agent closed the transaction prematurely, resulting in transaction durations that were too short. This has now been fixed.

Wednesday, January 4, 2017 - 14:30 Download

Notes

This release of the Python agent adds support for reporting datastore instance information for the elasticsearch library.

Over the past few releases, support has been added to the agent for collecting datastore instance information for a number of drivers. See a complete list of supported packages.

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 Feature

  • Datastore instance information for elasticsearch

    For operations made using the official Elasticsearch client, the Python agent will collect the host and port of the elasticsearch server. This data will be displayed in transaction traces and in slow query traces in APM.

Bug Fix

  • Cornice 2.3.0 TypeError

    When using the latest version of Cornice,the Python agent would raise a TypeError exception due to not handling the changed signature of cornice.Service.decorate_view(). Earlier versions of Cornice were not affected, and with this release, the Python agent no longer raises an error for version 2.3.0.

Wednesday, December 14, 2016 - 15:30 Download

Notes

This release of the Python agent adds support for reporting datastore instance information for the python-memcached library. It also addresses a couple of Python 3 issues related to naming metrics and transactions.

Over the past few releases, support has been added to the agent for collecting datastore instance information for a number of drivers. See a complete list of supported packages.

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

  • Datastore instance information for python-memcached

    For most memcached operations made using the python-memcached package, the Python agent will collect the host and port of the memcached server, as well as the memcached database index number. This data will be displayed in transaction traces and in slow query traces in APM.

    Supported operations include: add, append, cas, decr, delete, get, gets, incr, prepend, replace, set.

    Currently, the Python agent does not collect instance information for operations that interact with multiple memcached instances. These include: delete_multi, flush_all, get_multi, get_slabs, get_stats, set_multi.

Bug Fixes

  • Names for subclass methods in Python 3

    Previously, when using Python 3, if a method was defined on a base class, but was called as a method on an instance of a subclass, the agent would generate a metric name or transaction name for that method using the base class. It would also use the module name of the base class in the metric or transaction name.

    With this release, the metric name or transaction name will use the class name of the subclass, as well as the module name of the subclass. This is consistent with how the naming works for Python 2.

  • Names for Flask pluggable views in Python 3

    When monitoring Python 3 Flask applications, the agent would create metric and transaction names for Flask pluggable (or, class-based) views using the name of the View.as_view() classmethod, making it impossible to distinguish between different views in APM. Now, the metric and transaction name uses the name that is passed into View.as_view().

    For example, a view defined as view_func=ShowUsersView.as_view('show_users') would use show_users as the view name. This is consistent with how the naming works for Python 2.

  • Redis client with custom connection pool

    If a custom connection pool was used with the redis client, the agent could throw an AttributeError when attempting to gather datastore instance information. One library known to define a custom connection pool that encountered this issue is Redis Blaster. With this release, the agent will no longer throw an error for custom connection pools. In addition, the agent will now be able to gather datastore instance information for some operations, even when using a custom connection pool.

  • Developer Mode error message during "fake" harvest

    When using the configuration setting of developer_mode = True, the agent does not transmit any data to New Relic. Instead, it performs a "fake harvest". In some cases, it was possible for the agent to log an AssertionError during the "fake harvest", but this issue has now been fixed.

Monday, November 14, 2016 - 11:00 Download

Notes

This release of the Python agent adds support for reporting datastore instance information for both the redis and MySQLdb drivers.

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

  • Datastore instance information for redis

    For redis operations made using the redis-py package, the Python agent will collect the host and port of the redis server, as well as the redis database index number. This data will be displayed in transaction traces and in slow query traces in APM.

  • Datastore instance information for MySQLdb

    For queries made with the MySQLdb driver, the Python agent will collect the host and port of the database server, as well as the database name. This data will be displayed in transaction traces and in slow query traces in APM.

Tuesday, October 25, 2016 - 11:00 Download

Notes

This release of the Python agent is a hotfix release to address a problem introduced in our last release (v2.72.0.52) where users of the psycopg2 Postgresql database adapter could see extra Datastore entries in the Breakdown Table on the Transactions page in APM.

The agent can be installed using easy_install/pip/distribute via the Python Package Index or can be downloaded directly from our download site.

Bug Fix

  • Remove extra Datastore segments from the Transactions Breakdown Table

    Due to the extra Datastore segments in the Breakdown Table on the Transactions page in APM, the "% Time" column would add up to greater than 100%. This problem has now been fixed. Users of psycopg2 who are using v2.72.0.52 of the Python agent are encouraged to upgrade to this latest version.

Tuesday, October 18, 2016 - 12:00 Download

Notes

This release of the Python agent adds support for reporting datastore instance information for the psycopg2 Postgresql driver.

The agent can be installed using easy_install/pip/distribute via the Python Package Index or can be downloaded directly from our download site.

New Feature

  • Datastore instance information for psycopg2

    For queries made with the psycopg2 Postgresql driver, the Python agent will collect the host and port of the database server, as well as the database name. This data will be displayed in transaction traces and in slow query traces in APM.

Tuesday, September 6, 2016 - 11:00 Download

Notes

This release of the Python agent adds support for the improved Django middleware introduced in Django v1.10, and also adds instrumentation for the boto3 and awscli packages.

The agent can be installed using easy_install/pip/distribute via the Python Package Index or can be downloaded directly from our download site.

New Features

  • Django 1.10 Middleware Support

    As described in Django Enhancement Proposal 5 and in the Django v1.10 middleware documentation, Django introduced a new style of middleware in version 1.10. Previously, Django allowed you to define certain methods on middleware classes: process_request() methods would run before the view handler was invoked, and process_response() methods would run after the response was generated. Accordingly, the Python agent would instrument these as separate, self-contained methods, and in the Transaction Trace Details view, they would be displayed at the same level as the view handler in the segments hierarchy.

    With the improved version in Django v1.10, the middleware classes form a "chain", and each middleware calls the next middleware, until it reaches the end of the chain and calls the actual view. This means that new-style middleware acts as a wrapper, and each one is nested inside the previous one. As a result, in the Transaction Trace Details view, each middleware will be nested inside the previous one, and the actual view handler will be displayed nested inside the innermost middleware class. Furthermore, the duration of each middleware segment will include the duration of the middleware nested inside it.

    Because Django v1.10 is backwards-compatible with the old-style middleware, the agent also supports instrumenting old-style middleware in Django v1.10

  • Boto3 and AWS CLI Support

    With this release, API calls to Amazon Web Services endpoints made with the boto3 and awscli packages will be recorded as External Traces and will be visible in the External Services tab in APM. This is achieved by instrumenting the botocore library, which both boto3 and awscli utilize.

Bug Fixes

  • Proxy Scheme Output of network-config Command

    Prior to this release, the newrelic-admin network-config command would output the incorrect proxy scheme. That is now fixed.

  • Debug Console Works with Python 3

    The newrelic-admin debug-console is now compatible with Python 3.

Tuesday, July 19, 2016 - 10:30 Download

Notes

This release of the Python agent is a bug fix release that addresses several recently reported issues.

The agent can be installed using easy_install/pip/distribute via the Python Package Index or can be downloaded directly from our download site.

Bug Fixes

  • WebSocket requests could cause application errors

    When an application is using gevent-websocket to serve a mixture of WSGI and WebSocket endpoints, it is possible for WebSocket requests to interfere with the instrumentation of non-WebSocket requests, and cause application errors. While a fix for this has been added to the 'gevent-websocket` main branch, that fix has not been released to PyPI yet. To address the problem now, the Python agent explicitly ignores WebSocket requests.

  • Disabling browser monitoring inadvertently disabled other features

    Disabling browser monitoring had the unintended effect of disabling certain other Response-related features of the agent. Specifically, the response.status attribute was not recorded, and the Cross Application Tracing headers were not added to the HTTP headers of the outgoing response. With this release, those features now work when using the configuration setting of browser.monitoring.enabled = False.

  • Calling a Celery task within another task could cause a RuntimeError

    The Python agent would throw a RuntimeError('transaction already active') when instrumenting a Celery task that performed the following combination of actions:

    1. Utilized the agent API to end the transaction early (end_of_transaction), or to ignore the transaction altogether (ignore_transaction).
    2. After ending or ignoring the transaction, called another Celery task that would run synchronously.

    This scenario, which most commonly occurs when taking advantage of Celery Workflows to compose multiple tasks together, will no longer result in a RuntimeError.

Thursday, May 26, 2016 - 10:30 Download

Notes

This release of the Python agent is a bug fix release that addresses several outstanding issues. In addition, the agent's instrumentation for the Pyramid web framework was updated to handle changes introduced in version 1.7 of Pyramid.

The agent can be installed using easy_install/pip/distribute via the Python Package Index or can be downloaded directly from our download site.

For a list of known issues with the Python agent, see Status of the Python agent.

New Feature

  • Support for Pyramid 1.7

    In version 1.7 of the Pyramid web framework, the ViewDeriver class was removed and replaced with a custom view pipeline, composed with view derivers. This required a change to where the agent applied it's instrumentation, since we were previously instrumenting the ViewDeriver class.

Bug Fixes

  • Gevent and Python 3.4+

    When running the agent with gevent in Python 3.4+, the agent would throw an AttributeError when accessing the _sleep attribute in the threading module, which was removed in Python 3.4. The agent now handles this properly.

  • Possible missing application exceptions in APM Error Analytics

    Using the record_exception() API, it is possible to record an exception against the application, but outside of a transaction. If there was a time window in which no transaction exceptions were recorded, but only application exceptions were recorded, then no exceptions would be displayed when viewing that time window in APM Error Analytics. With this release, application exceptions show up as expected, whether or not transaction exceptions were also recorded.

  • CherryPyWSGIServer and keyword arguments

    Previously, the agent would fail to instrument CherryPyWSGIServer correctly when it was initialized using keyword arguments. That is now handled correctly.

  • Missing attributes in Transaction Events

    In version 2.60.0.46 of the agent, two response header attributes were renamed, but they were not added to Transaction Events as they should have been.

    • response.headers.contentLength
    • response.headers.contentType

    These attributes are now included in Transaction Events.

Changed Feature

  • Capture port for all HTTP requests to External Services

    Prior to this release, the agent would capture the port for HTTP requests to external services for only some of the HTTP libraries that the agent instruments. Notably, the port was missing when using these libraries directly: httplib, httplib2, and urllib3. The agent now captures the port for these libraries.

Pages