v6.8.0
Initial Ruby 2.7 support
The Ruby agent has been verified to run with Ruby 2.7.0-preview1.
New API method to add custom attributes to Spans
New API method for adding custom attributes to spans. Previously, custom attributes were only available at the Transaction level. Now, with Span level custom attributes, more granular tagging is possible for easier isolation and review of traces. For more information:
Enables ability to migrate to configurable security policies (CSP) on a per-agent basis for accounts already using high-security mode (HSM).
When both HSM and CSP are enabled for an account, an agent (this version or later) can successfully connect with either
high_security: true
or the appropriatesecurity_policies_token
configured.high_security
has been added as part of the preconnect payload.Bugfix for logs-in-context combined with act-fluent-logger-rails
Previously, when using the Ruby agent's logs-in-context logger to link logging data with trace and entity metadata for an improved experience in the UI, customers who were also using the
act-fluent-logger-rails
gem would see aNoMethodError
forclear_tags!
that would interfere with the use of this feature. This error no longer appears, allowing customers to combine the use of logs-in-context with the use of this gem.Please note that the logs-in-context logger does not support tagged logging; if you are initializing your logger with a
log_tags
argument, your custom tags may not appear on the final version of your logs.Bugfix for parsing invalid newrelic.yml
Previously, if the newrelic.yml configuration file was invalid, and the agent could not start as a result, the agent would not log any indication of the problem.
This version of the agent will emit a FATAL message to STDOUT when this scenario occurs so that customers can address issues with newrelic.yml that prevent startup.
Configuration options containing the terms "whitelist" and "blacklist" deprecated
The following local configuration settings have been deprecated:
autostart.blacklisted_constants
: useautostart.denylisted_constants
instead.autostart.blacklisted_executables
: useautostart.denylisted_executables
instead.autostart.blacklisted_rake_tasks
: useautostart.denylisted_rake_tasks
instead.strip_exception_messages.whitelist
: usestrip_exception_messages.allowed_classes
instead.
Bugfix for module loading and constant resolution in Rails
Starting in version 6.3, the Ruby agent has caused module loading and constant resolution to sometimes fail, which caused errors in some Rails applications. These errors were generally
NoMethodError
exceptions or I18n errorstranslation missing
orinvalid locale
. These errors would not appear if the agent was removed from the application's Gemfile. This version of the agent fixes these issues with module loading and constant resolution, so these errors no longer occur.Bugfix: failed to get urandom
Previous versions of the agent would fail unexpectedly when the Ruby process used every available file descriptor. The failures would include this message:
ERROR : RuntimeError: failed to get urandomThis version of the agent uses a different strategy for generating random IDs, and will not fail in the same way when no file descriptors are available.
v6.7.0
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.
Trace and Entity Metadata API
Several new API methods have been added to the agent:
These API methods allow you to access information that can be used to link data of your choosing to a trace or entity.
Logs in Context
This version of the agent includes a logger, which can be used in place of
::Logger
from the standard library, orActiveSupport::Logger
from Rails. This logger leverages the new trace and entity metadata API to decorate log statements with entity and trace metadata, so they can be correlated together in the New Relic UI.For more information on how to use logs in context, see https://docs.newrelic.com/docs/enable-logs-context-ruby
Project metadata in Gemspec
Project metadata has been added to the gemspec file. This means our Rubygems page will allow users to more easily access the agent's source code, raise issues, and read the changelog.
Thanks to Orien Madgwick for the contribution!
v6.6.0
Bugfix for ActionCable Instrumentation
Previous versions of the agent sometimes caused application crashes with some versions of ActionCable. The application would exit quickly after startup with the error:
uninitialized constant ActionCable::Engine
.Version 6.6.0 of the agent no longer crashes in this way.
Handling of disabling Error Collection
When the agent first starts, it begins collecting Error Events and Traces before fetching configuration from New Relic. In previous versions of the agent, those events or traces would be sent to New Relic, even if Error Collection is disabled in the application's server-side configuration.
Version 6.6.0 of the agent drops all collected Error Events and Traces if the configuration from the server disables Error Collection.
Improvements
Change to default setting for ActiveRecord connection resolution
Due to incompatibilities between the faster ActiveRecord connection resolution released in Ruby agent v6.3.0 and other gems that patch ActiveRecord, backport_fast_active_record_connection_lookup
will now be set to false
by default. This will result in significant performance improvement.
Recommendation: If your environment includes ActiveRecord, change this setting to true
.
Exception: If you are using other gems that measure ActiveRecord performance, they may lose functionality when combined with this setting. If you are unsure whether to enable backport_fast_active_record_connection_lookup
, we recommend enabling it in a development environment to make sure other gems that patch ActiveRecord are still working as expected.
Fixes
Bugfix for ActiveStorage instrumentation error
Version 6.4.0 of the agent introduced a bug that interfered with ActiveStorage callbacks, resulting in the agent being unable to instrument ActiveStorage operations. ActiveStorage segments are now correctly recorded.
Bugfix for ActiveRecord 4.1 and 4.2 exception logging
Version 6.3.0 of the agent introduced a bug that prevented ActiveRecord versions 4.1 and 4.2 from logging exceptions that occurred within a database transaction. This version of the agent restores the exception logging functionality from previous agent versions. Thanks to Oleksiy Kovyrin for the contribution!
Notes
The Ruby agent now enforces a maximum of 10,000 transaction events and custom events and 100 error events per minute.
v6.4.0
Custom Metadata Collection
The agent now collects environment variables prefixed by
NEW_RELIC_METADATA_
. These may be added to transaction events to provide context between your Kubernetes cluster and your services. For details on the behavior, see this blog post.Bugfix for faster ActiveRecord connection resolution
Version 6.3.0 of the agent backported the faster ActiveRecord connection resolution from Rails 6.0 to previous versions, but the implementation caused certain other gems which measured ActiveRecord performance to stop working. This version of the agent changes the implementation of this performance improvement so no such conflicts occur.
Bugfix for Grape instrumentation error
Previous versions of the agent would fail to install Grape instrumentation in Grape versions 1.2.0 and up if the API being instrumented subclassed
Grape::API::Instance
rather thanGrape::API
. A warning would also print to the newrelic_agent log:WARN : Error in Grape instrumentationWARN : NoMethodError: undefined method `name' for nil:NilClassThis version of the agent successfully installs instrumentation for subclasses of
Grape::API::Instance
, and these log messages should no longer appear.Bugfix for streaming responses
Previous versions of the agent would attempt to insert JavaScript instrumentation into any streaming response that did not make use of
ActionController::Live
. This resulted in an empty, non-streamed response being sent to the client.This version of the agent will not attempt to insert JavaScript instrumentation into a response which includes the header
Transfer-Encoding=chunked
, which indicates a streaming response.This should exclude JavaScript instrumentation for all streamed responses. To include this instrumentation manually, see Manually instrument via agent API in our documentation.
v6.3.0
Official Rails 6.0 support
This version of the agent has been verified against the Rails 6.0.0 release.
As ActiveRecord 4, 5, and 6 use the same New Relic instrumentation, the
disable_active_record_4
anddisable_active_record_5
settings in NewRelic.yml are being deprecated in favor of the newdisable_active_record_notifications
. This new setting will affect the instrumentation of ActiveRecord 4, 5, and 6. The deprecated settings will be removed in a future release.Bugfix for
newrelic deployments
scriptFor applications housed in the EU, the
newrelic deployments
script included with previous versions of the agent would fail with the following message:Deployment not recorded: Application does not exist.
This is because the script would attempt to send the deployment notification to the US region. The deployment script now sends deployments to the correct region.Faster ActiveRecord connection resolution
This version of the agent uses the faster ActiveRecord connection resolution that Rails 6.0 uses, even on previous versions of Rails. Thanks to Callum Jones for the contribution!
Support non-ascii characters in hostnames
Previous versions of the agent would frequently log warnings like:
log writing failed. "\xE2" from ASCII-8BIT to UTF-8
if the hostname contained a non-ascii character. This version of the agent will no longer log these warnings. Thanks to Rafael Petry for the contribution!
v6.2.0
Bugfix for superfluous
Empty JSON response
error messagesVersion 6.1.0 of the agent frequently logged error messages about an empty JSON response, when no error had occurred. These logs no longer appear.
Bugfix for
Unable to calculate elapsed transaction time
warning messagesRuby Agent versions 5.4 through 6.1, when running in jruby without ObjectSpace enabled, would occasionally log a warning indicating that the agent was unable to calculate the elapsed transaction time. When this log statement appeared, the affected transactions would not be included in the data displayed on the capacity analysis page. These transactions are now correctly recorded.
v6.1.0
Performance monitoring on Kubernetes
This release adds Transaction event attributes that provide context between your Kubernetes cluster and services. For details on the benefits, see this blog post.
Bugfix for Bunny instrumentation when popping empty queues
When a customer calls
Bunny::Queue#pop
on an empty queue, Bunny returns anil
value. Previous Ruby Agent versions raised aNoMethodError
when trying to process this result. Now, the agent correctly skips processing fornil
values. Thanks to Matt Campbell for the contribution.
v6.0.0
Tracer API for flexible custom instrumentation
With agent version 6.0, we are introducing the
Tracer
class, an officially supported public API for more flexible custom instrumentation. By calling itsin_transaction
method, you can instrument an arbitrary section of Ruby code without needing to juggle any explicit state. Behind the scenes, the agent will make sure that the measured code results in an APM segment inside a transaction.The same API contains additional methods for creating transactions and segments, and for interacting with the current transaction. For more details, see the custom instrumentation documentation.
If you were previously using any of the agent's private, undocumented APIs, such as
Transaction.wrap
orTransaction.start/stop
, you will need to update your code to use the Tracer API.The full list of APIs that were removed or deprecated are:
External.start_segment
Transaction.create_segment
Transaction.start
Transaction.stop
Transaction.start_datastore_segment
Transaction.start_segment
Transaction.wrap
TransactionState.current_transaction
If are you using any of these APIs, please see the upgrade guide for a list of replacements.
Agent detects Rails 6.0
The agent properly detects Rails 6.0 and no longer logs an error when started in a Rails 6.0 environment. This does not include full Rails 6.0 support, which will be coming in a future release. Thanks to Jacob Bednarz for the contribution.
v5.7.0
Ruby 2.6 support
We have tested the agent with the official release of Ruby 2.6.0 made on December 25, 2018.
Support for loading Sequel core standalone
The agent will now enable Sequel instrumentation when an application loads Sequel's core standalone, which does not use the
Sequel:Model
class. Thanks to Vasily Kolesnikov for the contribution!Grape 1.2 support
With agent versions 5.6 and earlier, Grape 1.2 apps reported their transactions under the name
Proc#call
instead of the name of the API endpoint. Starting with agent version 5.7, all existing versions of Grape will report the correct transaction name. Thanks to Masato Ohba for the contribution!