Changelogs » Newrelic

Newrelic

5.2.1.129

This release of the Python agent includes 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


Fix a crash when using a future based interfaces on Tornado's http client

Tornado's http client returns a future when fetch is called. Prior to this release, the agent caused a coroutine object to be returned rather than a future, causing a potential crash when application code assumed a future would be returned. A future will now be returned from http client fetch as expected.
Fix a crash when running a coroutine created in another transaction

When running a coroutine outside of the transaction which created it, the agent may have crashed if a separate transaction was active.

5.2.0.127

This release of the Python agent includes a bug fix for tornado and support for recording deployment markers in the EU region as well as specifying a deploy timestamp.

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


Added timestamp and EU region support for recording deployment markers

When using the newrelic-admin record-deploy script an optional timestamp can be provided to specify when the deployment marker should be created.  Furthermore support for accounts in the EU region have been added in this release.


Bug Fixes


Fixed a crash in tornado versions >= 6.1

Tornado 6.1 internals changed in a way that may have caused the agent's built-in instrumentation to fail. The instrumentation has been updated to alleviate this issue.

5.0.2.126

This release of the Python agent includes bug fixes for feedparser and django-piston.

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


Fixed a crash when using feedparser

When running with the feedparser library the agent would crash on attempting to parse an RSS feed. This issue has now been corrected.
Fixed a crash when using django-piston

When running with the django-piston library the agent would crash on attempting to service a request. This issue has now been corrected.

5.0.1.125

This release of the Python agent includes a bug fix for the mako 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


Fixed a crash when using the Mako template library

When running with the Mako template library the agent would crash on attempting to render a template. This issue has now been corrected.

5.0.0.124

This release of the Python agent introduces:


Event loop diagnostics feature
Tornado instrumentation for versions 6 or higher
Improved context manager API functionality and interfaces


This release also drops support for Python 3.4.

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.

Event loop diagnostics

Introducing event loop diagnostics for asyncio! The Python agent can now surface information about transactions that block the event loop. The agent will be able to generate information about transactions that have waited a significant amount of time to acquire control of the event loop.

Event loop diagnostic information will be available in both APM and via NRQL query.

Event loop metrics will appear in the transaction Breakdown table:



Time spent waiting on other transactions will be shown in the transaction Trace details page, as shown here:



eventLoopTime and eventLoopWait attributes will be available via NRQL query. An example query might be:
SELECT count(*) as 'count', average(eventLoopTime) as 'loopTime', average(eventLoopWait) as 'loopWait' FROM Transaction facet name

In New Relic Insights, this might show a result like this:



Diagnostics will be available by default through our existing aiohttp, sanic, and Tornado instrumentation. Diagnostic information will also be available for coroutines that use our background_task and web_transaction decorator APIs.

Tornado 6 Instrumentation

Instrumentation for Tornado framework version 6.x is supported without any feature flags. Support for versions earlier than Tornado 6.x has been dropped.  The Tornado web server, framework, and http client are instrumented and information will show up in both APM and insights.

Important: Using the tornado.gen.coroutine with instrumentation is not supported. Any usage of tornado.gen.coroutine should be replaced with an asyncio coroutine.

Before

class MainHandler(tornado.web.RequestHandler):
tornado.gen.coroutine
def get(self):

yield gen.sleep(0.2)


After

class MainHandler(tornado.web.RequestHandler):
asyncio.coroutine
def get(self):

yield from gen.sleep(0.2)


Improved APIs for time trace context managers

Context managers (such as FunctionTrace, ExternalTrace, DatastoreTrace) may now be used from within asyncio coroutines! Additionally, the transaction argument is no longer used for any context manager API.  In order to transition to the new API, the transaction argument must be removed.

Before

transaction = newrelic.agent.current_transaction()
with newrelic.agent.FunctionTrace(transaction, "my_trace"):
pass


After

with newrelic.agent.FunctionTrace("my_trace"):
pass


Updated WebTransaction context manager

The WebTransaction context manager is no longer WSGI dependent. The context manager takes generic HTTP arguments, which you can use to build web transactions that appear in the APM product. For more information, see our API documentation.

4.20.1.121

This release of the Python agent includes bug fixes, deprecations, and improved naming behavior for gRPC.

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.

Feature Enhancements


Improved gRPC support

The external and transaction pages now show the gRPC method being called in addition to the host and port.
Ability to disable sending db.statement as part of traces

When db.statement is added to either attributes.exclude or transaction_segments.attributes.exclude, the value will now no longer be sent to New Relic as part of transaction traces or spans.


Deprecations


TransactionContext API is now deprecated

The TransactionContext API will be removed in a future release.
Tornado instrumentation + feature flag deprecation

The existing introductory support for Tornado and feature flags will be removed from a future release. Versions 6.x and newer will be the only versions of Tornado supported in future releases. See this discussion on the New Relic forums for more details.


Bug Fixes


Fixed a crash when using uvicorn workers with gunicorn

When running ASGI applications with gunicorn, the agent would attempt to instrument the application as a WSGI application, resulting in a crash. The agent will no longer attempt to instrument gunicorn applications that are coroutines.
Remove logging of license keys

The agent logged license keys when data failed to send to New Relic. The agent will no longer log license keys to the agent logs under any circumstance.
Fix operation of distributed tracing and cross application tracing when httplib connections are reused

When making multiple requests via a single connection with httplib, httplib2, or urllib3, the proper headers will be added to each outgoing request. As a result, cross application tracing and distributed tracing will now operate as expected when reusing connection objects.

4.20.0.120

This release of the Python agent includes bug fixes and adds new API methods to retrieve the current trace ID and current span ID.

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


Added a new API to retrieve the current trace ID

Retrieving the current trace ID can now be accomplished with a call to newrelic.agent.current_trace_id(). This method will return the id of the current trace, or None if no transaction is in progress.
Added a new API to retrieve the current span ID

Retrieving the current span ID can now be accomplished with a call to newrelic.agent.current_span_id(). This method will return the id of the current span, or None if no span is in progress.


Bug Fixes


Exclusive time incorrectly displayed when using concurrent asyncio

The New Relic UI may have shown times equaling greater than 100 percent of the total time when executing concurrent tasks in asyncio. The exclusive times reported by the agent will now be correctly displayed in APM and insights.

4.18.0.118

This release of the Python agent adds improvements to the gRPC instrumentation package and includes 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


Improved gRPC support

Support for measuring inbound gRPC requests has now been added. Inbound gRPC requests will now show as web transactions in APM. Additionally, distributed tracing is now supported as part of the gRPC instrumentation package.


Bug Fixes


Update pika instrumentation to support the 1.x releases

When using the agent with pika versions 1.x and up, the agent may have caused an application crash. The agent now correctly collects data on newer versions of pika.
The startup_timeout setting may not have been honored in a multithreaded application

When startup_timeout is set to a number greater than 0, the servicing of transactions is blocked until the agent has fully activated. In multithreaded applications, only the first thread would block due to improper locking. The agent will now block on all threads.

4.16.1.117

This release of the Python agent fixes a memory leak that occurs on Python 2 when monitoring WSGI 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


Fix memory leak on Python 2 WSGI applications

When using the 4.16.0 agent on Python 2 to monitor WSGI applications, the agent would cause memory to be allocated on each request. On Python 2, this memory was never deallocated due to a reference cycle. This has now been corrected.

4.16.0.116

This release of the Python agent adds support for native coroutines and generators with a new web_transaction API, as well as bugfixes.

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 a new web_transaction API

This method is now exposed both as a public API through newrelic.agent.api.wrap_web_transaction, and as a decorator with newrelic.agent.api.web_transaction. It can be used to instrument non-WSGI web transactions. For usage of this API see https://docs.newrelic.com/docs/agents/python-agent/python-agent-api/webt...


Bug Fixes


The presence of unicode values in a SQL query on Python 2 may cause an application crash

The agent was not properly handling unicode values when recording SQL queries in Python 2. As a result, the presence of unicode values in SQL queries in Python 2 applications may have resulted in an application crash. Unicode values in Python 2 SQL queries are now properly handled.
The Python Agent may have improperly biased the random sampling of distributed traces

Distributed traces are randomly sampled across services. The agent is responsible for propagating the state of its sampling decision to other services. In propagating that decision, an improper sampling bias may have been introduced in downstream services.
The agent will no longer report the command arguments used to start newrelic-admin

The agent previously reported the startup command and arguments when using newrelic-admin run-program and newrelic-admin run-python. The command and arguments are no longer sent to New Relic. This data may continue to be logged to the agent log files when debug level logs are enabled.

4.14.0.115

This release of the Python agent adds support for native coroutines and generators with the background task API and adds support for Kubernetes detection.

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


background_task can now be used with coroutines

The background_task decorator API can now be used with native coroutines and generators.

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

Add support for collection of Kubernetes metadata

The agent will now collect environment variables prefixed by NEW_RELIC_METADATA_ as additional metadata. Some of this metadata may be added to Transaction events to provide context between your Kubernetes cluster and your services. For details on the benefits (currently in beta) see this blog post.

The agent now also collects the KUBERNETES_SERVICE_HOST environment variable to detect when the application is running on Kubernetes. The data is used to link the application to the host machine when using the New Relic infrastructure product.


Bug Fixes


Using time trace decorators allowed coroutines to become Iterables and generators to become awaitables

When using time trace decorators native coroutines were converted to iterables. Additionally generators were converted to awaitables. The behavior of generators, native coroutines, and awaitable generators is now unchanged when using time trace decorators.

4.12.0.113

This release of the Python agent extends support of Amazon's boto3 library and includes 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


AWS operation and request ID will now be reported in transaction traces and
spans when using boto3 and botocore.

The agent will now report aws.requestId and aws.operation for all calls
to AWS made using botocore and boto3.
DynamoDB calls are now reported under the Databases tab.

The agent will now record DynamoDB query performance in the Databases tab in
APM in addition to table name for the following calls:


put_item
get_item
update_item
delete_item
create_table
delete_table
query
scan

Certain SQS calls will now report additional data for spans and transaction
traces.

The agent will now record the queue name in spans and transaction traces for
the following SQS calls:


send_message
send_message_batch
receive_message

SNS publish will now report additional data for spans and transaction traces.

The SNS topic, target, or the string literal PhoneNumber will be reported to
New Relic inside of spans and transaction traces.
The full URL path will now be recorded on span events and transaction traces
when using boto3 or botocore.

The agent will now record the full URL path for API calls made to AWS through
the boto3 / botocore libraries. The path will be available through span
events and transaction traces.


Bug Fixes


Using newrelic-admin to start a GunicornWebWorker with an aiohttp application factory
resulted in an application crash.

The agent would fail to start if using the newrelic-admin command to start an
aiohttp application factory with GunicornWebWorker. This issue has now been
fixed.

4.10.0.112

This release of the Python agent adds support for excluding attributes from span events and transaction trace segments, adds a new api called add_custom_parameters, and includes 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.

Features


Add ability to exclude attributes from span events and transaction trace segments

This release adds support to exclude attributes (such as http.url) from span events (via the span_events.include/span_events.exclude options) and from transaction segments (via the transaction_segments.include/transaction_segments.exclude option).

As with other attribute destinations, these new options will inherit values from the top-level attributes.include/attributes.exclude settings. See the documentation for more information.
Add public add_custom_parameters API

The method add_custom_parameters on Transaction is now exposed through newrelic.agent.add_custom_parameters


Bug Fixes


Transaction counts were not reported for aiohttp's built-in error pages

When a built-in error route was reached in aiohttp (such as a 404 due to a missing route), transactions were not recorded. As a result, the transaction counts may have been artificially low. aiohttp system route traffic will now be reported.
aiohttp cross application tracing linking to non-Python applications may have been omitted if using multidict<3.0

For aiohttp users using multidict versions less than 3.0, cross application tracing HTTP headers may have been generated in a way that was incompatible with non-Python applications. Headers are now generated in a format compatible with all New Relic agents.
aiohttp 3.5.x versions generated agent instrumentation errors

The agent previously failed to instrument aiohttp applications running versions 3.5.0 and greater. The agent now supports aiohttp versions up to 3.5.1.

4.8.0.110

This release of the Python agent adds support for Falcon framework, and includes 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.

Features


Add support for Falcon web framework

This release adds support for the Falcon web framework. Data will now be automatically collected for applications using Falcon framework. The data will appear in both APM and Insights and will include performance details as well as information on application errors.


Bug Fixes


"newrelic-admin record_deploy" now functions with proxies.

The newrelic-admin record_deploy command previously did not function when a proxy was defined by the newrelic.ini configuration file or the NEW_RELIC_PROXY_* environment variables. This bug has now been fixed.
Cross Application Tracing HTTP response headers were inserted on a 304 response

When cross application tracing is enabled and the agent received a HTTP request from an application utilizing cross application tracing, the agent may have inserted additional response headers on a 304 HTTP response. The agent will no longer insert headers on a 304 response.

4.6.0.106

This release of the Python agent includes changes to the agent to enable monitoring of Lambda functions, improves the built-in Sanic instrumentation, and includes 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.

Features


Monitoring of Lambda functions

This release includes changes to the agent to enable monitoring of Lambda functions. If you are interested in learning more or previewing New Relic Lambda monitoring please email lambda_previewnewrelic.com.
Improve naming of Sanic HTTPMethodView view handlers

Sanic views that were defined using the HTTPMethodView class were previously all named HTTPMethodView.as_view.<locals>.view regardless of the actual class in use. The agent will now name transactions after the actual view handler class.


Bug Fixes


Fix ignored error reporting in CherryPy instrumention

