Notes
This release of the Python agent includes an update to the API for recording exceptions, default request attributes, optional function trace attributes, and 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
newrelic.agent.record_exception now adds attributes to spans
The public API method
newrelic.agent.record_exception
now attaches exception details to the currently executing span. Spans with error details are now highlighted red in the distributed tracing UI. Also, the attributeserror.class
anderror.message
are added to the span. If multiple errors are recorded for a single span, only the final error's attributes will be added to the span.Note: Exceptions recorded on spans may be double counted in the distributed tracing UI.
New default web request attributes.
The previously optional attributes
request.headers.accept
,request.headers.host
, andrequest.headers.userAgent
are now included by default on all web transactions. These attributes can be excluded through agent configuration.peer.address and peer.hostname can now be excluded from spans through configuration
peer.address and peer.hostname may be excluded from span events through
attribute.exclude
options in the agent configuration.
Bug fixes
Fix issue which could potentially lead to missing event data
When the agent was shutting down, event harvest may have been skipped causing any events captured in the final 5 seconds of application execution to be discarded. This has now been fixed.
Runtime instrumentation error messages for calling
__exit__
before__enter__
were erroneously loggedUnder certain conditions, the agent may have logged an error message for transaction
__exit__
being called before trace__enter__
. This error message is now printed only if the error condition is true.
Known issues and workarounds
- If a .NET agent is initiating distributed traces as the root service, you must update that .NET agent to version 8.24 or later before upgrading your downstream New Relic Python agents to this agent release.
Notes
This release of the Python agent includes a new API for adding custom attributes on span events, improvements to external type spans, deprecations, and 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 new api newrelic.agent.add_custom_span_attribute
There is now a public API method allowing users to add custom attributes directly to spans.
Improved features
External spans now contain HTTP response code
External HTTP spans will now contain a new attribute
http.statusCode
with the http response code for each external call made. This attribute will be added when using any supported HTTP client.
Deprecations
LambdaHandlerWrapper and lambda_handler APIs are deprecated
The Lambda API functionality has been moved to a separate package called newrelic-lambda. All future lambda implementations should use the new package for lambda monitoring.
Bug fixes
Fix application crash when using a non-WSGI framework with synthetics
When synthetic monitors were used with an application utilizing a non-WSGI web framework (such as aiohttp), a crash could have occurred if an outbound HTTP request was attempted from within the transaction. This crash has now been fixed.
The Python agent generates an invalid nr tracestate entry
Under certain random conditions, the agent may have generated an invalid New Relic w3c tracestate entry, resulting in potentially missing parts of traces. This invalid tracestate entry would not impact propagation of tracestate values from other vendors.
Known issues and workarounds
- If a .NET agent is initiating distributed traces as the root service, you must update that .NET agent to version 8.24 or later before upgrading your downstream New Relic Python agents to this agent release.
Notes
This release of the Python agent includes an implementation for w3c trace context, support for uvloop, 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
New APIs for creating / accepting distributed trace headers
This version of the agent deprecates
newrelic.agent.create_distributed_trace_payload
andnewrelic.agent.accept_distributed_trace_payload
in favor ofnewrelic.agent.insert_distributed_trace_headers
andnewrelic.agent.accept_distributed_trace_headers
. See the Python agent API documentation for details.Support for W3C Trace Context, with easy upgrade from New Relic Trace Context
Distributed Tracing now supports W3C Trace Context headers for HTTP and gRPC protocols when distributed tracing is enabled. Our implementation can accept and emit both W3C trace header format and New Relic trace header format. This simplifies agent upgrades, allowing trace context to be propagated between services with older and newer releases of New Relic agents. W3C trace header format will always be accepted and emitted. New Relic trace header format will be accepted, and you can optionally disable emission of the New Relic trace header format.
When distributed tracing is enabled with
distributed_tracing.enabled = true
, the Python agent will now accept W3C'straceparent
andtracestate
headers when callingaccept_distributed_trace_headers
. When callinginsert_distributed_trace_headers
, the Python agent will include the W3C headers along with the New Relic distributed tracing header, unless the New Relic trace header format is disabled usingdistributed_tracing.exclude_newrelic_header = true
Also, see the "Known Issues and Workarounds" section of these Release notes.
Improved Features
Add support for uvloop
Transaction context may not have been propagated when using uvloop. This could have resulted in incomplete traces or instrumentation failures when using uvloop. uvloop is now supported.
Bug Fixes
Fix crash when using aiohttp_cors
Customers using the agent with aiohttp_cors may have experienced a crash when the aiohttp_cors framework was used in conjunction with aiohttp class based views. This crash has now been fixed.
Fix grpc v1.26 instrumentation errors
Customers using grpc v1.26 and above may have experienced an error message in the New Relic agent logs indicating there was an instrumentation error. Additionally, some data may have been missing when this error was encountered. This issue has now been fixed.
Known Issues and Workarounds
- If a .NET agent is initiating distributed traces as the root service, you must update that .NET agent to version 8.24 or later before upgrading your downstream New Relic Python agents to this agent release.
Notes
This release of the Python agent includes a bug fix for reporting inaccurate metric values.
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
Metrics may be reported with an incorrect throughput after communication failure with New Relic
For agent versions 5.2.0 through 5.4.0, metric throughput may have been reported inaccurately after experiencing network / communication failures with New Relic. The throughput reported for all metrics after this failure may have been abnormally high.
Notes
This release of the Python agent includes the logs in context feature and 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
Logs In Context
The logs in context feature is now supported by the PythonaAgent. For more information, see the Python logs-in-context page.
Bug Fixes
The plugin list in the environment page may have been inaccurately reported
When using absolute imports in Python 2, the agent may have reported relative imports that were attempted but unsuccessful. Python 3 is not impacted. Modules are now reported correctly in Python 2.
Notes
This release of the Python agent includes support for Python 3.8 and restores the original record-deploy command interface.
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.
Updates
Added Support for Python 3.8
Python 3.8 support has been added in this release.
Restore newrelic-admin record-deploy command interface
The newrelic-admin command was previously updated to require an application id via the command line. The requirement has been removed, restoring the original record-deploy CLI arguments.
Notes
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 thread utilization data on agent versions v5.x.x
Thread utilization data was not reported for agents v5.x.x, resulting in missing data on the capacity analysis page. The agent will now report thread utilization data.
Fix untraced database calls when using pymysql context manager assignments
When using context managers to create and assign a cursor in pymysql, database calls on that cursor object were not traced. Database calls in pymysql are now properly traced.
Notes
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 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 that created it, the agent may have crashed if a separate transaction was active.
Notes
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
Support for Real Time Streaming
- Event data is now sent to New Relic every five seconds, instead of every minute. As a result, transaction, error, and custom events will now be available in New Relic and Insights dashboards in near real time. For more information on how to view your events with a five-second refresh, see the real time streaming documentation.
- Note that the overall limits on how many events can be sent per minute have not changed. Also, span events, metrics, and trace data is unaffected, and will still be sent every minute.
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.
Notes
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.