Notes
pruby marshaller removed
The deprecated pruby marshaller has now been removed; the
marshaller
config option now only acceptsjson
. Customers still running Ruby 1.8.7/REE must add thejson
gem to their Gemfile, or (preferably) upgrade to Ruby 1.9.3 or higher.Log dates in ISO 8601 format
The agent will now log dates in ISO 8601 (
YYYY-MM-DD
) format, instead ofMM/DD/YY
.Additional attributes collected
The agent now collects the following information in web transactions:
Accept
,Host
,User-Agent
,Content-Length
HTTP request headers, HTTP request method, andContent-Type
HTTP response header.TransactionErrors
reported for APM error advanced analyticsWith this release, the agent reports
TransactionError
events. These new events power the beta feature Advanced Analytics for APM errors. The error events are also available today through New Relic Insights.Advanced Analytics for APM errors lets you see all of your errors, with granular detail. Filter and group by any attribute to analyze them. Take action to resolve issues through collaboration.
For more information, see View APM errors and error traces.
Bug Fixes
Don't fail to send data when using mathn library
Version 3.12.1 introduced a bug with applications using the mathn library that would prevent the agent from sending data to New Relic. This has been fixed.
Notes
Don't use a pager when running
git log
commandThis would cause Capistrano deploys to hang when a large number of commits were being deployed. Thanks to John Naegle for reporting and fixing this issue!
Official support for JRuby 9.0.0.0
The Ruby agent is now officially fully tested and supported on JRuby 9.0.0.0.
Instrumentation for MongoDB 2.1.x
Visibility in your MongoDB queries returns when using version 2.1.0 of the Mongo driver or newer. Thanks to Durran Jordan of MongoDB for contributing the Mongo Monitoring instrumentation!
Fix for ArgumentError "invalid byte sequence in UTF-8"
This would come up when trying to parse out the operation from a database query containing characters that would trigger a invalid byte sequence in UTF-8 error. Thanks to Mario Izquierdo for reporting this issue!
Improved database metric names for ActiveRecord::Calculations queries
Aggregate metrics recorded for queries made via the ActiveRecord::Calculations module (#count, #sum, #max, etc.) will now be associated with the correct model name, rather than being counted as generic 'select' operations.
Allow at_exit handlers to be installed for Rubinius
Rubinius can support the at_exit block used by install_exit_handler. Thanks to Aidan Coyle for reporting and fixing this issue!
Notes
Bugfix for uninitialized constant
NewRelic::Agent::ParameterFiltering
Users in some environments encountered a
NameError: uninitialized constant NewRelic::Agent::ParameterFiltering
from the Rails instrumentation while running v3.12.x of the Ruby agent. This issue has been fixed.Rake task instrumentation
The Ruby agent now provides opt-in tracing for Rake tasks. If you run long jobs via Rake, you can get all the visibility and goodness of New Relic that your other background jobs have. For more information, see Rake instrumentation.
Redis instrumentation
Redis operations will now show up on the Databases tab and in transaction traces. By default, only command names will be captured; to capture command arguments, set
transaction_tracer.record_redis_arguments
totrue
in your configuration. For more information, see Redis instrumentation.Fix for over-obfuscated SQL Traces and PostgreSQL
An issue with the agent obfuscating column and table names from Slow SQL Traces when using PostgreSQL has been resolved.
Rubinius 2.5.8 VM metric renaming support
Rubinius 2.5.8 changed some VM metric names and eliminated support for total allocated object counters. The agent has been updated accordingly.
Fix agent attributes with a value of false not being stored
An issue introduced in v3.12.1 prevented attributes (like those added with
add_custom_attributes
) from being stored if their value was false. This has been fixed.
Notes
More granular Database metrics for ActiveRecord 3 and 4
Database metrics recorded for non-SELECT operations (UPDATE, INSERT, DELETE, etc.) on ActiveRecord 3 and 4 now include the model name that the query was being executed against, allowing you to view these queries broken down by model on the Datastores page. Thanks to Bill Kayser for reporting this issue!
Support for Multiverse testing third party gems
The Ruby agent has rich support for testing multiple gem versions, but previously that wasn't accessible to third party gems. Now you can now simply
require 'task/multiverse'
in your Rakefile to access the same test:multiverse task that New Relic uses itself. For more details, see Multiverse: Test against multiple gem versionsUse Sidekiq 3.x's error handler
Sidekiq versions 3.0 or higher provide an error handler for internal and middleware related failures. Failures at these points were previously unseen by the Ruby agent, but now they are properly traced.
Better error messages for common configuration problems with Capistrano
Templating errors in newrelic.yml would result in obscure error messages during Capistrano deployments. These messages now more properly reflect the root cause of the errors.
newrelic_ignore
methods allow stringsThe
newrelic_ignore
methods previously only supported passing symbols, and would quietly ignore any strings passed. Now strings can be passed as well to get the intuitive ignoring behavior you'd expect.Replace DNS resolver for Resque jobs with Resolv
In some circumstances customers with a very high number of short-lived Resque jobs were experiencing deadlocks during DNS resolution. Resolv is an all Ruby DNS resolver that replaces the libc implementation to prevent these deadlocks.
Notes
Flexible capturing of attributes
The Ruby agent now allows you more control over exactly which request parameters and job arguments are attached to transaction traces, traced errors, and Insights events. For details, see:
https://docs.newrelic.com/docs/agents/ruby-agent/ruby-agent-attributes
Fixed missing URIs in traces for retried Excon requests
If Excon's idempotent option retried a request, the transaction trace node for the call would miss having the URI assigned. This has been fixed.
Capturing request parameters from rescued exceptions in Grape
If an exception was handled via a rescue_from in Grape, request parameters were not properly set on the error trace. This has been fixed. Thanks to Ankit Shah for helping us spot the bug.
Notes
Better naming for Rack::URLMap
If a Rack app made direct use of Rack::URLMap, instrumentation would miss out on using the clearest naming based on the app class. This has been fixed.
Avoid performance regression in makara database adapter
Delegation in the makara database adapter caused performance issues when the agent looked up a connection in the pool. The agent now uses a faster lookup to work around this problem in makara, and allocates less as well. Thanks Mike Nelson for the help in resolving this!
Allow audit logging to STDOUT
Previously audit logs of the agent's communication with New Relic could only write to a file. This prevented using the feature on cloud providers like Heroku. Now STDOUT is an allowed destination for
audit_log.path
. Logging can also be restricted to certain endpoints viaaudit_log.endpoints
.For more information see https://docs.newrelic.com/docs/agents/ruby-agent/installation-configurat...
Fix for crash during startup when Rails required but not used
If an application requires Rails but wasn't actually running it, the Ruby agent would fail during startup. This has been fixed.
Use IO.select explicitly in the event loop
If an application adds their own select method to Object/Kernel or mixes in a module that overrides the select method (as with ActionView::Helpers) we would previously have used their implementation instead of the intended IO.select, leading to all sorts of unusual errors. We now explicitly reference IO.select in the event loop to avoid these issues.
Fix for background thread hangs on old Linux kernels
When running under Ruby 1.8.7 on Linux kernel versions 2.6.11 and earlier, the background thread used by the agent to report data would hang, leading to no data being reported. This has been be fixed.
Fix for segmentation fault with sequel_pg 1.6.11
The Ruby agent incorrectly rescued exceptions at a point which caused sequel_pg 1.6.11 to segfault. This has been fixed. Thanks to Oldrich Vetesnik for the report!
Unified view for SQL database and NoSQL datastore products.
The response time charts in the application overview page will now include NoSQL datastores, such as MongoDB, and also the product name of existing SQL databases such as MySQL, Postgres, etc.
The Databases page will now enable the filtering of metrics and operations by product, and includes a table listing all operations.
For existing SQL databases, in addition to the existing breakdown of SQL statements and operations, the queries are now also associated with the database product being used.
For NoSQL datastores, such as MongoDB, we have now added information about operations performed against those products, similar to what is being done for SQL databases.
Because this introduces a notable change to how SQL database metrics are collected, it is important that you upgrade the agent version on all hosts. If you are unable to transition to the latest agent version on all hosts at the same time, you can still access old and new metric data for SQL databases, but the information will be split across two separate views.
For more information see https://docs.newrelic.com/docs/apm/applications-menu/monitoring/database...
Track background transactions as Key Transactions
In prior versions of the Ruby agent, only web transactions could be tracked as Key Transactions. This functionality is now available to all transactions, including custom Apdex values and X-Ray sessions.
For more information see https://docs.newrelic.com/docs/apm/selected-transactions/key-transaction...
More support and documentation for third-party extensions
It's always been possible to write extension gems for the Ruby agent, but now there's one location with best practices and recommendations to guide you in writing extensions. Check out https://docs.newrelic.com/docs/agents/ruby-agent/frameworks/third-party-...
We've also added simpler APIs for tracing datastores and testing your extensions. It's our way of giving back to everyone who's helped build on the agent over the years. <3
Fix for anonymous class middleware naming
Metric names based off anonymous middlewares lacked a class name in the UI. The Ruby agent will now look for a superclass, or default to AnonymousClass in those cases.
Improved exit behavior in the presence of Sinatra
The agent uses an at_exit
hook to ensure data from the last < 60s before a process exits is sent to New Relic. Previously, this hook was skipped if Sinatra::Application was defined. This unfortunately missed data for short-lived background processes that required, but didn't run, Sinatra. Now the agent only skips its at_exit
hook if Sinatra actually runs from at_exit
.
Notes
Support for the Grape framework
We now instrument the Grape REST API framework! To avoid conflicts with the third-party newrelic-grape gem, our instrumentation will not be installed if newrelic-grape is present in the Gemfile.
For more details, see https://docs.newrelic.com/docs/agents/ruby-agent/frameworks/grape-instru...
Automatic Cross Application Tracing support for all Rack applications
Previously Rack apps not using Rails or Sinatra needed to include the AgentHooks middleware to get Cross Application Tracing support. With these changes, this is no longer necessary. Any explicit references to AgentHooks can be removed unless the
disable_middleware_instrumentation
setting is set totrue
.Metrics no longer reported from Puma master processes
When using Puma's cluster mode with the preload_app! configuration directive, the agent will no longer start its reporting thread in the Puma master process. This should result in more accurate instance counts, and more accurate stats on the Ruby VMs page (since the master process will be excluded).
Better support for Sinatra apps used with Rack::Cascade
Previously, using a Sinatra application as part of a Rack::Cascade chain would cause all transactions to be named after the Sinatra application, rather than allowing downstream applications to set the transaction name when the Sinatra application returned a 404 response. This has been fixed.
Updated support for Rubinius 2.3+ metrics
Rubinius 2.3 introduced a new system for gathering metrics from the underlying VM. Data capture for the Ruby VM's page has been updated to take advantage of these. Thanks Yorick Peterse for the contribution!
Fix for missing ActiveJob traced errors
ActiveJobs processed by backends where the Ruby agent lacked existing instrumentation missed reporting traced errors. This did not impact ActiveJobs used with Sidekiq or Resque, and has been fixed.
Fix possible crash in middleware tracing
In rare circumstances, a failure in the agent early during tracing of a web request could lead to a cascading error when trying to capture the HTTP status code of the request. This has been fixed. Thanks to Michal Cichra for the fix!