When missing query parameters, unexpected query parameters, unexpected positional arguments, or duplicate arguments were present in the CherryPy framework, a TypeError exception was recorded even when an ignored response status code (such as a 404) was generated. An error is no longer recorded when it results in the generation of an ignored status code.
Excluding request.uri from transaction trace attributes hides it in the UI

When request.uri is added to either attributes.exclude or transaction_tracer.attributes.exclude, the value will now no longer be sent to New Relic.
Ability to disable sending request.uri as part of error traces

When request.uri is added to either attributes.exclude or error_collector.attributes.exclude, the value will now no longer be sent to New Relic.
Fix tracing of functions returning generators

When tracing generators whose parent traces have ended an error was seen in the logs "Transaction ended but current_node is not Sentinel." This has now been fixed.

4.4.1.104

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.

4.4.0.103

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.

4.2.0.100

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.

4.0.0.99

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.

3.4.0.95

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.

3.2.2.94

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.

3.2.1.93

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.

3.2.0.91

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.

3.0.0.89

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.

2.106.1.88

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.

2.106.0.87 insecure

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.

2.104.0.86 insecure

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.

2.102.0.85 insecure

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.

2.100.0.84 insecure

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.

2.98.0.81 insecure

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.

2.96.0.80 insecure

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.

2.94.0.79 insecure

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.

2.92.0.78 insecure

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.

2.90.0.75 insecure

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.

2.88.1.73 insecure

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.

2.88.0.72 insecure

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.

2.86.3.70 insecure

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.

2.86.3.69 insecure

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.

2.86.2.68 insecure

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.

2.86.1.66 insecure

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.

2.86.0.65 insecure

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.

2.84.0.64 insecure

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.

2.82.1.63 insecure

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.

2.82.0.62 insecure

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.

2.80.1.61 insecure

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.

2.80.0.60 insecure

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.

2.78.0.57 insecure

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.

2.76.0.55 insecure

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.

2.74.0.54 insecure

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.

2.72.1.53 insecure

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.

2.72.0.52 insecure

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.

2.70.0.51 insecure

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.

2.68.0.50 insecure

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:


Utilized the agent API to end the transaction early (end_of_transaction), or to ignore the transaction altogether (ignore_transaction).
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.

2.66.0.49 insecure

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.

2.64.0.48 insecure

This release of the Python agent is a bug fix release which improves our introductory support for instrumenting Tornado 4 applications. Full details about the status of our Tornado 4 support can be found on our Introductory Tornado 4 support page.

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


New attributes captured for Tornado 4 applications

The following attributes are now captured for requests made to Tornado 4 applications:


request.headers.accept
request.headers.host
port



Bug Fixes


Potentially too many metrics created for tornado.httpclient function traces

The tornado.httpclient instrumentation for Tornado 4 applications could cause a "metric grouping issue" in the function traces it created, if it was used to make requests to a large number of unique URLs. To address this issue, the URL is no longer included in the name of the function trace.
Transactions in Tornado 4 applications could be created with invalid agent settings

In the prior release, if a transaction started before the agent had completed registration with the collector, the transaction could have invalid settings, which would result in various errors in the agent log, including an AttributeError when an external call was made during the transaction. These errors only happened at application startup until registration was complete. With this release, transactions cannot start with invalid settings.
The httplib2 instrumentation did not process the cross application tracing headers in the response

Failing to process the response headers resulted in the inability to link to cross application tracing details in the Transaction Trace Details view, as well as missing ExternalTransaction and ExternalApp metrics. Now, the httplib2 instrumentation in the agent processes the cross application tracing headers correctly.


Known Tornado 4 Limitations Addressed


Explain plans for queries made with psycopg2's "async mode" are disabled automatically

Currently, the Python agent does not support explain plans for queries made in psycopg2's "async mode." In the prior release, it was necessary to add the configuration setting transaction_tracer.explain_enabled = false to disable explain plans, or else errors would occur during data harvest, potentially causing loss of data. With this release, the agent disables explain plans automatically when async mode is detected.
Added support for Synthetics Transaction Traces

Tornado 4 applications will now recognize incoming requests from Synthetics and generate transaction traces for Synthetic requests.


Status of Tornado 4 Support

A current list of known limitations can be found on our Introductory Tornado 4 support page. No new known limitations have been added since our introductory release (v2.62.0.47). In the next few releases, we plan to continue addressing these issues.

2.62.0.47 insecure

This release of the Python agent adds introductory support for instrumenting Tornado 4 applications.

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


Introductory Support for Tornado 4. (See below for details.)


Bug Fix


Django Template Tags for Browser Monitoring Fixed for Django 1.9


For manual insertion of the browser monitoring javascript for page load timing, the Python agent offers two Django template tags: newrelic_browser_timing_header and newrelic_browser_timing_footer.

Starting in Django version 1.9, the output of simple_tag is now escaped, which results in the browser monitoring javascript being included as escaped text in the HTML output. To fix this issue, the agent now uses django.utils.safestring:mark_safe() to prevent automatic escaping for these two template tags.

Introductory Support for Tornado 4

New Relic is pleased to announce introductory support for Tornado 4. While not all features are supported at this point, providing it at an early stage allows interested customers to preview our Tornado 4 support, and provide feedback on what works well and what doesn't.


We strongly advise running the introductory Tornado 4 instrumentation in a testing or staging environment before considering using it in a production environment.


For detailed information about the introductory Tornado 4 support, including Supported Features, Design Decisions, and Known Limitations, see Introductory Tornado 4 support.

Status of Tornado 4 Support

The following is a list of known limitations for our Tornado 4 support as it exists in the current version of the agent. In the next few releases, we plan to address these issues.


If you use psycopg2 in aynchronous mode, you must disable explain plans in the Python agent, or else the agent will throw an error when it attempts to run an explain plan query. Add this setting to your newrelic.ini configuration file:

transaction_tracer.explain_enabled = false

Metric names should be more consistent. For a method of a class, the metric name should contain both the name of the class and the method, but sometimes, the metric name will be missing the class name.
The nesting of segments in a Transaction Trace should be improved. Right now, transaction traces give a good indication of the order that callbacks run on the IOLoop, but they do not group together callbacks that belong to the same coroutine, nor do they show how callbacks relate to each other.
Transaction Traces mislabel time spent in "Application code". Because the Tornado 4 instrumentation traces all callbacks that run on the IOLoop, nearly everything that happens in a transaction is recorded. Very little is uninstrumented "Application code". When you see "Application code" time in a transaction trace, that usually means that the IOLoop was either busy running callbacks belonging to another transaction, or was waiting and not doing any work. This will be made clearer in a future release.
In the current version of the agent, the Total Time for a transaction will always equal the duration of the transaction. In future versions, we may begin measuring the time spent waiting for asynchronous External Traces and Datastore Traces to return results, which will increase the Total Time for a transaction, making it possible to have a Total Time greater than the duration of the transaction.
When using tornado.httpclient, no Cross Application Tracing headers are added to the outgoing requests. (This is true for both HTTPClient and AsyncHTTPClient.) That means that the application that the httpclient connects to will not show up in any of the following: trace maps, transaction maps, and service maps.
Asynchronous External Traces only trace the initial HTTP connection. They do not trace the time for the response to come back.
If you monitor your Tornado 4 application with Synthetics, the Python agent will not capture transaction traces for Synthetics checks, so you will be unable to connect your Synthetics results to APM transaction traces.
Measuring thread utilization is disabled for Tornado applications.
Exceptions thrown in RequestHandler.initialize() are not recorded.
Use of Tornado's built-in multi-process mode to start multiple processes and have them all share the same port is untested and unsupported.
Use of tornado.wsgi.WSGIAdapter and tornado.wsgi.WSGIContainer is untested and unsupported.
Use of tornado.platform.asyncio to bridge between asyncio and Tornado IOLoop is untested and unsupported. Currently, the agent only supports the use of the tornado.ioloop.IOLoop.
Use of the async and await keywords is untested and unsupported.
Integration with Twisted is untested and unsupported.

2.60.0.46 insecure

This release of the Python agent enables the ability to add Custom Insights Events through a new record_custom_event() API.

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


Custom Insights Events


Prior to this release, the Python agent had the capability to record two types of Insights events automatically: Transaction and TransactionError events. In addition, custom attributes could be added to those events. Now, with the addition of the record_custom_event() API, it is possible to define your own custom event types, enabling greater flexibility about what types of events you can view and query in Insights.

For details, see the Insights documentation on Inserting Custom Events.

Changed Feature


Attributes renamed


Two attributes have been renamed, in order to be consistent with the naming convention of other New Relic agents. The affected attributes are:


response.headers.contentLength (was response.contentLength)
response.headers.contentType (was response.contentType)

2.58.2.45 insecure

This release of the Python agent is a hotfix release to address a problem where the agent could fail to validate the SSL certificate of the New Relic collector in some environments.

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.

Bug Fix

If the Python agent was used in an environment where the certifi package was installed, the Python agent would use the certifi CA certificates bundle to validate the certificate of the New Relic collector. However, the latest release of certifi (November 20, 2015) removed some older CA certificates with 1024-bit keys.

The SSL certificate for the New Relic collector is cross-signed with both a 1024-bit certificate and a 2048-bit certificate, but in some circumstances, the stronger root certificate was not used for validation. When the 1024-bit certificate was no longer included in the certifi bundle, SSL validation would fail. Affected customers would see warnings in their agent log stating "Data collector is not contactable" due to an SSLError.

To address this issue, the agent no longer uses the certifi CA certificates bundle, nor the certificates bundled with requests. Instead, it only uses the CA bundle included with the agent to validate the New Relic collector certificate.

2.58.1.44 insecure

This release of the Python agent is a hotfix release to address a problem where the package failed to install under certain circumstances.

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.

Bug Fix

The README.rst file contained non-ASCII characters, which could result in a UnicodeDecodeError during installation. Those characters have been removed.

2.58.0.43 insecure

This release of the Python agent reports error events to Insights and captures enhanced error data to support the new Advanced Error Analytics feature 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.

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

New Feature


Error Events


The Python agent now sends TransactionError events for Advanced Error Analytics, which power the new APM Errors functionality (currently in Beta). This allows users to create charts that facet and filter their error data by attributes, as well as explore their error events in Insights. For details, see the APM Errors documentation.

Changed Feature


Additional Attributes collected


The agent now collects additional attributes for web transactions:


HTTP request headers:  Host and Accept
HTTP response header :Content-Length


Bug Fix


Improved unicode support for exception messages


Unicode exception messages will still be preserved, even if sys.setdefaultencoding() has been called to change the default encoding.

2.56.0.42 insecure

This release of the Python agent adds much more flexibility around what attributes are sent to New Relic, and where they are displayed.

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


Flexible capturing of attributes


Attributes are key-value pairs that contain additional information to be added to an event or transaction. These key-value pairs can be viewed within transaction traces in New Relic APM, traced errors in New Relic APM, transaction events in Insights, and page views in Insights.

A number of new configuration settings have been introduced to allow you to customize exactly which attributes will be sent to each of these destinations.

For details, see Python agent attributes.

Deprecated Settings

Several configuration settings have been deprecated. The most commonly used of the deprecated settings are capture_params and ignored_params. It is still possible to achieve the same functionality as the old settings by using the new attributes.include and attributes.exclude settings. For examples, see Python agent attribute examples.

A complete list of deprecated settings can be found in deprecated configuration settings.

While the usage of  deprecated settings is still supported, we recommend upgrading your configuration to use the new settings as soon as possible.

Changed Feature

Previously, it was possible to save a list, dict, or tuple as an attribute value that could be displayed in transaction and error traces. However, these same attributes could not be displayed in Insights events. Now, all attributes are handled in a consistent manner, which means that all attribute values must be one of the following types:

Python 2: str, unicode, int, long, float, bool
Python 3: str, bytes, int, float, bool


All values which are not one of these types are automatically converted by calling str(value).

2.54.0.41 insecure

This release of the Python agent adds the ability to strip exception messages from error traces, in order to prevent the inadvertent capture of sensitive information.

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 Features


Exception Message Whitelisting


Because an exception message can contain sensitive information, the agent now provides the ability to strip exception messages before sending error traces to APM. Exception messages will be stripped automatically in high security mode. For exception messages you know to be safe, you can add them to a whitelist so that those messages are passed unaltered to APM. Two new configuration settings control this feature: strip_exception_messages.enabled and strip_exception_messages.whitelist.

Bug Fixes


capture_request_params API disabled for high security mode


When operating in high security mode, the agent should not capture query string parameters. However, prior to this release, it was possible to call newrelic.agent.capture_request_params(flag=True), even if the agent was in high security mode, and the agent would capture and report query string parameters. Now, the capture_request_params API call does not override the capture_params setting when the agent is in high security mode, so query parameters are not captured.

2.52.0.40 insecure

This release of the Python agent adds the ability to customize the hostname displayed in the APM UI, as well as updating the solrpy and pysolr instrumentation so that Solr metrics will now appear in the Databases tab in the UI.

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 Features


Customize hostname displayed in APM


A new configuration setting has been added: process_host.display_name. When set in the newrelic.ini configuration file, the display name will be used in the APM UI, in place of the hostname that the agent automatically captures. In addition, the display name can be set using the NEW_RELIC_PROCESS_HOST_DISPLAY_NAME environment variable.

Features Changed


Update solrpy and pysolr instrumention


Previously, solrpy and pysolr instrumentation reported metrics in the Solr namespace. Now, to align them with our recent changes to SQL and NoSQL instrumentation, solrpy and pysolr have been updated to report metrics in the Datastore namespace, which means that time spent in calls to Solr will be listed in both the main overview chart, as well as in the Databases tab in the UI.

2.50.0.39 insecure

This release of the Python agent adds support for Django 1.8.

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 Features


Support for Django 1.8.


Features Changed


