Python Agent

Released on: 
Friday, October 11, 2013 - 02:22


This release of the Python agent is an incremental release and includes minor feature changes and enhancements.

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

For a list of known issues with the Python agent see our online help article on the status of the Python agent.

New Features:

  • Use of HTTP proxies over SSL using the HTTP CONNECT tunnelling mechanism is now supported. Set the 'proxy_scheme' to 'http' to invoke this mode. This will become the default in a future version of the agent. If migrating from an older agent version and need to keep the existing behaviour going forward, set 'proxy_scheme' to 'https'. Alternatively, ensure you provide the scheme in the form of a URI as part of the 'proxy_host' setting.

  • Added request queueing support to the instrumentation for the Tornado ASYNC framework. Request queueing times should start showing in the APM Overview page when a front-end web server such as Nginx, has been configured to add the appropriate headers. For more details see our documentation on setting up tracking of queueing time.

  • The 'newrelic.agent.record_exception()' can now be called without actually passing it any exception details. In this case, the details of any current exception being handled will be used instead.

  • Added a new mechanism for automatic discovery of third party instrumentation modules as an alternative to having to list them explicitly in the agent configuration file. Any such instrumentation module should register entry points under the 'newrelic.hooks' group in '' for that package. The entries should be of the form 'target-module = instrumentation-module:function'. When the 'target-module' is imported, the function 'instrumentation-module:function' will be executed and passed the module. Any instrumentation module should then use functions provided by our agent API under 'newrelic.agent' to instrument the module as necessary.

Bug fixes/Improvements:

  • When using the CherryPy web framework, the NotFound, InternalRedirect and HTTPRedirect exceptions if raised are now ignored and not treated as errors.

  • When using the Pyramid web framework, if a view could not be found to handle a request, it could cause the agents' Pyramid instrumentation to fail, causing an exception.

  • When using the Pyramid web framework, the PredicateMismatch exception if raised when trying to resolve a URL to a view handler is now ignored and not treated as an error.

  • Updated the instrumentation for the pywapi module to drop support for the now discontinued Google weather API.

  • Overhauled the mechanisms used to wrap instrumentation around functions to be monitored. When the agent is installed, if the optional C extension module can be compiled and installed, then the new wrappers should have a reduced overhead compared to the pure Python versions of the wrappers otherwise used.

  • Running thread profiles on coroutine (gevent/eventlet) based systems no longer cause a timeout in the UI. Although the UI now no longer times out, as explained in our status of the Python agent documentation, we still however do not generate any results when running thread profiling on coroutine based systems.