- Ruby 1.8.7 users: upgrade or add JSON gem now
Ruby 1.8.7 is end-of-lifed, and not receiving security updates, so we strongly encourage all users with apps on 1.8.7 to upgrade.
If you're not able to upgrade yet, be aware that a coming release of the Ruby agent will require users of Ruby 1.8.7 to have the 'json' gem available within their applications in order to continue sending data to New Relic.
For more details, see: https://docs.newrelic.com/docs/ruby/ruby-1.8.7-support
- Support for new Cross Application Trace view
This release enhances cross application tracing with a visualization of the cross application calls that a specific Transaction Trace is involved in. The new visualization helps you spot bottlenecks in external services within Transaction Traces and gives you an end-to-end understanding of how the transaction trace is used by other applications and services. This leads to faster problem diagnosis and better collaboration across teams. All agents involved in the cross application communication must be upgraded to see the complete graph. You can view cross application traces from in the Transaction Trace drill-down.
- High security mode V2
The Ruby agent now supports V2 of New Relic's high security mode. To enable it, you must add 'high_security: true' to your newrelic.yml file, and enable high security mode through the New Relic web interface. The local agent setting must be in agreement with the server-side setting, or the agent will shut down and no data will be collected.
Customers who already had the server-side high security mode setting enabled must add 'high_security: true' to their agent configuration files when upgrading to this release.
For details on high security mode, see: http://docs.newrelic.com/docs/accounts-partnerships/accounts/security/high-security
- Improved memcached instrumentation
More accurate instrumentation for the 'cas' command when using version 1.8.0 or later of the memcached gem. Previous versions of the agent would count all time spent in the block given to 'cas' as memcache time, but 1.8.0 and later allows us to more accurately measure just the time spent talking to memcache.
Many thanks to Francis Bogsanyi for contributing this change!
- Improved support for Rails apps launched from outside the app root directory
The Ruby agent attempts to resolve the location of its configuration file at runtime relative to the directory that the host process is started from.
In cases where the host process was started from outside of the application's root directory (for example, if the process is started from from '/'), it will now also attempt to locate its configuration file based on the value of Rails.root for Rails applications.
- Better compatibility with ActionController::Live
Browser Application Monitoring auto-injection can cause request failures under certain circumstances when used with ActionController::Live, so the agent will now automatically detect usage of ActionController::Live, and not attempt auto-injection for those requests (even if auto-instrumentation is otherwise enabled).
Many thanks to Rodrigo Rosenfeld Rosas for help diagnosing this issue!
- Fix for occasional spikes in external services time
Certain kinds of failures during HTTP requests made by an application could have previously resulted in the Ruby agent reporting erroneously large amounts of time spent in outgoing HTTP requests. This issue manifested most obviously in spikes on the 'Web external' band on the main overview graph. This issue has now been fixed.
- Fix 'rake newrelic:install' for Rails 4 applications
The newrelic:install rake task was previously not working for Rails 4 applications and has been fixed.
Thanks to Murahashi Sanemat Kenichi for contributing this fix!
- Rack middleware instrumentation
The Ruby agent now automatically instruments Rack middlewares!
This means that the agent can now give you a more complete picture of your application's response time, including time spent in middleware. It also means that requests which previously weren't captured by the agent because they never made it to the bottom of your middleware stack (usually a Rails or Sinatra application) will now be captured.
After installing this version of the Ruby agent, you'll see a new 'Middleware' band on your application's overview graph, and individual middlewares will appear in transaction breakdown charts and transaction traces.
The agent can instrument middlewares that are added from a config.ru file via Rack::Builder, or via Rails' middleware stack in Rails 3.0+.
This instrumentation may be disabled with the disable_middlware_instrumentation configuration setting.
For more details, see the documentation for this feature:
- http://docs.newrelic.com/docs/ruby/rack-middlewares - http://docs.newrelic.com/docs/ruby/middleware-upgrade-changes
- Capistrano 3.x support
Recording application deployments using Capistrano 3.x is now supported.
Many thanks to Jennifer Page for the contribution!
- Better support for Sidekiq's Delayed extensions
Sidekiq jobs executed via the Delayed extensions (e.g. the #delay method) will now be named after the actual class that #delay was invoked against, and will have their job arguments correctly captured if the sidekiq.capture_params configuration setting is enabled.
Many thanks to printercu for the contribution!
- Improved Apdex calculation with ignored error classes
Previously, a transaction resulting in an exception that bubbled up to the top level would always be counted as failing for the purposes of Apdex calculations (unless the transaction name was ignored entirely). Now, exceptions whose classes have been ignored by the error_collector.ignore_errors configuration setting will not cause a transaction to be automatically counted as failing.
- Allow URIs that are not parseable by stdlib's URI if addressable is present
There are some URIs that are valid by RFC 3986, but not parseable by Ruby's stdlib URI class. The Ruby agent will now attempt to use the addressable gem to parse URIs if it is present, allowing requests against these problematic URIs to be instrumented.
Many thanks to Craig R Webster and Amir Yalon for their help with this issue!
- More robust error collection from Resque processes
Previously, traced errors where the exception class was defined in the Resque worker but not in the Resque master process would not be correctly handled by the agent. This has been fixed.
- Allow Sinatra apps to set the New Relic environment without setting RACK_ENV
The NEW_RELIC_ENV environment variable may now be used to specify the environment the agent should use from its configuration file, independently of RACK_ENV.
Many thanks to Mario Izquierdo for the contribution!
- Better error handling in Browser Application Monitoring injection
- Allow disabling of Net::HTTP instrumentation
Most instrumentation in the Ruby agent can be disabled easily via a configuration setting. Our Net::HTTP instrumentation was previously an exception, but now it can also be disabled with the disable_net_http configuration setting.
- Make Rails constant presence check more defensive
The Ruby agent now guards against the (rare) case where an application has a Rails constant defined, but no Rails::VERSION constant (because Rails is not actually present).
Many thanks to Vladimir Kiselev for the contribution!
- Better handling for Rack applications implemented as middlewares
When using a Sinatra application as a middleware around another app (for example, a Rails app), or manually instrumenting a Rack middleware wrapped around another application, the agent would previously generate two separate transaction names in the New Relic UI (one for the middleware, and one for the inner application).
As of this release, the agent will instead unify these two parts into a single transaction in the UI. The unified name will be the name assigned to the inner-most traced transaction by default. Calls to NewRelic::Agent.set_transaction_name will continue to override the default names assigned by the agent's instrumentation code.
This change also makes it possible to run X-Ray sessions against transactions of the 'inner' application in cases where one instrumented app is wrapped in another that's implemented as a middleware.
- Support for mongo-1.10.0
The Ruby agent now instruments version 1.10.0 of the mongo gem (versions 1.8.x and 1.9.x were already supported, and continue to be).
- Allow setting configuration file path via an option to manual_start
Previously, passing the :config_path option to NewRelic::Agent.manual_start would not actually affect the location that the agent would use to look for its configuration file. This has been fixed, and the log messages emitted when a configuration file is not found should now be more helpful.
- Better support for forking and daemonizing dispatchers (e.g. Puma, Unicorn)
The agent should now work out-of-the box with no special configuration on servers that fork or daemonize themselves (such as Unicorn or Puma in some configurations). The agent's background thread will be automatically restarted after the first transaction processed within each child process.
This change means it's no longer necessary to set the 'restart_thread_in_children setting' in your agent configuration file if you were doing so previously.
- Rails 4.1 support
Rails 4.1 has shipped, and the Ruby agent is ready for it! We've been running our test suites against the release candidates with no significant issues, so we're happy to announce full compatibility with this new release of Rails.
- Ruby VM measurements
The Ruby agent now records more detailed information about the performance and behavior of the Ruby VM, mainly focused around Ruby's garbage collector. This information is exposed on the new 'Ruby VM' tab in the UI. For details about what is recorded, see:
- Separate in-transaction GC timings for web and background processes
Previously, an application with GC instrumentation enabled, and both web and background processes reporting in to it would show an overly inflated GC band on the application overview graph, because data from both web and non-web transactions would be included. This has been fixed, and GC time during web and non-web transactions is now tracked separately.
- More accurate GC measurements on multi-threaded web servers
The agent could previously have reported inaccurate GC times on multi-threaded web servers such as Puma. It will now correctly report GC timings in multi-threaded contexts.
- Improved ActiveMerchant instrumentation
The agent will now trace the store, unstore, and update methods on ActiveMerchant gateways. In addition, a bug preventing ActiveMerchant instrumentation from working on Ruby 1.9+ has been fixed.
Thanks to Troex Nevelin for the contribution!
- More robust Real User Monitoring script injection with charset meta tags
- More robust connection sequence with New Relic servers
A rare bug that could cause the agent's initial connection handshake with New Relic servers to silently fail has been fixed, and better logging has been added to the related code path to ease diagnosis of any future issues.
- Prevent over-counting of queue time with nested transactions
When using add_transaction_tracer on methods called from within a Rails or Sinatra action, it was previously possible to get inflated queue time measurements, because queue time would be recorded for both the outer transaction (the Rails or Sinatra action) and the inner transaction (the method given to add_transaction_tracer). This has been fixed, so only the outermost transaction will now record queue time.
- Obfuscation for PostgreSQL explain plans
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).
For more information, see: https://docs.newrelic.com/docs/traces/security-for-postgresql-explain-plans
- More accurate categorization of SQL statements
Some SQL SELECT statements that were previously being mis-categorized as 'SQL - OTHER' will now correctly be tagged as 'SQL - SELECT'. This particularly affected ActiveRecord users using PostgreSQL.
- More reliable Typhoeus instrumentation
Fixed an issue where an exception raised from a user-specified on_complete block would cause our Typhoeus instrumentation to fail to record the request.
- Fix for Puma 2.8.0 cluster mode (18.104.22.168)
Puma's 2.8.0 release renamed a hook New Relic used to support Puma's cluster mode. This resulted in missing data for users running Puma. Thanks Benjamin Kudria for the fix!
- Fix for deployment command bug (22.214.171.124)
Problems with file loading order could result in
newrelic deploymentsfailing with an unrecognized command error. This has been fixed.
- Mongo instrumentation improvements
Users of the 'mongo' MongoDB client gem will get more detailed instrumentation including support for some operations that were not previously captured, and separation of aggregate metrics for web transactions from background jobs.
An issue with ensure_index when passed a symbol or string was also fixed. Thanks Maxime RETY for the report!
- More accurate error tracing in Rails 4
Traced errors in Rails 4 applications will now be correctly associated with the transaction they occurred in, and custom attributes attached to the transaction will be correctly attached to the traced error as well.
- More accurate partial-rendering metrics for Rails 4
View partials are now correctly treated as sub-components of the containing template render in Rails 4 applications, meaning that the app server breakdown graphs for Rails 4 transactions should be more accurate and useful.
- Improved Unicorn 4.8.0 compatibility
A rare issue that could lead to spurious traced errors on app startup for applications using Unicorn 4.8.0 has been fixed.
- meta_request gem compatibility
An incompatibility with the meta_request gem has been fixed.
- Typhoeus 0.6.4+ compatibility
A potential crash with Typhoeus 0.6.4+ when passing a URI object instead of a String instance to one of Typhoeus's HTTP request methods has been fixed.
- Sequel single threaded mode fix
The agent will no longer attempt to run EXPLAIN queries for slow SQL statements issued using the Sequel gem in single-threaded mode, since doing so could potentially cause crashes.
- Additional functionality for add_custom_parameters
Calling add_custom_parameters adds parameters to the system codenamed Rubicon. For more information, see http://newrelic.com/software-analytics
- Update gem signing cert (126.96.36.199)
The certificate used to sign newrelic_rpm expired in February. This patch updates that for clients installing with verification.
- MongoDB support
The Ruby agent provides support for the mongo gem, versions 1.8 and 1.9! Mongo calls are captured for transaction traces along with their parameters, and time spent in Mongo shows up on the Database tab.
Support for more Mongo gems and more UI goodness will be coming, so watch http://docs.newrelic.com/docs/ruby/mongo for up-to-date status.
- Harvest thread restarts for forked and daemonized processes
Historically framework specific code was necessary for the Ruby agent to successfully report data after an app forked or daemonized. Gems or scripts with daemonizing modes had to wait for agent support or find workarounds.
With 3.7.1 setting
restart_thread_in_children: truein your newrelic.yml automatically restarts the agent in child processes without requiring custom code. For now the feature is opt-in, but future releases may default it on.
- Fix for missing HTTP time
The agent previously did not include connection establishment time for outgoing Net::HTTP requests. This has been corrected, and reported HTTP timings should now be more accurate.
- Fix for Mongo ensure_index instrumentation (188.8.131.52)
The Mongo instrumentation for ensure_index in 184.108.40.206 was not properly calling through to the uninstrumented version of this method. This has been fixed in 220.127.116.11. Thanks to Yuki Miyauchi for the fix!
- Correct first reported metric timespan for forking dispatchers (18.104.22.168)
The first time a newly-forked process (in some configurations) reported metric data, it would use the startup time of the parent process as the start time for that metric data instead of its own start time. This has been fixed.
- Official Rubinius support (for Rubinius >= 2.2.1)
We're happy to say that all known issues with the Ruby agent running on Rubinius have been resolved as of Rubinius version 2.2.1! See http://docs.newrelic.com/docs/ruby/rubinius for the most up-to-date status.
- RUM injection updates
The Ruby agent's code for both automatic and manual injection of Real User Monitoring scripts has been improved. No application changes are required, but the new injection logic is simpler, faster, more robust, and paves the way for future improvements to Real User Monitoring.
- More robust communication with New Relic
Failures when transmitting data to New Relic could cause data to be held over unnecessarily to a later harvest. This has been improved both to handle errors more robustly and consistently, and to send data as soon as possible.
- Fix for agent not restarting on server-side config changes
A bug in 3.6.9 caused the agent to not reset correctly after server-side config changes. New settings would not be received without a full process restart. This has been fixed.
- Blacklisting rake spec tasks
A blacklist helps the agent avoid starting during rake tasks. Some default RSpec tasks were missing. Thanks for the contribution Kohei Hasegawa!
- Experimental Rubinius 2.x support
The agent is now being tested against the latest version of Rubinius. While support is still considered experimental, you can track the progress at http://docs.newrelic.com/docs/ruby/rubinius for up to date status.
- Capture arguments for Resque and Sidekiq jobs
The agent can optionally record arguments for your Resque and Sidekiq jobs on transaction traces and traced errors. This is disabled by default, but may be enabled by setting resque.capture_params or sidekiq.capture_params.
Thanks to Juan Ignacio Pumarino, Ken Mayer, Paul Henry, and Eric Saxby for their help with this feature!
- Supported versions rake task and documentation
We've improved our documentation for what Ruby and gem versions we support. Run
rake newrelic:supported_versionsor see the latest agent's versions at https://docs.newrelic.com/docs/ruby/supported-frameworks.
- ActiveRecord 4.0 explain plans for JRuby and Rubinius
The agent's ActiveRecord 4.0 instrumentation could not gather SQL explain plans on JRuby by default because of a dependency on ObjectSpace, which isn't avialable by default. This has been fixed.
- Fix for Curb http_put_with_newrelic
A bug in the agent caused PUT calls in the Curb gem to crash. This has been fixed. Thanks to Michael D'Auria and Kirk Diggler for the contributions!
- Fix for head position on RUM injection
Certain unusual HTML documents resulted in browser monitoring injecting incorrect content. Thanks Alex McHale for the contribution!
- Specify the Content-Type header in developer mode
Thanks Jared Ning for the contribution!
- X-Ray Sessions support
X-Ray Sessions provide more targeted transaction trace samples and thread profiling for web transactions. For full details see our X-Ray sessions documentation at https://newrelic.com/docs/site/xray-sessions.
- Percentiles and Histograms
The Ruby Agent now captures data that provides percentile and histogram views in the New Relic UI.
- CPU metrics re-enabled for JRuby >= 1.7.0
To work around a JRuby bug, the Ruby agent stopped gathering CPU metrics on that platform. With the bug fixed, the agent can gather those metrics again. Thanks Bram de Vries for the contribution!
- Missing Resque transaction traces (22.214.171.124)
A bug in 126.96.36.199 prevented transaction traces in Resque jobs from being communicated back to New Relic. 188.8.131.52 fixes this.
- Retry on initial connect (184.108.40.206)
Failure to contact New Relic on agent start-up would not properly retry. This has been fixed.
- Fix potential memory leak on failure to send to New Relic (220.127.116.11)
18.104.22.168 introduced a potential memory leak when transmission of some kinds of data to New Relic servers failed. 22.214.171.124 fixes this.