The list of modules loaded by the application will no longer include version numbers. In certain cases, attempting to determine the version numbers of packages can potentially generate excessive CPU overhead, so it has been preemptively disabled to prevent any such occurrence.


Bugs Fixed


When using the psycopg2 Postgres database adapter, if the pscyopg2.extras.register_json() function was used, then instrumentation for the psycopg2 module would fail. Now, register_json() is instrumented correctly.
If a Django class based view was registered as the view handler in urls.py, the transaction was named after the class name, and not the method of the class based view which handled the request. Now, the transaction is named after the method.

2.48.0.38 insecure

This release of the Python agent adds instrumentation for Elasticsearch as a new datastore product and a more granular breakdown of various SQL operations in the “Databases” tab in the APM UI. In addition, the stack traces captured by the agent are now being trimmed to remove any code snippets.

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 Features


Improved SQL Breakdown

This agent release adds the ability to see the breakdown of time spent in SQL statements such as CREATE, DROP, ALTER, SET, CALL, EXEC, EXECUTE, COMMIT and ROLLBACK. Execution of stored procedures through the callproc() or CALL statements will provide further breakdown based on the name of the stored procedure.
Elasticsearch Support

Instrumentation support for the official Elasticsearch client module and the separate pyelasticsearch module have been added. Time spent in calls made to Elasticsearch will be listed in both the main overview chart, as well as in the Databases tab in the UI. Previously, calls to Elasticsearch would have been shown as time spent in external web service calls.


Features Changed


Remove code snippets in stack traces

Stack traces captured for errors and slow SQL queries will no longer include code snippets. This change is to prevent the possibility of capturing sensitive data embedded within the code. It  reduces the overhead in capturing stack trace information, and also avoids a potential problem caused when the code on disk has changed in the time since the process was started.


Bugs Fixed


Ensure that messages sent to the data collector containing parts which were already compressed and encoded, were not being  compressed a second time at the HTTP request level causing additional overhead.
Guard against a potential agent error where an invalid URL was being  passed to an instrumented external web service client.
Motor (an asynchronous MongoDB library) incorrectly returns a non string object when the agent tries to access the __name__ attribute on Motor objects. This caused the agent to fail when calculating the name for an object, since we rely on this value being a string as specified by the Python object model definition. The agent now overrides the incorrect behavior of Motor to ensure that we can still generate names of objects correctly.
When using Python 3 and audit logging was enabled, if messages being sent to our data collector were large enough that they were being compressed at the HTTP request level, the audit logging code would fail due to a bytes/Unicode mismatch.
Instrumentation for the decr() method of umemcache client for Memcached was incorrectly calling the stats() method.

2.46.0.37 insecure

This release of the Python agent is a minor bug fix release, including changes which may help to reduce the incidence of spurious warnings about being able to communicate with our service.

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.

Bugs Fixed



Improved management of the network connection to our service

When the agent registered itself with our data collector, it wasn't closing the socket connection immediately and instead it was holding it open for up to a minute when the first batch of data would be reported. If the socket connection was being closed remotely during that time, a BadStatusLine exception would be seen in the logs when the attempt was made to upload data.


When the agent received an internal restart request from our data collector as the result of a server side configuration change, the socket connection wasn't being closed explicitly. In the case of CPython it would still be cleaned up and closed immediately due to reference counting, but under PyPy when it was closed was dependent on when PyPy garbage collection occurred. This could mean that the socket descriptor could stay in use for a while.




Compatibility modules for transitioning from Python 2 to Python 3
When compatibility modules for Python 2/3 migration such as pies2overrides and future were installed in a Python 2 installation, they were installing modules which mimic modules which would normally only ever exist in a Python 3 installation. The presence of these modules were confusing the agent's instrumentation mechanisms. The result of this was that use of http.client from Python 3 in a Python 2 application would fail.


Failures when making calls to external web services

If a HTTP client module was supplied None as the value for the URL being requested, this would cause an exception when the agent was recording the data for that transaction.

Use of the ExternalTrace context manager class directly, for recording external web services calls, would fail if there was no active transaction. This could occur in the time before the agent has successfully been able to register with our data collector.




Setting of response content length when using Django
The Django middleware installed by the agent to perform insertion of RUM monitoring code into responses, would always set the Content-Length even if it was not previously set. This could cause issues where a front end had been set up with an expectation that Content-Length headers would never exist.

2.44.0.36 insecure

This release of the Python agent includes a major update to how we capture and represent metrics for both SQL databases and NoSQL datastores. Metrics for both types of products will now be displayed in a unified "Databases" tab in the APM UI, and these metrics will also be associated with the specific product being used. In addition, we have enabled support for having key transactions on other transactions, such as background tasks.

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 Features



Unified view for SQL database and NoSQL datastore products.
The response time charts in the application overview page will now include NoSQL datastores such as Memcached, Redis and MongoDB and also the product name of existing SQL databases such as MySQL, Postgres, Oracle etc.
We also introduced a new unified view within the APM UI for visualizing time spent in queries made against SQL databases and NoSQL datastore products.
For existing SQL databases, in addition to the existing breakdown of SQL statements and operations, the queries are now also associated with the database product being used.
For NoSQL datastores such as Memcached, Redis and MongoDB, we have now added information about operations performed against those products, similar to what is being done for SQL databases.
Because this introduces a notable change to how SQL database metrics are collected, it is important that you upgrade the Python agent version on all hosts. If you are unable to transition to the latest agent version on all hosts at the same time, you can still access old and new metric data for SQL databases, but the information will be split across two separate views.

Key transactions for other transactions.
In addition to being able to create key transactions for web transactions, it is now possible to create key transactions for other transactions, such as background tasks executed by Celery.
Key transactions enable the setting of a per transaction Apdex and alerts, as well as the ability to run X-Ray sessions, including transaction specific thread profiling.

No SQL datastore instrumentation.
To complement our new unified view for SQL database and NoSQL datastore products in the APM UI, we have upgraded our existing instrumentation for Redis and MongoDB. Previously, these only provided a function breakdown in transaction summaries and sample transaction traces, but now they will report into the unified view for database and datastore products under their respective product categories.
Existing instrumentation for Memcached clients have similarly been updated, as well as new support for the pymemcache module being added.

2.42.0.35 insecure

This release of the Python agent includes bug fixes for issues with agent registration and use of proxies which could result in no data being reported.

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.

Bug Fixes



Agent not recovering when errors occur during registration
If the agent initially registered with our data collector successfully, but subsequently failed to upload agent setting information due to a transient back end or network issue, the agent was not recovering from the error properly. The consequence of this was that the agent would not completely start up and no data would be collected or reported by that process. The operation of the web application as a whole would not have been affected. This issue, which was introduced in version 2.36.0.30 of the agent, is now fixed.

Agent not able to connect via some proxy servers
The Python agent was not able to connect to our data collector to register when certain proxy server installations or configurations were being used. We have updated the version of the internal HTTP client library used to resolve the issue.

Identification of Python web server being used
The Python agent was incorrectly reporting the Python web server being used as Tornado when both the 'gunicorn' and 'tornado' Python modules were being imported, even if the Tornado web server module wasn't actually being used. This did not affect the operation of the agent but could lead to confusion when trying to debug deployment issues.

2.40.0.34 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent enables the collection of transaction traces for Synthetics requests by default, and adds the individual trip trace visualization for Cross Application Tracing.

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 Features



Cross Application Tracing for individual transactions
Version 2.38.0.31 of the Python agent introduced aggregated transaction maps. In this release, we have built on that feature to add the ability to view an end-to-end visualization of an individual transaction, in order to better understand what backend applications and external services were called during the course of a single transaction.




Features Changed



Synthetics support enabled by default
When the Python agent added support for the collection of transaction traces for Synthetics requests in version 2.32.0.28, the feature had to be explicitly enabled in the agent configuration file. With this release, support for Synthetics is enabled by default.




Bug Fixes



Non ASCII characters in transaction names
If a transaction name contained a Unicode character outside of the ASCII range, the generation of the cross application tracing attributes would result in a UnicodeEncodeError. This bug affected versions 2.38.0.31 through 2.38.2.33. The issue is fixed in the current release.


Parsing SQL statements referencing the database schema
Previously, SQL statements that referenced a table from a database schema namespace, such as “schema.table_name”, would not always be parsed correctly, resulting in the table being identified as just “schema”. The agent now handles this case correctly, and the table is reported as “schema.table_name”.


Additional support for Tornado 1.X
If Tornado 1.X was being used, the instrumentation would fail at run time causing all web requests to fail. Monitoring of Tornado 1.X applications should now work correctly.

2.38.0.31 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent adds support for the mapping features of Cross Application Tracing, which provide a visualization of how requests flow through multiple applications within a distributed system.

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 Features



Cross Application Tracing
The Cross Application Tracing feature is now enhanced with the aggregate transaction map visualizations. This new visualization will help users spot bottlenecks in external services and give them an end-to-end understanding of what other applications and services are called within a transaction. All agents involved in the cross application communication must be upgraded to see the complete graph.




Improvements



Tornado 3.x Instrumentation
The newly refactored Tornado instrumentation is turned on by default. This was introduced in the python agent version 2.32.0.28 under an optional feature flag. This change improves upon the stability of our Tornado instrumentation and accounts for the incremental changes introduced to the Tornado 3.x source tree. It also provides a more granular view of where the time is spent in a WebTransaction, by distinguishing the time spent doing work vs time spent waiting on a asynchronous call.

Please be advised that we currently do not have instrumentation for Tornado 4.x, but we are working to add support for it.



Capacity Analysis for mod_wsgi
The capacity analysis report shows how many instances of your web application is running and how busy they are. For a web application, the measure of how busy the application is, is calculated by looking at how much of the time the total available set of request handler threads are busy.

For the case of using Apache/mod_wsgi in daemon mode, the measure of how busy your application is, has been getting over reported due to the nature of how threads are managed by mod_wsgi. If you are using mod_wsgi version 4.1.0 or higher, this measure will now be more accurately reported as it will use information provided by mod_wsgi about the total number of request handler threads which are available, rather than trying to calculate it based on what threads have been seen to be handling requests.




Bug Fixes



In version 2.28.0.26 and 2.32.0.28 of the agent, we added new features to track template includes and inclusion tags when using the Django template rendering system. We have had a few reports that indicate that for some users, but not everyone, that the instrumentation implementing these features may be causing an ongoing growth in memory usage for the web application processes over time. Right now, we don't understand the root cause for why this might be occurring in some instances, so to be on the safe side we have disabled these two features while we investigate further.

The consequence of these features being disabled is that the web transaction performance breakdown and sample transaction traces will no longer show as a separate metric or entry where one template has been included in another. Further, if the tracking of special inclusion tags had been configured, they will also no longer be shown. We anticipate re-enabling the features once we have worked out what is occurring and made changes to ensure it does not occur again.

2.36.0.30 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent provides improvements to how we report agent configuration information. This enables us to better help you debug any issues you may experience with configuring the agent.

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 Features



Configuration Information
Agent configuration information displayed in the New Relic UI will now reflect the final configuration used by the agent for an application. This includes the result of any server side configuration settings, which are applied on top of the agent defaults, agent configuration file or environment variables. Previously, the result of applying the server side configuration settings was not being displayed.




Bug Fixes



If running a system with a Linux 3.X kernel, the agent could fail when attempting to register with our data collector. No data would subsequently be collected or reported. This would occur for versions of Python 2 prior to Python 2.7.3 and versions of Python 3 prior to Python 3.3, if they were built on a system with a Linux 3.X kernel.

2.34.0.29 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent provides support for Labels and Rollups, making it possible to organize your applications in the APM UI into meaningful categories.

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 Features



Labels and Rollups
The Python agent now supports the ability to apply labels to applications, so that you can easily sort, filter, and page through all of the applications on your account's Applications list.

Configuration can be done in the newrelic.ini file:

labels = Server:One;Data Center:Primary

Labels can also be configured by setting a NEW_RELIC_LABELS environment variable:

NEW_RELIC_LABELS=Server:One;Data Center:Primary

More information on using labels to categorize your applications can be found in the New Relic APM documentation.


New CPU Reporting in Environment Snapshot

Previously, the Python agent captured two CPU-related values to report to the Environment Snapshot: Logical Processors and Physical Processors. Now, it captures the following three values:


Logical Processors: The total number of hyper-threaded execution contexts available, including execution contexts that may exist on the same core. This value remains unchanged from previous agents.

Physical Cores: The total number of physical CPU cores available, counting hyper-threaded siblings as a single core. This value was previously reported as "Physical Processors."

Physical Processor Packages: The total number of processor packages or dies (each of which may contain multiple physical cores). This value is new with this agent release.




Bug Fixes



A "Runtime Error: transaction already active" will no longer be seen in the case where the agent created nested transaction wrappers and newrelic.agent.ignore_transaction() was called within the outer wrapper but outside the inner wrapper. Previously, this error could have also been triggered when using the WSGI environment setting for newrelic.ignore_transaction set by SetEnv in mod_wsgi.

Prior to this version, the HTTP_REFERER URL reported for a transaction contained query parameters, even if the capture_params setting was set to False. Now, the capture_params setting is respected when reporting the HTTP_REFERER URL.

2.32.0.28 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent provides a preview of a significant overhaul of our instrumentation for Tornado version 3.2 and earlier. Further improvements to our Django instrumentation are also included, allowing time spent in rendering Django sub templates to be viewed separately.

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 Features



Breakout of Django template rendering
Previously when using Django templates, if the Django include tag was being used, the time spent rendering that sub template was shown under the generic Template/Render category. When the include tag is now used, a distinct metric is instead created corresponding to the rendering time for that sub template. This will appear in the transaction performance breakdown and also in sample transaction traces. In the case of sample transaction traces, as the name of the template will be included in the metric name, it now also provides additional context for understanding where any time is being spent when rendering that template.




