Notes
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.
Important
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 yournewrelic.ini
configuration file:transaction_tracer.explain_enabled = falseMetric 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 bothHTTPClient
andAsyncHTTPClient
.) That means that the application that thehttpclient
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 synthetic monitoring, the Python agent will not capture transaction traces for synthetic checks, so you will be unable to connect your synthetic 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
andtornado.wsgi.WSGIContainer
is untested and unsupported.Use of
tornado.platform.asyncio
to bridge betweenasyncio
and Tornado IOLoop is untested and unsupported. Currently, the agent only supports the use of thetornado.ioloop.IOLoop
.Use of the
async
andawait
keywords is untested and unsupported.Integration with
Twisted
is untested and unsupported.
Notes
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 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
(wasresponse.contentLength
)response.headers.contentType
(wasresponse.contentType
)
Notes
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.
Notes
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.
Notes
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
andAccept
- 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.
Notes
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, boolPython 3: str, bytes, int, float, bool
All values which are not one of these types are automatically converted by calling str(value)
.
Notes
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.
New Features
- Allowing Exception Messages
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 an allow list 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.
Notes
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.
Notes
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.
Notes
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.