v5.2.0
Use priority sampling for errors and custom events
Priority sampling replaces the older reservoir event sampling method. With this change, the agent will maintain randomness across a given time period while improving coordination among transactions, errors, and custom events.
Bugfix for wrapping datastore operations
The agent will now complete the process of wrapping datastore operations even if an error occurs during execution of a callback.
Notes
Rails 5.2 support
The Ruby agent has been validated against the latest release of Ruby on Rails!
Support for newer libraries and frameworks
We have updated the multiverse suite to test the agent against current versions of several frameworks.
Add
custom_attributes.enabledconfiguration optionThis option is enabled by default. When it's disabled, custom attributes will not be transmitted on transaction events or error events.
Fix Grape load order dependency
The agent will now choose the correct name for Grape transactions even if the customer's app loads the agent before Grape. Thanks to Daniel Doubrovkine for the contribution!
Add
webpacker:compileto blacklisted taskswebpacker:compileis commonly used for compiling assets. It has been added toAUTOSTART_BLACKLISTED_RAKE_TASKSin the default configuration. Thanks to Claudio B. for the contribution!Make browser instrumentation W3C-compliant
type="text/javascript"is optional for the<script>tag under W3C. Thetypeattribute has now been removed from browser instrumentation. Thanks to Spharian for the contribution!Deferred
add_method_tracercallsIf a third-party library calls
add_method_tracerbefore the agent has finished starting, we now queue these calls and run them when it's safe to do so (rather than skipping them and logging a warning).Bugfix for Resque
around/beforehooksIn rare cases, the agent was not instrumenting Resque
aroundandbeforehooks. This version fixes the error.Truncation of long stack traces
Occasionally, long stack traces would cause complications sending data to New Relic. This version truncates long traces to 50 frames (split evenly between the top and bottom of the trace).
Notes
SSL connections to New Relic are now mandatory
Prior to this version, using an SSL connection to New Relic was the default behavior, but could be overridden. SSL connections are now enforced (not overrideable).
Additional security checking before trying to explain multi-statement SQL queries
Customer applications might submit SQL queries containing multiple statements (e.g., SELECT * FROM table; SELECT * FROM table). For security reasons, we should not generate explain plans in this situation.
Although the agent correctly skipped explain plans for these queries during testing, we have added extra checks for this scenario.
Bugfix for RabbitMQ exchange names that are symbols
The agent no longer raises a TypeError when a RabbitMQ exchange name is a Ruby symbol instead of a string.
Bugfix for audit logging to stdout
Previous agents configured to log to stdout would correctly send regular agent logs to stdout, but would incorrectly send audit logs to a text file named "stdout". This release corrects the error.
Bugfix for Capistrano deployment notifications on v3.7 and beyond
Starting with version 3.7, Capistrano uses a different technique to determine a project's version control system. The agent now works correctly with this new behavior. Thanks to Jimmy Zhang for the contribution.
Notes
Initialize New Relic Agent before config initializers
When running in a Rails environment, the agent registers an initializer that starts the agent. This initializer is now defined to run before config/initializers. Previously, the ordering was not specified for the initializer. This change guarantees the agent will started by the time your initializers run, so you can safely reference the Agent in your custom initializers. Thanks to Tony Ta for the contribution.
Ruby 2.5 Support
The Ruby Agent has been verified to run under Ruby 2.5.
request.uriCollected as an Agent AttributeUsers can now control the collection of
request.urion errors and transaction traces. Previously it was always collected without the ability to turn it off. It is now an agent attribute that can be controlled via the attributes config. For more information on agent attributes see here.
Notes
Bugfix for Manual Browser Instrumentation
There was a previous bug that required setting both
rum.enabled: falseandbrowser.auto_instrument: falseto completely disable browser monitoring. An attempt to fix this in 4.7.0 resulted in breaking manual browser instrumentation. Those changes have been reverted. We will revisit this issue in an upcoming release.
Notes
Expected Error API
The agent now sends up
error.expectedas an intrinsic attribute on error events and error traces. When you passexpected: trueto thenotice_errormethod, both Insights and APM will indicate that the error is expected.Typhoeus Hydra Instrumentation
The agent now has request level visibility for HTTP requests made using Typhoeus Hydra.
Total Time Metrics are Recorded
The agent now records Total Time metrics. In an application where segments execute concurrently, the total time can exceed the wall-clock time for a transaction. Users of the new Typhoeus Hydra instrumentation will notice this as changes on the overview page. Immediately after upgrading there will be an alert in the APM dashboard that states: "There are both old and new time metrics for this time window". This indicates that during that time window, some transactions report the total time metrics, while others do not. The message will go away after waiting for enough time to elapse and / or updating the time window.
Add
:messagecategory toset_transaction_namepublic API methodThe agent now permits the
:messagecategory to be passed into the public API methodset_transaction_name, which will enable the transaction to be displayed as a messaging transaction.Create
prepend_active_record_instrumentationconfig optionUsers may now set the
prepend_active_record_instrumentationoption in their agent config to install Active Record 3 or 4 instrumentation usingModule.prependrather thanalias_method.Use Lazy load hooks for
ActionController::BaseandActionController::APIThe agent now uses lazy load hooks to hook on
ActionController::BaseandActionController::API. Thanks Edouard Chin for the contribution!Use Lazy load hooks for
ActiveRecord::BaseandActiveRecord::RelationThe agent uses lazy load hooks when recording supportability metrics for
ActiveRecord::BaseandActiveRecord::Relation. Thanks Joseph Haig for the contribution!Check that
Rails::VERSIONis defined instead of justRailsThe agent now checks that
Rails::VERSIONis defined since there are cases whereRailsis defined butRails::VERSIONis not. Thanks to Alex Riedler and nilsding for the contribution!Support fast RPC/direct reply-to in RabbitMQ
The agent can now handle the pseudo-queue 'amq.rabbitmq.reply-to' in its Bunny instrumentation. Previously, using fast RPC led to a
NoMethodErrorbecause the reply-to queue was expected to be aQueueobject instead of a string.
Notes
Public API for External Requests
The agent now has public API for instrumenting external requests and linking up transactions via cross application tracing. See the API Guide for more details on this new functionality.
Notes
Send synthetics headers even when CAT disabled
The agent now sends synthetics headers whenever they are received from an external request, even if cross-application tracing is disabled.
Bugfix for DelayedJob Daemonization
Customers using the delayed_job script that ships with the gem may encounter an IOError with a message indicating the stream was closed. This was due to the agent attempting to write a byte into a Pipe that was closed during the deamonization of the delayed_job script. This issue has been fixed.
Collect supportability metrics for public API
The agent now collects Supportability/API/{method} metrics to track usage of all methods in the agent's public API.
Collect supportability metrics on
Module#prependThe agent now collects Supportability/PrependedModules/{Module} metrics for ActiveRecord 4 and 5, ActionController 4 and 5, ActionView 4 and 5, ActiveJob 5, and ActionCable 5. These help track the adoption of the
Module#prependmethod so we can maintain compatibility with newer versions of Ruby and Rails.Collect explain plans when using PostGIS ActiveRecord adapter
The agent will now collect slow SQL explain plans, if configured to, on connections using the PostGIS adapter. Thanks Ari Pollak for the contribution!
Lazily Intialize New Relic Config
The agent will lazily initialize the New Relic config. This allows the agent to pickup configuration from environment variables set by dotenv and similar tools.
Notes
Include test helper for 3rd party use
In 4.2.0, all test files were excluded from being packaged in the gem. An agent class method
NewRelic::Agent.require_test_helperwas used by 3rd party gem authors to test extensions to the agent. The required file is now included in the gem.Collect cloud metadata from Azure, GCP, PCF, and AWS cloud platform
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.
Install
at_exithook when running JRubyThe agent now installs an
at_exithook when running JRuby, which wasn't done before because of constraints related to older JRuby versions that are no longer supported.User/Utilization and System/Utilization metrics not recorded after Resque forks
The agent no longer records invalid User/Utilization and System/Utilization metrics, which can lead to negative values, in forks of Resque processes.
Add
identifierfield to agent connect settingsThe agent now includes a unique identifier in its connect settings, ensuring that when multiple agents connect to multiple different apps, data are reported for each of the apps.
Clear transaction state after forking now opt-in
The agent waits to connect until the first web request when it detects it's running in a forking dispatcher. When clearing the transaction state in this situation we lose the first frame of the transaction and the subsequent trace becomes corrupted. We've made this feature opt-in and is turned off by default. This behavior only affects the first transaction after a dispatcher forks.
v4.3.0
Instrumentation for the Bunny AMQP Client
The Bunny AMQP Client 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. See the message queues documentation page for more details.
Safely normalize external hostnames
The agent has been updated to check for nil host values before downcasing the hostname. Thanks Rafael Valério for the contribution!
PageView events will not be generated for ignored transactions
The agent now checks if transaction is ignored before injecting the New Relic Browser Agent. This will prevent PageView events from being generated for ignored transactions.
Datastores required explicitly in agent
The agent has been modified to explicity
requirethe Datastores module whereas previously there were situations where the module could be implicitly defined. Thanks Kevin Griffin for the contribution!Clear transaction state after forking
Previously, if a transaction was started and the process forks, the transaction state survived the fork and
#after_forkcall in thread local storage. Now, this state is cleared by#after_fork.Postgis adapter reports as Postgres for datastores
The agent now maps the Postgis adapter to Postgres for datastore metrics. Thanks Vojtěch Vondra for the contribution!
Deprecate
:trace_onlyoptionThe
NewRelic::Agent.notice_errorAPI has been updated to deprecate the:trace_onlyoption in favor of:expected.