• English日本語한국어
  • ログイン今すぐ開始

Python agent release notesRSS

June 24, 2014
Python agent v2.22.0.19

重要

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.

June 13, 2014
Python agent v2.20.1.18

重要

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.

May 29, 2014
Python agent v2.20.0.17

重要

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.

March 28, 2014
Python agent v2.18.1.15

重要

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.

March 5, 2014
Python agent v2.16.0.12

重要

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.

February 17, 2014
Python agent v2.14.0.11

重要

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.

February 3, 2014
Python agent v2.12.0.10

重要

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.

January 24, 2014
Python agent v2.10.1.9

重要

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.

January 17, 2014
Python agent v2.10.0.8

重要

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.

December 13, 2013
Python agent v2.8.0.7

重要

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.

Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.