Features Changed



Preview of improved Tornado instrumentation
Our instrumentation for Tornado version 3.2 and earlier has been experiencing a number of issues which could result in recording of data stopping and in some cases cause runtime exceptions which would affect the outcome of the executing web request. Upon investigation we found this has come about due to incremental changes in the internals of Tornado which were performed after we originally implemented the instrumentation for Tornado and which we didn't pick up as having being made. The Tornado developers have also recently released version 4.0 of Tornado. This version of Tornado has much more significant internal changes that result in our instrumentation failing completely.
Before we could embark on trying to support version 4.0 of Tornado, we deemed it necessary to completely overhaul our existing instrumentation for older versions first in order to gives us good foundation on which to then implement support for version 4.0 of Tornado. This release of the agent provides a preview of the improved instrumentation for older versions of Tornado prior to version 4.0. The new instrumentation is not enabled by default and you will need to explicitly enable it. We have provided it as an opt in change at this point to allow you to properly test with the update first and provide us with any feedback on it and any remaining issues you may find.
To enable the preview of the new Tornado instrumentation, you will need to add to the [newrelic]section of the agent configuration file the setting:
feature_flag = tornado.instrumentation.r2

If you are running on Heroku and are not using an agent configuration file, you can instead set the NEW_RELIC_FEATURE_FLAG environment variable. You can do this by running the Heroku command:
heroku config:set NEW_RELIC_FEATURE_FLAG=tornado.instrumentation.r2





Bug Fixes



When an exception was raised by a WSGI application during the yielding of response content via a generator, the recording of that web request by the agent may not be closed off properly. This would result in no further web requests handled by that thread being recorded and reported. If this occurred for all request handler threads, then no data would then be reported for the whole web process. This issue relates to behaviour of the Python garbage collector and when Python objects are destroyed. At this point in time we believe this only affects users of pypy and does not affect users of CPython as the reference counting model of CPython usually gives more deterministic behaviour around when Python objects are destroyed. We don't however rule out that it could affect CPython and may explain a situation matching this problem we have seen in a couple of cases where users were using uWSGI.

When attempting to use Tornado as a worker for gunicorn, an exception could occur on startup which would result in gunicorn failing immediately and exiting. In order to use this combination it was previously necessary to disable the gunicorn specific instrumentation related to WSGI applications by adding to your agent configuration file:
[import-hook:gunicorn.app.base]
enabled = false

If you were using the Tornado worker with gunicorn and using this workaround, the underlying problem has now been addressed and you should be able to remove that section from your agent configuration file.

The mechanism we used for applying function wrappers for instrumentation was not being performed in the most optimal way for methods of classes. This could result in problems, including unexpected runtime exceptions, especially when trying to apply instrumentation to class methods, or methods of an existing instance of a type.

2.30.0.27 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent improves instrumentation for the Flask web framework and adds database monitoring support when using the pymssql client with a Microsoft SQL Server database.

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 Features



Improved instrumentation for Flask
The Python agent now provides better web transaction naming and performance breakdown metrics when Flask style middleware are being used. This means that time spent in Flask before_request and after_request functions will now be broken out as their own metrics. If a before_request function actually returns a response, the web transaction will be correctly named after that function rather than the Flask WSGI application entry point. These changes, in addition to being applied on middleware functions registered directly against the Flask application, will also work when Flask blueprints are used to encapsulate behavior.


Browser monitoring auto-instrumentation when using Flask-Compress
When the Flask-Compress package is used to perform response compression with Flask, insertion of browser monitoring tracking code into HTML responses is now automatically performed. Previously, if Flask-Compress was being used, manual instrumentation of HTML responses would have been required.


Monitoring of MSSQL database
Instrumentation is now provided for the pymssql database client module to monitor database calls made against a Microsoft SQL Server database.




Bug Fixes



When using high security mode, the use of newrelic.capture_request_params in the per request WSGI environ to enable capture of request parameters, possibly by setting it using the SetEnv directive when using Apache/mod_wsgi, was not being overridden and disabled as required.

When using the DatabaseTrace context manager or associated wrappers explicitly to implement a custom monitoring mechanism for database calls, the instrumentation wrappers could fail with a TypeError exception when trying to internally derive the name of the database product being used.

2.28.0.26 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent improves data collection with the Django web framework. These improvements include better-targeted web transaction naming with the Django REST framework, better coverage of Django template inclusion tags, and better background task monitoring for Django management commands.

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 Features



Improved Django REST Framework naming
Previously, when using the Django REST framework, web transactions were being named after the class based view that implemented the Django REST framework resources. Now, where such a view provides custom handler methods for different HTTP request method types or actions, the web transaction will be named after that custom handler method rather than the class as a whole. A new function breakdown metric will also be added for the custom handler method. This change will allow web requests using different HTTP request method types to be viewed separately.


Django inclusion tag monitoring
Usage of inclusion tags in Django templates can now be monitored and will appear in the transaction breakdown table, charts and sample transaction traces.
Due to the possibility that a large range of custom inclusion tags might be used and that they may be invoked a large number of times in tight loops, tracking of all inclusion tags may not be practical or may not produce worthwhile results in the transaction breakdown or sample transaction traces. As a result, monitoring of inclusion tags is off by default, with the preferred approach being that specific inclusion tags of interest be individually enabled through the agent configuration file.
To enable monitoring of specific inclusion tags, a new section called import-hook:django should be added to the agent configuration:
[import-hook:django]
instrumentation.templates.inclusion_tag = prepopulated_fields_js date_hierarchy
The instrumentation.templates.inclusion_tag setting within that section should then be set to a space separated list of the names of the inclusion tags to monitor. If there is any confusion over the identity of the inclusion tag, the full name of the inclusion tag function, with module name, can instead be listed. For example, data_hierarchy can also be identified using django.contrib.admin.templatetags.admin_list:date_hierarchy.
In addition to specifying the names of the specific inclusion tags, it is also possible to specify * for instrumentation.templates.inclusion_tag in order to have usage of all inclusion tags be monitored:
[import-hook:django]
instrumentation.templates.inclusion_tag = *
Enabling monitoring of all inclusion tags in this way is only recommended in development or test environments so as to get an initial idea of what inclusion tags are worth tracking. Once identified, the specific inclusion tags of interest should thereafter be listed individually in a production environment.


Better monitoring of Django management commands
We previously published a blog post about how the agent could be used to monitor Django management commands. This required you to manually set up the instrumentation for each specific Django management command in the agent configuration file. We have now made that easier by integrating the functionality as part of the agent itself.
Due to the limitations on what Django management commands can be monitored, you will still need to list explicitly the commands you want monitored, but it can now be done in a single location as a space separated list under the setting instrumentation.scripts.django_admin of the import-hook:django section:
[import-hook:django]
instrumentation.scripts.django_admin = syncdb sqlflush

By default, we automatically specify the startup timeout to be 10.0 seconds when monitoring the Django management commands. If you need to override the startup timeout, you can set the instrumentation.background_task.startup_timeout setting within the same import-hook:django configuration section.

2.26.2.24 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent is a hotfix release to prevent proxy credentials set in the agent configuration file from being transmitted to New Relic.

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.

Bug fixes


Previously, the agent stripped the proxy_user and proxy_pass settings when it transmitted configuration settings to New Relic, so as not to expose credentials. However, the proxy_host setting was transmitted unaltered, even if it was a URI containing a username and/or password. With this release, proxy usernames and passwords specified in a URI in the proxy_host setting are obfuscated before being transmitted. In addition, the proxy_user and proxy_pass settings are obfuscated, and are also transmitted.

2.26.0.22 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent includes improvements to browser monitoring, with the primary change being that the Python agent is now able to perform automatic browser monitoring for a wider range of Python web frameworks running on a traditional WSGI server. This includes popular web frameworks such as Flask, Pyramid and Bottle.

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 our online help article on the status of the Python agent.

New Features


Prior to this version, automatic browser monitoring for HTML pages served up by a Python web application was only available if using the Django web framework. With this release this capability has now been expanded in most cases to cover any Python web framework being hosted on top of a web server with a direct interface for hosting Python WSGI applications. WSGI servers this covers include the popular Python web hosting packages Apache/mod_wsgi, gunicorn and uWSGI. Support does however not currently extend to Python web hosting mechanisms which provide a bridge to a WSGI application from a native Python web application API, such as is the case if using the Tornado or Twisted WSGI containers.

What the change means is that if using a previously unsupported web framework such as Flask, Pyramid or Bottle, and you were not manually instrumenting your HTML page responses to make use of browser monitoring, you will now start to see automatically end user performance metrics being captured and displayed in the New Relic APM UI. You will also have access to the optionally enabled browser monitoring agent, enabling access to details of AJAX calls made by your pages and also the details of any client side Javascript errors which might have been raised.

If you were previously manually instrumenting your HTML page responses to enable browser monitoring, you should in most cases now be able to discontinue such manual instrumentation.

Note that at this time, in addition to lack of support for Tornado and Twisted WSGI containers, we do still have a few restrictions in place which mean we may not always be able to enable automatic browser monitoring support. The key restriction is that when using a web framework, the automatic support for browser monitoring will be disabled if you are using a middleware or plugin for the framework, which performs compression of responses, or which otherwise modifies the content encoding for the response. For example, automatic browser monitoring will still not be available if using the flask.ext.compress plugin with Flask, or the paste.gzipper middleware with any WSGI application. We are working on extending coverage to cases where such middleware or plugins are being employed, but if you are using them, for now you will still need to resort to manually instrumenting your responses to enable browser monitoring. The only exception to this is the Django web framework, where we already previously had support for automatic browser monitoring even if the Django GZipMiddleware was being used.

For further details on the updated browser monitoring support and manually instrumenting your HTML page responses, see our documentation on page load timing when using the Python agent. If browser monitoring support is not currently enabled for your application or you need to disable it, then see our documentation on browser settings.


Bug fixes/Improvements


The agent was in some cases incorrectly inserting our instrumentation to HTML page responses which were marked as an attachment by way of a Content-Disposition HTTP response header or HTML page meta tag.

2.24.0.21 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent includes fixes related to tracking of external web service calls and minor improvements to automatic real user monitoring HTML insertion for Django. An offline developer mode has also be added to verify the operation of the agent with your application in a development or test environment.

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 our online help article on the status of the Python agent.

New Features


An offline developer mode for the agent now exists to allow for verification that the operation of the agent will not affect the monitored web application in a development or test environment, without sending any actual data to New Relic. As it is an offline mode, no additional hosts will be recorded against your New Relic account for billing purposes.

The offline mode does not allow for any viewing of collected metric information and other data for the purposes of monitoring your application, so it is not a solution for running New Relic locally. Being able to run it however, will allow you determine if a newer version of the agent, or an upgrade of any third party package in conjunction with the agent, will still function correctly before you jump to upgrading the packages in your production environment.

The offline developer mode can be enabled by setting the developer_mode setting in the agent configuration file, or the NEW_RELIC_DEVELOPER_MODE environment variable, to true.

Audit logging can also be enabled in conjunction with the offline developer mode so as to allow for the investigation of what data would be set to New Relic, resulting from the monitoring of your application, without actually sending any data to New Relic.

Audit logging itself can be enabled by setting the the audit_log_file setting in the agent configuration file, or the NEW_RELIC_AUDIT_LOG environment variable. It is not recommended that audit logging be enabled for any extended period as the resulting log file will be quite large.


Bug fixes/Improvements


When using the Bottle web framework, the setting error_collector.ignore_status_codes, for ignoring exceptions linked to specific HTTP response status codes, was being ignored in the case of using Bottle plugins and a plugin raised a HTTPError exception. This only affected Bottle versions 0.11 or higher.
The New Relic feature for cross application tracing between two monitored web applications was not working when a Python web application was using recent versions of the urllib3 and requests modules for initiating the call to the back-end web application service. This affected version 1.8 or higher of urllib3 and version 2.3.0 of the requests module.
External web service calls were not being monitored when using the prepared requests feature of the requests module directly.
When using the urllib or urllib2 modules, if a URI of the form file://..., corresponding to a local file on the file system, was passed to any function monitored by our instrumentation, a metric and transaction trace node were being generated corresponding to an external web service with host name of 'unknown'. The instrumentation now correctly filters out URIs which do not correspond to an actual remote web service.
The automatic means for inserting page load timing tracking code for real user monitoring (RUM) into HTML page responses returned from a Django application now works no matter the case used for HTML elements. Previously automatic insertion would only be performed where HTML elements were lower case.
RUM tracking code inserted automatically into HTML page responses from Django is now more optimally placed when a X-UA-Compatible meta tag appeared in the head element of the HTML page. Previously the RUM code was placed at the end of the head element when such a meta tag existed. This would have meant that page loading times would not have accurately reflected time spent in loading assets from any script elements appear after the meta tag. The RUM code is now placed immediately after the meta tag. Placement is not done before the meta tag as some browsers require that the meta tag appear prior to any script elements.
RUM tracking code inserted automatucally into HTML page responses from Django is now placed after any Content-Type meta tag which also contains a charset attribute. This is necessary as some browsers will not recognise such a meta tag if it does not occur early in the page content. If a script tag was therefore placed before this meta tag it could have resulted in the meta tag being pushed down sufficiently far enough in the page content so as not to be recognised.
Data corresponding to a long running transaction monitored by the agent, which spanned the time when a server side configuration change was made in the New Relic UI, will now be discarded. This is to avoid a problem where the response time average for web requests on the overview chart would be skewed so as to appear greater at the time a server side configuration change was made. This problem would result as when such a server side configuration change is made, the agent will momentarily disconnect and reregister. In that time, any short lived transactions would not be monitored, but the long running transaction which only completed after registration occurred was incorrecly being recorded, with an undue effect on average response times.

