# New Relic Ruby Agent Release Notes # ## v6.5.0 * **Change to default setting for ActiveRecord connection resolution** Due to incompatibilities between the faster ActiveRecord connection resolution released in v6.3.0 of the agent and other gems which patch ActiveRecord, `backport_fast_active_record_connection_lookup` will now be set to `false` by default. Because it results in a significant performance improvement, we recommend customers whose environments include ActiveRecord change this setting to `true` _unless_ they are using other gems which measure ActiveRecord performance, which may lose functionality when combined with this setting. If unsure whether to enable `backport_fast_active_record_connection_lookup`, we recommend enabling it in a development environment to make sure other gems which patch ActiveRecord are still working as expected. * **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! ## 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](https://blog.newrelic.com/engineering/monitoring-application-performance-in-kubernetes/). * **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 than `Grape::API`. A warning would also print to the newrelic_agent log: ``` WARN : Error in Grape instrumentation WARN : NoMethodError: undefined method `name' for nil:NilClass ``` This 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](https://docs.newrelic.com/docs/agents/ruby-agent/features/new-relic-browser-ruby-agent#manual_instrumentation) 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` and `disable_active_record_5` settings in NewRelic.yml are being deprecated in favor of the new `disable_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` script** For 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 messages Version 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 messages Ruby 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](https://blog.newrelic.com/engineering/monitoring-application-performance-in-kubernetes/). * Bugfix for Bunny instrumentation when popping empty queues When a customer calls `Bunny::Queue#pop` on an empty queue, Bunny returns a `nil` value. Previous Ruby Agent versions raised a `NoMethodError` when trying to process this result. Now, the agent correctly skips processing for `nil` 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 its `in_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](https://docs.newrelic.com/docs/agents/ruby-agent/api-guides/ruby-custom-instrumentation). If you were previously using any of the agent's private, undocumented APIs, such as `Transaction.wrap` or `Transaction.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](https://docs.newrelic.com/docs/agents/ruby-agent/troubleshooting/update-private-api-calls-public-tracer-api) 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, and it looks great! Feel free to use agent v5.7 to measure the performance of your Ruby 2.6 applications. * Support for loading Sequel core standalone Earlier versions of the agent required users of the Sequel data mapping library to load the _entire_ library. The agent will now enable Sequel instrumentation when an application loads Sequel's core standalone; i.e., without 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! ## v5.6.0 * Bugfix for transactions with `ActionController::Live` Previously, transactions containing `ActionController::Live` resulted in incorrect calculations of capacity analysis as well as error backtraces appearing in agent logs in agent versions 5.4 and later. The agent now correctly calculates capacity for transactions with `ActionController::Live`. * Add ability to exclude attributes from span events and transaction segments Agent versions 5.5 and lower could selectively exclude attributes from page views, error traces, transaction traces, and transaction events. With agent version 5.6 and higher, you can also exclude attributes from span events (via the `span_events.include/exclude` options) and from transaction segments (via the `transaction_segments.include/exclude` options). As with other attribute destinations, these new options will inherit values from the top-level `attributes.include/exclude` settings. See the [documentation](https://docs.newrelic.com/docs/agents/ruby-agent/attributes/enabling-disabling-attributes-ruby) for more information. * Increasing backoff sequence on failing to connect to New Relic If the agent cannot reach New Relic, it will now wait for an increasing amount of time after each failed attempt. We are also starting with a shorter delay initially, which will help customer apps bounce back more quickly from transient network errors. * Truncation of long stack traces Previous versions of the agent would truncate long stack traces to 50 frames. To give customers more flexibility, we have added the `error_collector.max_backtrace_frames` configuration option. Thanks to Patrick Tulskie for the contribution! * Update link in documentation The community forum link in `README.md` now goes to the updated location. Thanks to Sam Killgallon for the contribution! * Active Storage instrumentation The agent now provides instrumentation for Active Storage, introduced in Rails 5.2. Customers will see Active Storage operations represented as segments within transaction traces. ## v5.5.0 * Bugfix for `perform` instrumentation with curb gem Use of curb's `perform` method now no longer results in nil headers getting returned. * Bugfix for parsing Docker container IDs The agent now parses Docker container IDs correctly regardless of the cgroup parent. * Use lazy load hooks for ActiveJob instrumentation In some instances the ActiveJob instrumentation could trigger ActiveJob to load before it was initialized by Rails. This could result in configuration changes not being properly applied. The agent now uses lazy load hooks which fixes this issue. * Documentation improvement The `config.dot` diagram of the agent's configuration settings no longer includes the deleted `developer_mode` option. Thanks to Yuichiro Kaneko for the contribution! ## v5.4.0 * Capacity analysis for multi-threaded dispatchers Metrics around capacity analysis did not previously account for multi-threaded dispatchers, and consequently could result in capacities of over 100% being recorded. This version now properly accounts for multi-threaded dispatchers. * `NewRelic::Agent.disable_transaction_tracing` deprecated `NewRelic::Agent.disable_transaction_tracing` has been deprecated. Users are encouraged to use `NewRelic::Agent.disable_all_tracing` or `NewRelic::Agent.ignore_transaction` instead. * Bugfix for SQL over-obfuscation A bug, introduced in v5.3.0, where SQL could be over-obfuscated for some database adapters has been fixed. * Bugfix for span event data in Resque processes A bug where span events would not be sent from Resque processes due to a missing endpoint has been fixed. ## v5.3.0 ## * Distributed Tracing Distributed tracing lets you see the path that a request takes as it travels through your distributed system. By showing the distributed activity through a unified view, you can troubleshoot and understand a complex system better than ever before. Distributed tracing is available with an APM Pro or equivalent subscription. To see a complete distributed trace, you need to enable the feature on a set of neighboring services. Enabling distributed tracing changes the behavior of some New Relic features, so carefully consult the [transition guide](https://docs.newrelic.com/docs/transition-guide-distributed-tracing) before you enable this feature. To enable distributed tracing, set the `distributed_tracing.enabled` configuration option to `true`. ## 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. * Span Events Finished segments whose `sampled` property is `true` will now post Span events to Insights. ## v5.1.0 ## * 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.enabled` configuration option This 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:compile` to blacklisted tasks `webpacker:compile` is commonly used for compiling assets. It has been added to `AUTOSTART_BLACKLISTED_RAKE_TASKS` in the default configuration. Thanks to Claudio B. for the contribution! * Make browser instrumentation W3C-compliant `type="text/javascript"` is optional for the `