2.22.1.20 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent is a hot fix release to address an issue introduced in version 2.22.0.19 when applying additional function traces from the agent configuration.

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 our online help article on the status of the Python agent.

Bug fixes:


When using the transaction_tracer.function_trace setting in the agent configuration file to apply additional function traces, the trace was not being applied and a message indicating an instrumentation error would appear in the Python agent log file. The error in itself would not have prevented the agent from starting and running, but no data would be collected for the designated functions as intended.

2.22.0.19 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent introduces a means to enforce High Security Mode from the agent configuration, as well as enabling capture of Insights events for background tasks.

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 our online help article on the status of the Python agent.

New Features:


Insights events are now also recorded for background tasks, in addition to the existing events already captured for web transactions.
The application to record an exception against can now be explicitly provided using the keyword argument application when calling newrelic.agent.record_exception(). This enables the ability to record exceptions outside of the context of a monitored web transaction or background task. A suitable application object can be retrieved using newrelic.agent.application().


Features Changed:


Enforcing High Security Mode from the agent configuration is now supported.

High Security Mode is a feature to prevent any sensitive data from being sent to New Relic. The local setting for the agent must match the server setting in the New Relic APM UI. If there is a mismatch, the agent will log a message and act as if it is disabled. A link to the docs for High Security Mode can be found here

Attributes of high security mode (when enabled):


Requires an SSL connection to be used.
Prevents capture of request parameters.
Suppresses capture of custom parameters.


The default setting for High Security Mode is false.

If you already have high security mode enabled within the New Relic APM UI, you will need to add:

high_security = true


to your local agent configuration file.

Or if using Heroku, set the NEW_RELIC_HIGH_SECURITY environment variable by running:

heroku config:set NEW_RELIC_HIGH_SECURITY=true

When using the gunicorn WSGI server, the request URL which appears in transaction trace samples and error details will now be sourced from the RAW_URI variable passed by gunicorn in the WSGI environ dictionary. This will ensure that what is displayed is the raw URL before % escape sequences have been decoded. This avoids the problem of the URL being shown as a raw byte sequence.
When audit logging is enabled, the responses returned from our data collector service will now also be logged.


Bug fixes/Improvements:


An incorrect module name was being derived for methods of classes, when used in web transaction and function trace naming, where the method was from a base class defined in a different module, but invoked via a derived class.
When using Django class based views, if a class based view was used explicitly from within a view handler, the name of the class based view method was overriding the web transaction name, which at that point would have been set to the view handler. The class based view method name will now only be used for the web transaction name when it is actually registered as the view handler.
Explain plans for SQL queries were not working when the SQL database cursor had been configured to return a dictionary rather than a tuple for each row set when the original query was made.

2.20.1.18 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent addresses a bug which in some cases caused database connection parameters, which could include login credentials, to be logged to the local system by the monitored application if Python agent debug logging is being captured.

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 our online help article on the status of the Python agent.

Bugs Fixed


When Python agent debug logging was enabled by setting log_level to debug in the Python agent configuration, database connection details, including login credentials could be logged in the local Python agent log file.

The details may also have been logged even if log_level had not been set to debug, but the Python logging module had been configured to collect and log messages logged at the log level of logging.DEBUG.

This issue was introduced in version 2.20.0.17 of the Python agent.

2.20.0.17 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent provides various improvements to database client module instrumentation and execution of explain plans.

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 our online help article on the status of the Python agent.

New Features


Added a 'license-info' command to the 'newrelic-admin' script for displaying the LICENSE file for the 'newrelic' package.


Bug fixes/Improvements:


The bottle instrumentation was causing a secondary exception when a web request was not actually being monitored and an un-handled exception occurred in the web request.
Added support for accepting additional arguments to the execute() method of database cursors implemented by the oursql and cx_Oracle modules which are not covered by the Python DBAPI 2 (PEP 249) specification.
The time taken for connect() calls of database client modules will now be counted in Database time (on the APM Overview page).
The automatic rollback or commit performed on exit of the context manager for a database connection was not being monitored and reported when using the psycopg2, psycopg2cffi and postgresql database client modules for the PostgreSQL database.
Improved how database connections are managed when performing explain plans and also applied caps to the number of process wide explain plans that are done in each reporting period. This should have the result of reducing overhead in situations where there was a large number of candidate SQL statements on which to perform explain plans. Any additional overhead from the agent in the past would have been most notable when performing an X-Ray session against a key transaction.

2.18.1.15 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent adds improved audit logging functionality and an admin script sub command for recording deployments.

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 our online help article on the status of the Python agent.

New Features


Record Deployments: A new 'record-deploy' sub command has been added to the 'newrelic-admin' script installed with the Python agent. This is a wrapper around the HTTP API provided by New Relic for recording deployments against your application. To use the sub command, add your API-KEY in the agent configuration file under the 'api_key' setting. The path to the config file, description for the deploy and optional revision, change log and user information can then be supplied as arguments to the sub command.
Audit Logging: An improved audit logging feature has been added to the agent for capturing details of what is being sent up to our data collectors. Information is now captured into a separate log file in a more human-readable format to aid any review process carried out to determine what the agent is sending.  The audit logging feature can be enabled by setting the the 'audit_log_file' setting in the agent configuration file, or the 'NEW_RELIC_AUDIT_LOG' environment variable. It is not recommended that audit logging be enabled for any extended period as the resulting log file will be quite large.


Bug fixes/Improvements:


The agent now ensures that the certificate bundle packaged with the agent is always used when certifying SSL connections back to our data collector. Previously the location of the certificate bundle could be overridden by a number of environment variables. This could cause SSL connection failures when the referenced certificate bundle didn't exist or had incorrect permissions and could not be accessed.

2.16.0.12 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent adds obfuscation of explain plans as the default when using PostgreSQL, as well as including bug fixes related to the instrumentation for some MySQL database client modules.

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 our online help article on the status of the Python agent.

Bug fixes/Improvements:


Fixes an agent bug with PostgreSQL where parameters from the original query could appear in explain plans sent to New Relic servers, even when SQL obfuscation was enabled. Parameters from the query are now masked in explain plans prior to transmission when transaction_tracer.record_sql is set to 'obfuscated' (the default setting).
The automatic rollback or commit performed on exit of the context manager for a database connection was not being monitored and reported when using the MySQLdb, pymysql and oursql database client modules for the MySQL database.

2.14.0.11 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent adds support for the Cornice REST component library for the Pyramid web framework, as well as a number of minor feature improvements and bug fixes.

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 our online help article on the status of the Python agent.

New Features:


Instrumentation added for the Cornice REST component library for the Pyramid web framework.


Bug fixes/Improvements:


Enhance the instrumentation for the Bottle web framework to work around the problem that the Bottle framework was not using 'functools.wraps()' correctly in the implementation of its 'auth_basic()' decorator. This was resulting in the web transaction being named after the 'wrapper' function closure used in the implementation of the decorator rather than the wrapped request handler the decorator was applied to. A pull request was made against the Bottle framework and the change will be included in a future version of Bottle. Our change ensures that the correct result is also obtained with older Bottle versions.
When using the database connection object created by the sqlite3 database client module as a context manager, the automatic rollback or commit performed by the context manager when the scope of the context manager is exited, will now be tracked.
If a function trace was applied to the bound method of a class implemented in a C extension module, the name of the module shown in the name of the function was being wrongly designated as the Python 'builtins' module.
Updated memcache instrumentation wrappers to use our latest function wrapper implementation. Our latest function wrappers better preserve the ability to introspect wrapped functions/methods and so return the same result as one would expect if no wrapper had been applied.

2.12.0.10 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent includes improved instrumentation for the Bottle framework and new instrumentation support for gevent WSGI servers. It also allows reporting of data to multiple applications in New Relic to be specified via an environment variable, in addition to the existing 'app_name' setting in the agent configuration file.

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 our online help article on the status of the Python agent.

New Features:


Provide automatic instrumentation of the WSGI application entry point when using the 'gevent.wsgi' and 'gevent.pywsgi' servers. This means that if you are not using a web framework we already support and instrument, are using a WSGI component library, or implementing your WSGI application from scratch, it is no longer necessary to wrap the WSGI application entry point with our special decorator or wrappers when using the gevent WSGI servers.


Features Changed:


Previously it was only possible to list multiple applications in New Relic to report data to via the 'app_name' setting in the agent configuration file. Attempting to list multiple application names (separated by the requisite semi colon), in the 'NEW_RELIC_APP_NAME' environment variable was ignored with the complete value (including semi colons), being used as the application name. This limitation has now been lifted and a list of applications to report to can now be specified using the 'NEW_RELIC_APP_NAME' environment variable.


Bug fixes/Improvements:


The instrumentation for the Bottle web framework has been improved. The changes include the request handler now being broken out properly as a separate item in the transaction breakdown, the web transaction being named after an error handler when appropriate and requests which could not be mapped to a request handler being named as being a 404 if no error handler was provided. Handling of exceptions for HTTP errors has also been improved and are now being correctly matched against our internal list of HTTP status codes to be ignored as exceptions. Previously the instrumentation was too liberally ignoring all HTTP error exceptions.
When using the Flask web framework, a NotFound exception raised within the underlying Werkzeug library was not being ignored. It is now no longer necessary to explicitly ignore the exception type 'werkzeug.exceptions:NotFound' in the agent configuration.
When an unhanded exception was raised by a Pylons application, a bug in the implementation of the agent's error trace wrappers would cause a subsequent exception to be raised from the agent itself, masking the details of the original exception.
When trying to determine how much memory was available on a system, the agent would fallback to trying to the use the 'psutil' module, if installed, if our standard ways of checking failed. This would cause the agent to fail on a PaaS such as PythonAnyWhere, which prohibits access to the /proc filesystem. Use of 'psutil' as a fallback has now been removed to avoid any potential for a failure.
The version of the bundled 'requests' module the agent used to perform HTTP requests to our data collector did not work with Python 2.6.2 or older. A fix to 'urllib3' used by the 'requests' module has been back ported to address the issue.
Our updated database instrumentation wrappers released in the last agent version, would incorrectly return that a database connection or cursor object were callable. This could confuse code which was trying to introspect those objects to perform traversal in order to get access to inner details of the implementation of the database modules.

2.10.1.9 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent is a hot fix version to address an issue related to cross process application traces introduced in 2.10.0.8.

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.

Bug fixes/Improvements:


The value of headers inserted into the HTTP response returned from the WSGI application to support cross process application tracing were being incorrectly passed as Unicode strings on Python 2. This would cause a strictly compliant WSGI server such as Apache/mod_wsgi or uWSGI to raise an error when the headers were being set. In general, pure Python WSGI servers are not as strict in their WSGI compliance and would have silently accepted the value anyway, converting it to a byte string using the Python system default encoding.

2.10.0.8 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent includes various improvements and bug fixes related to instrumentation for database client modules, as well as a notable fix to our 'newrelic-admin' script affecting some users who referenced Python virtual environments via a symbolic link.

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 our online help article on the status of the Python agent.

New Features:


Instrumentation of the WSGI application entry point will now add a new breakdown metric to  web transactions corresponding to the finalization of the WSGI request. Within the workings of the interaction between the WSGI server and the WSGI application, this is the point at which the WSGI server will call any close() method on the iterable returned by the WSGI application. The name of this new breakdown metric is 'WSGI/Finalize'. In the case where there was actually a 'close()' method, a further breakdown metric will also appear corresponding to that method.
Added support to instrumentation for MySQL and PostgreSQL database client modules for monitoring database queries when the database connection object is used as a context manager. Such context manager features are outside of the scope of the Python DBAPI2 (PEP 249) specification, not all database client modules support it and nor do they all work the same. Although supported, we would suggest consideration should be given to not using these context manager features if you need your code to be portable between databases.
Added support to instrumentation for MySQL database client modules for monitoring database queries when the database connection object was created using the Connect() function. The Connect() function falls outside of the scope of the Python DBAPI2 (PEP 249) specification. Although supported, we would suggest consideration should be given to not using this Connect() function if you need your code to be portable between databases.
Added database instrumentation support for the mysql-connector-python database client module.
Custom parameters for a transaction which are a string or numeric value will now be added to and reported with analytic events reported to our analytics system code named Rubicon. This can be disabled using the agent configuration setting 'analytics_events.capture_attributes'.
The capture of custom parameters against a transaction trace can now be disabled using the agent configuration setting 'transaction_tracer.capture_attributes'.
The capture of custom parameters against error details can now be disabled using the agent configuration setting 'error_collector.capture_attributes'.


Features Changed:


The agent API function add_user_attribute() is now deprecated and functionality merged with the add_custom_parameter() function. The latter function should now be used instead. The display of such parameters in browser traces is now optionally enabled with the agent configuration setting 'browser_monitoring.capture_attributes'.


Bug fixes/Improvements:


If the 'newrelic' package was installed into a Python virtual environment, but the 'newrelic-admin' script was executed via a path that traversed a symlink to the virtual environment, the protections within the agent bootstrapping procedure was detecting that the agent was trying to be used with an application running against a different virtual environment when it was actually the same. This would result in the application not being monitored. This issue was introduced in version 2.8.0 of the agent when additional protections were added against mixing application/modules from different Python virtual environments.
Explain plans were not being performed on SQL queries made via the executemany() method of a database cursor object. When explain plans are now done, the data inputs from the first row of input data for the executemany() call will be used.
When using Python 2, if strings were supplied for the web transaction name, custom parameters, in error details etc, and that string contained a series of characters which could not be decoded as valid UTF-8, then an exception would occur. In the case of a web transaction name, this could result in the exception affecting the current web transaction and result in an error response being sent back to a user. For the case of a transaction trace or error details, the exception would prevent the sending of the captured data up to our data collector and it would be discarded. This was a regression within the agent behaviour introduced when Python 3 support was added to the agent.
Fixed instrumentation for sqlite database modules which could result in instrumentation not being applied correctly, and so no database metrics collected, if the sqlite module had been imported prior to the agent being initialized.
Limits being applied to the length of the SQL for a slow SQL query when being sent up to our data collector were being applied at the wrong time, resulting in the truncated SQL being used when performing an explain plan. This didn't affect the operation of the web application, but database logs could contain an error about the malformed SQL query.
Explain plans could be attempted for an SQL query even where the SQL query failed. Under most circumstances a SQL query would fail immediately and so the duration would fall below the threshold for collecting an explain plan, but the changes now made will protect against a long running SQL query which failed in the database and ensure that no additional problem is caused by issuing an explain plan for it.
If a monitored web application is started up using our newrelic-admin wrapper script, and it executes a separate Python script and that Python script used a Python version older than Python 2.6, the script could output the error message "'import site' failed; use -v for traceback". The execution of the script was not affected, but the message obviously could cause concern.
The equivalent functions from the 'urllib2' module from Python 2 were not being instrumented when Python 3 was being used. This was missed when Python 3 support was added to the agent.

2.8.0.7 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent marks the official introduction of support for pypy. Instrumentation has also been updated to address issues arising from the release of Celery 3.1.

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 our online help article on the status of the Python agent.

New Features:


The agent has worked with and has already been used by customers with pypy for some time, but we have not officially acknowledged that we support pypy. We have now integrated pypy into our test procedures and now officially support this implementation of the Python language.


Bug fixes/Improvements:


Instrumentation for Celery has been updated to accommodate changes in Celery 3.1. The changes in Celery 3.1 resulted in no metrics being reported in prior versions of the agent.
When collecting data on external web service calls, the agent now drops port 80/443 from the name of the host when used with the standard http/https protocol schemes. This ensures that a URL with or without the ports are seen as the same service in the external web services page in the UI.
When using newrelic.agent.initialize() explicitly, if no arguments are provided, the values for the config file and environment arguments will now be read from the NEW_RELIC_CONFIG_FILE and NEW_RELIC_ENVIRONMENT arguments if specified.
Flask instrumentation was not correctly mapping URLs related to a HTTP 404 response to a known framework or application handler function. Instead the web transaction was named after the URL, which could result in metric grouping issues if an application was hit with a large number of URLs which couldn't be mapped by the application. Such requests will now be mapped to flask.app:Flask.handle_http_exception.
Pyramid instrumentation should no longer report as errors instances of exceptions derived from HTTPRedirection, raised to generate a HTTP redirect response.
Improvements to the newrelic-admin wrapper script and agent bootstrapping procedure to better deal with a local sitecustomize.py file. Changes will also better handle the case where the newrelic-admin wrapper script was used around a Python script using a different Python installation than that which the newrelic package was installed in, avoiding possible errors when the wrapped script was run, due to the mismatch.

2.6.0.5 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent contains support for web applications and worker processes using 'gearman' for background task execution. The agent also switches to using the 'json' package from the standard library instead of a separate 'simplejson' package. This should result in potential reductions in base level memory usage by the agent and a reduction of CPU overhead for some environments.

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 our online help article on the status of the Python agent.

New Features:


Instrumentation now provided for the gearman package. The support covers use of both the gearman client and worker interfaces. In the case of workers, each task executed by the worker will be recorded as a background task and be displayed as such in the New Relic UI.
The ignore_errors argument to newrelic.agent.record_exception() can now be a callable in addition to being able to pass a sequence. When it is a callable, the callback will be called with the three arguments exc, value and tb, being the same values as returned by sys.exc_info(). The callback should return True if the exception is to be ignored. False if the exception should never be ignored regardless of any other checks, and None if subsequent checks and inbuilt rules should determine if the exception should be ignored. A callback would normally return either True or None.


Bug fixes/Improvements:


The bundled 'simplejson' package has now been removed and is no longer used. This was previously used due to the requirement to support Python 2.5, for which support was removed in version 2.0.0 of the agent. Instead of simplejson, the 'json' package contained in the Python standard library is now used instead. This should see the base level memory usage of the agent drop as a result. Further, in environments where a C compiler was not available and the C extension modules could not be compiled, there should now be a minimal reduction in the CPU overhead when the agent is uploading data to our back end. This is because the optimised C extension in the json package will always be available as part of the Python standard library and will always be able to be used.
If a WSGI application was returning an iterable such as a generator, and an exception was raised when a specific part of the response content was yielded from the generator, the details of the exceptions were not being recorded.
In a multithreaded web application where deferred module imports were being performed in secondary threads, agent registration could fail the first time due to concurrent changes made by the secondary threads to sys.modules. Registration would succeed on a subsequent attempt. This bug was only occurring in Python 2 and was introduced in version 2.0.0 of the agent when Python 3 support was added.
Custom parameters which were explicitly supplied to newrelic.agent.record_exception() were being ignored and were not appearing in the error details page in the UI. Instead, only custom parameters added using newrelic.agent.add_custom_parameters() against the web transaction or background task itself were being shown. This bug was introduced in version 1.13.0 of the agent when support for cross application tracing was added.
The port number used in the URL for a web external call, was not being retained when the URL was added as a parameter against the web external node for transaction traces. The port would therefore not be displayed when drilling down into the details of a web external node in a transaction trace.
The newrelic-admin validate-config command will now work for enterprise high security mode accounts, provided of course that no setting is otherwise specified in the agent configuration file which is in conflict with that mode. That is, features such as SSL would still need to be enabled by the ssl setting and the capture_params setting indicating whether URL query string parameters should be captured, also set to false.
When using CherryPy, in addition to the explicit exception type 'NotFound' being ignored as an error, raising of a 'HTTPError' exception where the status is 404 will also be ignored. Similarly, instances of the 'HTTPError' exception will be ignored as an error when they are for a HTTP error in the 30X range.

2.4.0.4 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent is a bug fix release primarily to address a number of issues introduced in version 2.2.0.2 which have effected a small number of users.

This version of the agent is also the minimum recommended agent version required to be able to see percentiles and histogram charts. All reporting hosts for an application must be upgraded to the minimum agent version for the feature to be visible.

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.

Bug fixes/Improvements:


Fixed issues with instrumentation wrappers which caused failure of WSGI application integration for  FASTCGI/SCGI/AJP using flup.
Fixed issues with instrumentation wrappers which caused failure of wrappers for external web service calls in certain uses cases.
Fixes issues with instrumentation wrappers which caused failure when queuing Celery tasks from within a web application using django-celery.
When using the ErrorTrace context manager to capture details of exceptions within a certain context, None can now be passed for the transaction and an assertion failure will not be raised. This avoids the need to check explicitly to see if a web request is being monitored and avoid using ErrorTrace where there isn't.

2.2.1.3 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent is a hot fix version to address a Celery instrumentation issue introduced with version 2.2.0.2.

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.

Bug fixes/Improvements:


Fixed bug with Celery instrumentation introduced with version 2.2.0.2 of the agent. The bug was causing a Python exception to be raised when the instrumentation was trying to derive the task name to use as the name of the background task.

2.2.0.2 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

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 'setup.py' 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.

2.0.0.1 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent is a major new version and primarily focuses on the addition of support for Python 3.

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:


Python 3.3 or later is now supported. This includes support for popular web frameworks that have been ported to Python 3, such as CherryPy, Django, Flask, Pyramid and Tornado.
Added new instrumentation to track as external service calls, requests made by the 'thrift' client module.
Added new instrumentation to track memcache calls made by the 'bmemcached' client module.


Features Removed:


Python 2.5 is no longer supported. The minimum required Python version is now 2.6. If using Python 2.5, you should ensure that any requirement for the 'newrelic' module listed in a 'setup.py' or pip requirements file says 'newrelic<2.0.0.0'.


Bug fixes/Improvements:


Fixed broken instrumentation for 'httplib' module, which would cause an exception where the 'httplib' connect() method was being invoked via the Connection class type rather than an instance of the Connection class.
Fixed issue where if the host system clock was wound backwards, then the response time of active requests could be set as being zero, resulting in a ZeroDivisionError when calculating thread utilization.
Fixed issue where the use of SSL via a HTTP proxy by the agent to connect to the New Relic data collector to report data would fail.
Fixed broken instrumentation for sqlite database client module which resulted in the executescript() API call failing.
Add workaround for uWSGI issue where when using gevent mode of uWSGI, it would attempt to wait on all greenlets on process shutdown, instead of only on non daemon threads, specifically the request threads. The issue was causing processes to hang for 60 seconds on shutdown before the uWSGI master process killed the process. We are in discussion with uWSGI authors about a permanent fix to uWSGI.

1.13.1.31 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent includes a hot fix to address an issue whereby external web service calls made via HTTPS connections were failing. This issue was introduced with version 1.13.0.30 of the agent.

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.

Bug fixes/Improvements:


The Cross Application Tracing feature added in version 1.13.0.30 of the agent was causing failure of external web service calls made over HTTPS connections when that call was made via the 'httplib' module. As the 'httplib' module is used internally in other HTTP client libraries such as the 'urllib', 'urllib2', 'urllib3' and 'requests' modules, they would also have been affected.
Setting the 'cross_application_tracer.enabled' setting in the agent configuration file to 'false' to disable Cross Application Tracing would cause an exception when an external web service call was being made via the 'httplib' module.

1.13.0.30 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent adds support for Cross Application Tracing.

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:


Support for New Relic's Cross Application Tracing feature is now available for the Python agent. This feature enables correlation of transaction traces between different services in your stack. It works on external calls made between applications monitored by any New Relic agents (Java, .NET, Ruby and Python), which support this feature. At this time the Python agent supports this feature on outgoing calls when using the 'httplib' module or any other module which uses 'httplib', such as the 'urllib', 'urllib2', 'urllib3' and 'requests' modules. Any inbound calls from other agents which support the feature will also be handled.
Added instrumentation for the weberror package. This provides visibility into potentially blocking operations such as sending of email for exceptions which are being reported.
Added instrumentation for the umemcache package.
Added instrumentation for the DBAPI2 compliant interface for the IBM DB2 ibm_db_dbi database client package.


Bug fixes/Improvements:


When running a WSGI application under the Tornado WSGI container, data reporting would stop if an unhandled exception managed to propagate back up to the Tornado WSGI container. This was due to a bug in Tornado in respect of its compliance with the WSGI specification. A workaround is provided to avoid the problems this caused to the Python agent. Tornado versions prior to 3.2 will still carry that bug however and we make no attempt to address the bug in Tornado.
The Tornado instrumentation was causing template rendering to fail where a relative path was used to refer to the template and no template path had been specified for the RequestHandler instance or globally.
The Tornado instrumentation was causing exceptions when using the tornado.gen decorators under Tornado 2.X.
When using Django, web transactions will now be named after individual view handlers when using class based views, rather than being named after the class itself.
When using Pyramid, web transactions will now be named after individual view handlers when using view classes, rather than being named after the class itself.
Celery instrumentation had stopped working correctly for Celery versions 2.5.3 through 2.5.5.
No data was being reported where a monitored process was being shutdown within a couple of seconds of being started even if the agent was able to register. This could result in custom metrics in particular not being reported.
SSL certificate validation was failing on older Debian systems due to the OpenSSL libraries not being able to process a couple of the certificates bundled with the Python agent. Those certificates were not required and have been removed.
Calculation of a time string was failing on Windows due to using a strftime() formatter which only existed on UNIX systems.

1.12.0.56 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent removes the experimental label from our Tornado Web and Pyramid support, with support now being enabled by default.

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 Status of the Python agent.

New features:


The previously experimental support for the native Tornado Web API has been greatly expanded and is now enabled by default. This is in addition to the tornado.wsgi.WSGIContainer support we previously provided and includes the native Tornado Web API for constructing async applications. Running a limited subset of the native Tornado Web API within a separate WSGI server using the tornado.wsgi.WSGIApplication adapter is also now supported.
The previously experimental support for the Pyramid web framework has been improved and is now enabled by default.
When using a DBAPI2 compliant database client, calls to stored procedures via the callproc() method of the database cursor are now tracked. Previously, only calls made to stored procedures by explicitly using a CALL SQL statement were being tracked. All calls to stored procedures currently appear under the category of 'SQL - Other'. A future agent update is planned which will split out calls to stored procedures separately and report them on the databases tab.
Added instrumentation for automatically wrapping the WSGI application when using the CherryPy WSGI server bundled with the CherryPy framework.
Added instrumentation for automatically wrapping the WSGI application when using the WSGI server from the Python standard library wsgiref module. Be aware that due to non conformance with the WSGI specification, it is not recommended that the WSGI server from the wsgiref module be used unless using Python 2.7.4 or higher. Issues with older versions of the WSGI server in the wsgiref module will cause incorrect reporting of data. More details are provided in our status of the Python agent.


Bug fixes/Improvements:


External web calls made using the 'requests' module from a session were not being correctly monitored, resulting in such requests being picked up as being performed by the lower level 'httplib' module and the time taken not being inclusive of the whole request.
The collection of explain plans by the agent in a background thread when performing a data harvest, was not explicitly performing a rollback. This could result in database proxies such as pgbouncer believing the database connection was now dirty and force closing the connection and ejecting it from the current database connection pool.
The wrapper used by the agent around wsgi.input passed in the WSGI request environment was preventing non standard WSGI applications directly reaching down to the original socket connection so as to implement extensions such as websockets.
The object wrapper used in our instrumentation for function traces has been improved so that it will pass type checks performed using builtin Python calls such as isinstance(), isfunction() and isclass(). This addresses issues where the object wrappers could interfere with the correct operation of web frameworks which derived the calling convention to be used when invoking a handler function from the type of the handler. Note that using type() on the wrapper object will still yield its true type, so functions such as isinstance() should always be used where possible.
The agent could fail on startup when running on a system with a non English locale using a custom date/time format.

1.11.0.55 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent introduces a major new feature called X-Ray Sessions. This feature allows you to gain deeper insights into a key transaction's performance by showing transaction traces alongside long-running profiler results.

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

New features:


X-Ray Sessions provide more targeted transaction trace samples and thread profiling for web transactions. For full details see our X-Ray sessions documentation.
For new agent installations, the agent will now default to using a SSL connection when connecting to our data collector to report any data. If updating from an older agent version, you will however need to manually update your agent configuration file and change the 'ssl' setting to 'true' to always use SSL connections.
When connecting direct to our data collector over a SSL connection, SSL certificate validation will now be performed to mitigate the possibility of man in the middle attacks.
Breakdown metrics for transactions are now recorded as unscoped metrics as well as the existing metrics scoped to a web transaction. As custom dashboards can only chart unscoped metrics, what this means is that it is now possible to create custom dashboards that display data on specific breakdown metrics, such as time spent in traced functions. For example, you may wish to chart time spent in creating database connections, or specific middleware and view handler functions.
When displaying error details, the full path of the exception is now displayed and not just the class name. This makes it easier to correctly identify the full name, with that name then being able to be directly copied into the 'error_collector.ignore_errors' setting of the agent configuration file if it is desired that that exception be ignored.
Added the 'newrelic.agent.record_custom_metrics()' function to the public API for the agent to allow the recording of many custom metrics in one function call to the agent.


XXXFeatures Changed:


We have temporarily disabled the generation of CPU burn information for transaction traces. This was displaying inaccurate values after a UI change, but also had an underlying issue whereby it was reporting CPU burn by the whole process and not just the thread handling the request. We are withdrawing the feature until we can improve the accuracy of the reported value.
We have disabled the ability to get thread profiling information when a WSGI server makes use of coroutine libraries such as gevent or eventlet. This is because the nature of how coroutines are implemented, means we were are not able to generate accurate usable data.


Bug fixes/Improvements:


When queueing Celery tasks from a web application, those web transactions were in some cases being wrongly categorised as background tasks. The name of the transaction was also being labelled with a string with the object representation, resulting in metric grouping issues.
The older version of the 'requests' package we were bundling and were using for any HTTP calls was not closing socket descriptors immediately when a requests session object was disposed of. This could result in a small number of open socket descriptors being held open until the Python garbage collector kicked in and closed them.
Login credentials supplied as part of a URL, could in some circumstances appear with the URL parameter associated with a web external node in a transaction trace sample.
Django 1.5 moved which module the 'Http404' exception was declared in. As a result we were no longer correctly ignoring it when catching exceptions to process as errors.
A check designed to warn against the use of uWSGI versions prior to 1.2.6, which contain a bug which results in the agent recording incorrect response times, was failing on very old uWSGI versions.
Updated our gevent instrumentation to accommodate a prototype change in gevent 1.0rc1.
Updated our bottle instrumentation to handle the non numeric version string used in bottle development versions.
After five minutes of being unable to connect to our data collector to report data, the agent will now internally reset itself, discarding accumulated metric data and require the agent to reregister itself with our core application before collecting data once again. This is to ensure that we do not unnecessarily keep accruing data and causing an increase in memory usage while we cannot contact our data collector.
Avoid the potential for a web request to deadlock in a situation where a web framework transaction management system made a copy of the object we use to record details about web transactions or background tasks.

1.10.2.38 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent fixes an issue when floating point values were used in headers used to calculate queueing time.

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

Bug fixes/Improvements:


When a float value was provided in the X-Request-Start or X-Queue-Start headers as the time stamp, it was not being parsed correctly and the fractional part was being discarded. This was resulting in loss off accuracy.

1.10.1.36 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent contains improvements in the way that queueing time is calculated.

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

Bug fixes/Improvements:


Resolved some issues with tracking of front-end queue time, particularly
when the agent is running on an app hosted on Heroku.  The agent will now
more reliably parse the headers described in
https://newrelic.com/docs/features/tracking-front-end-time and will
automatically detect whether the times provided are in seconds,
milliseconds or microseconds.

1.10.0.28 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

This release of the Python agent contains a fix for when reporting to multiple applications, as well as other minor bug fixes and enhancements.

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

New features:


On the Linux platform, the agent environment now reports the total amount of system memory available.
Added support for psycopg2cffi database module.
Custom parameters can be associated with function trace nodes for display against transaction traces in the UI.
The URL associated with a call to an external service will now be shown in the custom parameters section for the node in a transaction trace. Previously would have been shown as a label when hovering other the node.


Bug fixes/Improvements:


The agent was not reporting any data where multiple applications were being listed in in the app_name configuration setting.
Calling register_application() in the context of a module import could cause a temporary deadlock when a timeout period was specified. The potential for deadlock will now be detected and the function will return without waiting.
When the agent was configured to capture query string parameters, a key with an empty value was being discarded and not reported.
When using gevent mode of gunicorn, the SystemExit exception was being logged on process shutdown due to gevent sending the SystemExit exception to all greenlets and not just the main thread when sys.exit() was called.
Instrumentation wrapping the Django reverse() function was not accepting named parameters.
If custom parameters were used with a transaction, the HTTP response STATUS was duplicated in details related to an error raised from that transaction.
Changes to Django instrumentation to avoid metric grouping issues resulting from raw URLs leaking through as transaction name.

1.9.0.21 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes:

This release of the Python agent addresses an issue with under reporting of memory use on Linux, as well as other minor bug fixes and enhancements.

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

New features:


Added support for automatically wrapping the WSGI application entry point when using the Paste HTTP server.
Custom metrics can now be reported via the public agent API by supplying an appropriate application object as an additional argument to 'newrelic.agent.record_custom_metric()'.
Added support for the 'psycopg2ct' database client module for PostgreSQL.
When needing to communicate via a firewall, the proxy settings can now be set via environment variables in addition to being able to be set in the agent configuration file.
The number of CPU cores is now being reported in the agent environment and displayed in the UI.
A warning will now be logged in the agent log file if an older version of uWSGI is being used which has bugs with its conformance to the WSGI specification. Such older uWSGI versions would see incorrect data being reported due to the bug in uWSGI.
A warning will now be logged in the agent log file if uWSGI is being used and the 'enable-threads' option is not being supplied to uWSGI to enable threading within the Python interpreter, a feature which is a mandatory requirement for the Python agent to be able to work.
A range of additional logging and debugging options have been added to allow our support team to better help you when you are having issues with setting up the agent.


Bug fixes/Improvements:


Addressed problem where memory usage was being under reported on Linux systems. The degree to which memory usage was under reported was dependent on the memory page size the system was using. If affected you can expect to see memory usage being reported jump up as it reports the correct value.
If the local Python installation is already using a 'sitecustomize.py' file, the agent's own 'sitecustomize.py' file will ensure that the existing copy is imported and code in it executed so that existing definitions are still applied.
Installation of the agent could fail under buildout due to a missing Python future import for the Python with statement under Python 2.5.
Made parsing of URLs more tolerant to malformed URLs in web external calls. The agent was encountering an error when the port number of a URL was not an integer, resulting in the data for that transaction being discarded.
Use of raw greenlets from within a transaction was failing causing an exception and the users web request to typically fail with a HTTP 500 error response.
Configuration of the agent will no longer fail on startup if there is no 'newrelic' section in the configuration file.

1.8.0.13 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes:

This release of the Python agent enables the ability to set apdex values and alerts for key transactions  (discussed here)

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

New features:


Added support in the agent required to enable apdex values to be specified for key transactions.
Added support for tracking SQL database queries when using the 'oursql' database client module for MySQL.


Bug fixes/Improvements:


The sqlite3 instrumentation was preventing the use of a sqlite3 database connection object as a context manager together with the 'with' statement.
Suppressed the logging produced by the urllib3 module included within the bundled requests module, when making socket connections.

1.7.0.31 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes:

This release of the Python agent focuses on providing a low-overhead thread profiler which can monitor and record executing threads for a specified time, without affecting the customer experience.

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

New features:


Low-overhead thread profiler. A profiling session can be initiated for a period from 2 to 10 minutes. The profiler will periodically sample what all the executing threads are doing, aggregating the results together to get a statistical snapshot of where in your application most time is being spent.


Bug fixes/Improvements:


Importing of the greenlet module was resulting in the capacity analysis report metrics being disabled, even though it was meant to only be disabled when specifically using a coroutine based WSGI server such as gevent and eventlet mode of gunicorn.
Improvements to the instrumentation wrapper applied to the Django view handler function so that code which tries to compare the view handler to an expected value should work. Note that this is dependent upon using an equality test rather than an identity test.
Reverted prior change which stripped the instrumentation wrapper from the Django view handler when it was passed to any Django view middleware. Improvements to the instrumentation wrapper should remove the need to do this. Having the view handler passed in with the wrapper applied is required to ensure that calls to the view handler are tracked properly where the view handler is called from within the view middleware.
Although not strictly required due to improvements to the instrumentation wrapper applied to a Django view handler, strip the wrapper when a view handler is passed into django.core.urlresolvers.reverse() function to ensure it can correctly determine the URL mapping to the view handler.
Disable automatic RUM header/footer insertion when using Django 1.5 and the new streaming HTTP response object is returned. This is being disabled so that the response is not buffered, thereby interfering with the streaming process. If streaming a HTML response and RUM reporting is still required, the RUM header and footer will need to be added manually.
Instrumentation of the feedparser module was causing an exception when a file like object rather than a string was passed to the feedparser.parse() function.
Tastypie instrumentation was failing to be applied if using Python 2.5.

1.6.0.13 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes:

This release of the Python agent is a minor feature and bug fix release.

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

New features:


When reporting web application performance data against multiple applications in the New Relic UI at the same time, any end user metric data will now also be reported against all applications. Previously end user metric data would only be reported against the first application.
The environment variable 'NEW_RELIC_SSL' can now be set to enable use of a SSL connection when reporting data to our data collector. Enabling values are 'true', 'on' or '1'. This can be used on platforms such as Heroku where configuration is performed using environment variables instead of an agent configuration file.
Added instrumentation for tracking database queries when using the 'pymysql' module for the MySQL database.


Bug fixes/Improvements:


Fix to algorithm calculating name of function for case where function was wrapped with a decorator implemented using a class. Previously was using the name of the decorator class rather than the name of the wrapped function.
Fix for ZeroDivision error when calculating per request CPU burn, where due to clock granularity for system the request was quick enough to effectively have zero duration.
Fix for AttributeError when trying to process None as a slow transaction trace when in a harvest period there were browser traces but no application server traces.

1.5.0.103 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes:

This release of the Python agent contains capacity analysis reporting, an improved sampling algorithm to ensure a wider sampling of slow transactions and added support for TastyPie, dropbox and facepy modules.

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

New features:


Enable capacity analysis reporting where web application is single threaded or multithreaded (but not coroutine based system such as gevent and eventlet). This report helps you determine if you have enough instances deployed to keep up with request load and so tune your configuration for optimal performance.
Criteria by which slow transaction samples are captured has been changed so as to include slow transactions for a broader range of transactions. Previously the transaction with the slowest overall response time would always be captured and reported. Whether a specific transaction will be preserved as a sample of a slow transaction will now also depend on whether a recent slow transaction had already been captured for it and give preference to recording slow transactions for a different transaction, rather than the same transaction all the time, if it is always the slowest.
Where TastyPie is being used with Django, instead of all web transactions being handled by TastyPie being labeled against the TastyPie wrapper, the web transactions will now be aggregated against the specific methods of the resource or API object handling the request.
Added instrumentation for the 'dropbox' Python module to track time spent calling out to the DropBox web service. A call to this web service would have been tracked previously by virtue of the 'dropbox' module internally using the 'httplib' module. This added instrumentation however makes the data collected more accurate as will properly track time spent sending the request and receiving the response. It will also attribute the call to the 'dropbox' module in transaction traces and performance breakdown data.
Added instrumentation for the 'facepy' Python module to track time spent calling out to the Facebook web service. A call to this web service would have been tracked previously by virtue of the 'facepy' module internally using the 'requests' module. This added instrumentation however allows the call to be attributed to the 'facepy' module in transaction traces and performance breakdown data.
Added support for gevent < 0.13.7 by way of patching an existing bug in gevent. The specific problem in gevent was patched in version 0.13.7 of that package. This change will allow older versions of gevent to also be used if there is a requirement.


Bug fixes/Improvements:


Instrumentation for Genshi templates was failing when the OR operator was used inside of a template.
If an exception occurred in the first call to read data from wsgi.input to get the request content, it would cause a subsequent exception when recording of response time was being finalised. This wasn't causing any impact on user requests, but would result in any metrics for that request being discarded and an error being logged in the agent log.

1.4.0.137 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes:

This release of the Python agent introduces a number of new features including improvements to RUM browser traces. Performance of the agent has also been improved though reducing some of the overheads when dealing with tracking SQL database queries.

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

New features:


The agent now collects additional application tier transaction trace samples for slow transactions and will correlate them with any corresponding RUM browser trace.
Slow transaction traces will now show a figure corresponding to the amount of CPU burn that occurred during the period the transaction was running. This can be used to get an indication of whether code being executed was CPU intensive or principally waiting on I/O.
Slow transaction traces for web requests will now provide an indication of how many concurrent requests were executing at the same time in the process the request was being handled. This can be used to determine how busy the process was at that time, but would also be used in conjunction with the recorded CPU burn to determine whether CPU burn was all from the one transaction or could also be due to parallel executing web requests in a multithreaded application. Note that this measure is dependent on an optional C extension component of the agent being able to be installed at the time of installation of the agent.
Slow transaction traces for web requests will now display information about the amount of request content read and the amount of response content generated. This will include details about what methods of 'wsgi.input' were used to read content and how long it in total took to read the request content. Similar details are also provided about how response content was generated and how long it took from start to finish.
Slow transaction traces for web requests will now display the value of any front-end queueing time within the server stack which pertained to that specific request. Note that this is dependent on the server stack having being configured to introduce the required header to allow queueing time to be measured. The Python agent recognises the 'X-Queue-Start' header.
Automatic support is now provided for tracking front-end queueing time within the server stack when an application is deployed to Heroku.
An API call and means via the WSGI environ dictionary is now provided for indicating that a transaction should not be a candidate for slow transaction traces. This is to allow one to ignore transactions which are known to always be slow. The API call is 'newrelic.agent.suppress_transaction_trace()'.
Calls to Django APIs for sending emails will now be tracked in the performance breakdown for transactions, as well as being displayed in slow transaction traces.
Support for Celery 3.0.


Bug fixes/Improvements:


Overheads within the agent which could affect performance of the application have been reduced. The improvements specifically revolve around the processing of SQL database queries. This is principally to address larger than expected overheads seen by a very small subset of users which had large or more complicated SQL queries. The changes could though still result in a small general reduction in overhead and CPU usage directly attributable to the monitoring down by the agent when SQL database queries are being tracked.
Where it is possible to build C extension components at the time the agent is installed, optional C speedups for JSON will now be installed. This reduces the overhead of JSON encoding when data is being sent by the agent to the New Relic data collector on each one minute harvest cycle. If the C extension cannot be compiled, the agent will fall back to using pure Python code as it has done in prior versions of the agent.
Django instrumentation has been improved and issues addressed with the way that instrumentation wrappers were applied to view handlers. For example, when a view handler is passed to a view middleware, any instrumentation wrapper is now removed. This is because the wrapper could cause issues for some code which tried to do a direct comparison between the view handler passed and an expected value. It is believed this change will fix issues when using Mezzanine.
A sporadic issue with the data collector rejecting uploaded data due to what it believes was malformed JSON should be addressed. This was due to some metric values being aggregated as integers rather than as float values. This resulted in overflow of 64 bit values in the data collector due to Python supporting arbitrary length integers and thus being able to send values larger than 64 bits.
The agent will now no longer fail on import when -OO option is used with the Python interpreter to enable highest level of optimisation. This was an issue as -OO strips documentation strings from code and the agent was not handling the case that the documentation string would then be a None object.

1.3.0.289 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes:

This release of the Python agent has focused on improving the way the agent communicates with the New Relic core application. This includes improved logging and error handling, but also adds support for SSL and connecting via a proxy when the monitored host is located behind a firewall.

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

Changed features:


The request method for a call to an external web service, when able to be collected by instrumentation, is now shown against a web external node in a slow transaction trace where as previously it showed the path segment of the URL. The URL, minus embedded user/password and query string is instead now shown as a label when hovering over the web external node in the slow transaction trace details.
Improved logging and error handling when communicating with the New Relic core application. Many messages previously logged as errors will now be logged as warnings and an error only logged when a recurring problem is detected. This should reduce emails triggered from errors logged via the Python logging module to only those that may actually require action.
Significant error messages or warnings will be output to standard output when running the agent test via the 'newrelic-admin validate-config' command. This ensures that it will be easier to detect when the test has failed due to network connectivity or license key issues.


New features:


Connecting to the New Relic core application using a secure SSL connection is now supported. This is enabled by setting the 'ssl' setting in the agent configuration file to 'true'.
Connecting to the New Relic core application via a proxy is now supported. This is enabled by setting the 'proxy_host' and 'proxy_port' settings in the agent configuration file. If a secure SSL connection is desired, the 'ssl' setting can be set to 'true' at the same time. If the proxy requires a user name and password, the 'proxy_user' and 'proxy_pass' settings can be additionally set.
When sending collected data to the New Relic core application it will be compressed when over a certain size to cut down on the amount of data being sent.
The Python agent now includes its own self instrumentation and profiling capabilities to allow New Relic to monitor the performance of the agent itself and help debug any performance issues reported by a user which may occur in rare circumstances with certain web applications.


Bug fixes:


Where a user name and password were being included as part of a URL for a call to an external web service, eg., 'user:passlocalhost/', that the Python agent was instrumenting, the details were not always being scrubbed properly from details being reported to the New Relic core application.

1.2.1.265 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Bug fixes:


Fix assertion violations when greenlets were used explicitly in the context of a normal thread based request handler.
Installation of package using Python 2.5 was giving warnings when trying to byte code compile installed .py files due to missing import for 'with_statement' from __future__ module in some modules.
The newrelic-admin script is now installed correctly when installing the package as an egg under buildout.
The newrelic.agent.stop_recording() function was causing errors when using any WSGI hosting mechanism other than Apache/mod_wsgi and wasn't working as intended even under mod_wsgi.
Disable CPU sampling when os.times() is not available, such as when using Jython.
Derivation of name when instrumenting the __init__() method of a class could fail if the class had a __len__() method which  accessed methods/attributes which were only setup during the constructor.
Move importing of multiprocessing module to global scope to avoid logging module bug in Python versions up to 2.6.

1.2.0.246 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Bug fixes:


Added full support for being able to use agent package with buildout.
Previously the 'newrelic-admin' script was not installed correctly when
buildout was being used to manage package installation.
Added support for versions 2.2 and 2.5 of the distributed task queuing
system Celery.
Added support for older 'redis' client versions which did not separate
commands into 'StrictRedis' and 'Redis' client objects.
The database table name was not always extracted properly from SQL
queries where sub selects were being used, especially when additional
bracketing was being used for readability. Usually this was occuring where
hand crafted SQL was being generated rather than being automatically
generated through an ORM or DAL.
Type handler registration in psycopg2 client module would fail due to
agent instrumentation wrapper around connection and cursor objects.
Javascript header added into response of type 'text/html' when Django
being used and end user monitoring enabled, would be placed into wrong
location of '' element if 'X-UA-Compatible' meta tag existed. This
would cause issues for IE browser clients which meta tag related to.


New features:


Server side configuation is now available for the Python agent. This
will be of most use for Heroku installations where there is by default
no agent configuration file for defining local override settings.
Distiguish time spent invoking the WSGI application for a request and the
subsequent processing of any iterable returned by the WSGI application.
These will show as nodes 'WSGI/Application' and 'WSGI/Response' in
performance breakdowns and slow transaction traces. This mainly helps where
iterable is a generator which performs work for each yielded item as
provides proper context. Time spent in writing back a large reponse to a
slow HTTP client will also be more visible.
Distinguish separately the time spent in the top level WSGI application
callable where the agent WSGI middleware wrapper is being applied. This
will be the node which gets listed immediately under 'WSGI/Application' in
a slow transaction trace.
For Django, record separately time spent in processing certain types of
form POSTs. This helps to show where being spent processing a large data
upload.
Show content length and content type details for a request in slow
transaction and error details.
Show content length for a response in slow transaction and error details.


Features changed:


Longer timeout when doing an agent test using the 'validate-config'
command of the 'newrelic-admin' script. The short timeout was previously
causing some users with slow DNS or networks to see the test as failing.

1.1.0.192 insecure

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Fixes:


Addressed a performance issue which would cause high CPU load, when parsing SQL queries which had a large number of values for a SQL 'IN' clause.
Agent version was not reported in form A.B.C.D in all cases. This was causing UI to warn that Python agent was out of date even when running version newer than the minimum recommended version.
When 'feedparser' module is used, now correctly track external web service requests where URI used 'feed' or feed:http' for scheme.
Illegal non ASCII characters in a URL could cause the agent to generate Unicode conversion warnings or outright fail a request with an exception where the character sequence could not be decoded to Unicode using the Python system default encoding.
The table name for a SQL query was not being correctly derived when the SQL contained a select sub query or table name aliases were being used.
Number of nodes captured for a slow transaction trace was not being capped properly resulted in too much data being sent through to core application. This could result in details of slow transaction being rejected by core application, or result in a timeout in UI when attempting to display the slow transaction trace.
SQL calls made using 'psycopg2' were failing where optional parameters argument was not supplied to database cursor 'execute()' method and the SQL contained a '%' character such as in a 'LIKE' clause.
Was not ignoring exception of type 'bottle.HTTPError' raised within application using Bottle. This is not a true exception but is used to programmatically indicate a non 200 HTTP response so shouldn't have been recorded as an error.
The 'django-piston' instrumentation was failing when an error occurred in users handler and it tried to generate an error response. This was because 'django-piston' was assuming that a handler would always be a normal function. It would therefore fail for a decorator/wrapper implemented using a class object as is used by the agent instrumentation.


New features:


Added support for capturing explain plans for slow SQL when using MySQL and PostgreSQL.
Added preliminary public API for manually instrumenting additional functions in user code and interacting with the current transaction to override how and what details about the transaction are recorded.
Added the 'transaction_tracer.function_trace' setting in the agent configuration file for providing a simplified way of specifying additional Python functions for which time metrics should be collected. Time spent in these functions will then appear in web transaction performance break down and slow transaction traces.
Added new or improved support for tracking external web service requests made using the 'urllib', 'urllib2', 'urllib3', 'httplib', 'httplib2' and 'requests' modules. Note that only time taken for the initial connect for the HTTP connection may be recorded. Uninstrumented time which appears immediately after an external web service request in a slow transaction trace made using one of these modules, will therefore possibly be the time then taken to send request data, wait for a response and consume that response data.
Added support for tracking external requests to a Solr service using the 'pysolr' and 'solrpy' modules. Time spent making the request will show on the overview charts as Solr time. Metrics for individual types of requests will also be listed in web transaction performance breakdown and slow transaction traces.
Added Django application called 'newrelic.extras.framework_django' which explicitly adds in 'newrelic_tags' tag library containing template tags for manually adding in RUM header and footer. Reliance on the old method whereby template tag library was added automatically is now deprecated and will be removed in a future version.
Added support for Bottle 0.10.X in Bottle specific instrumentation.
Added support for Redis using the 'redis' module. Support consists of tracking time spent connecting to and issuing commands against the Redis service.
Added support for MongoDB using the 'pymongo' module. Support consists of tracking time spent connecting to and issuing commands against the MongoDB service.


Features changed:


The 'capture_params' setting was defaulting to 'true' rather than 'false' resulting in the request query string parameters being reported against errors and slow transaction traces. If upgrading you will need to change the agent configuration file you are already using to change it to 'false' if capturing parameters is not desired.
Rollup metrics against web transactions for external web service requests will now only be recorded against the host and will not be broken out based on resource requested on the remote service.

1.0.5.156

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Fixes:


Details of errors were not being captured and passed back to the core application to be displayed by the UI when the URL for the request had query string parameters. The problem was not causing failure of the overall web application but that a problem was occuring would have been identifiable though a Python agent exception and traceback being recorded in the Python agent log file with message:
NameError: global name 'request_params' is not defined
Slow transactions were never being recorded when agent run using method where no agent configuration file was being used. This is the case for example when using Heroku.


New features:


Added support for the distributed task queuing system Celery. Tasks executed by a Celery server can be tracked and reported as background tasks against an application in the New Relic UI.
Added support for tracking as external web service requests calls made out via the pywapi module.
Added support for automatic wrapping of WSGI application entry point when using flup WSGI adapter for FASTCGI, SCGI and AJP.
Added support for meinheld as standalone WSGI server and also as a worker class when using gunicorn.
Added support for recording database transactions when using pyodbc.

1.0.3.138

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Fixes:


Where instrumentation was not available for the web framework or toolkit being used and web transactions were being named according to the original URL, metric normalization rules were not being correctly applied when metric grouping issues occurred due to a large number of unique URLs. This was resulting in grouping of web transactions metrics under incorrect names leading to the data presented by the UI being unhelpful or misleading.
Agent would fail when collecting WSGI hosting environment information when an older version of Tornado web server was used which did not provide version information. This would lead to no web transactions metrics being reported as failure occured when agent was trying to register with the New Relic core application.
Instrumentation of the feedparser module was not catering for the fact that the parse() function could be supplied arguments beyond just the URL to be retreived. This would result in an exception and the web transaction always failing when such additional arguments were supplied.
Instrumentation for Django was improved so that view handler function name was reported against a web transaction rather than URL when using Django static files mechanism.
Instrumentation for Django was improved so that technical 404 and 500 response handler function name was used for web transaction when appropriate.
Instrumentation for Django was improved to ensure that request middleware function name was always used for web transaction name when it returned a valid response.


Features changed:


Attributes captured from WSGI request environment such as 'REQUEST_METHOD', 'HTTP_REFERER' and 'HTTP_USER_AGENT' are now shown under the 'Request environment' category in error details and slow transaction traces rather than under 'Custom parameters'.
The HTTP response status for a web transaction is now shown as 'STATUS' under the 'Response properties' category in error details and slow transaction traces rather than under 'Custom parameters'.

1.0.2.130

The end-of-life date for this agent version is July 29, 2019. To update to the latest agent version, see Update the agent. For more information, see End-of-life policy.


Notes

The first general release of the Python agent. If you are using an older BETA version of the Python agent you should upgrade as soon as possible as many outstanding issues were fixed leading up to this release. No change history for older versions will be made available.

Links

Releases