Importante
We recommend updating to the latest agent version as soon as it's available. If you can't upgrade to the latest version, update your agents to a version no more than 90 days old. Read more about keeping agents up to date.
See the New Relic Ruby agent EOL policy for information about agent releases and support dates.
v9.2.0
Version 9.2.0 of the agent introduces some performance improvements for working with high numbers of nested actions, and deprecates instrumentation for the memcached and memcache-client gems (with dalli still being supported).
Feature: Enhance performance for handling high numbers of nested actions
With Issue#1910, community members @parkerfinch and @travisbell informed us of some CPU spikes and process hangs seen only when using the agent's thread instrumentation, which was enabled by default with v9.0. When thread instrumentation is enabled, instrumented actions taking place within threads are seen and reported on by the agent whereas they would have previously gone unnoticed. This is a great improvement to the agent's usefulness in an async context, and also makes it easier for higher numbers of nested actions to be observed. For example, if an instrumented background job framework (Sidekiq, Resque) kicks off a job that the agent notices and then that job in turn performs actions such as database queries that the agent also instruments, nested actions are seen. However, with very high (10,000+) numbers of actions nested within a single instrumented outer action, the agent would struggle to efficiently crunch through all of the collected data at the time when the outer action finished. The agent should now be much more efficient when any observed action with lots of nested actions is finished. Our performance testing was conducted with hundreds of thousands of nested actions taking place, and we hope that the benefits of thread tracing can now be enjoyed without any drawbacks. Thanks very much @parkerfinch and @travisbell! PR#1927
Feature: Deprecate memcached and memcache-client instrumentation
Instrumentation for the memcached and memcache-client libraries is deprecated and will be removed during the next major release.
Importante
Recomendamos atualizar para a versão mais recente do agente assim que estiver disponível. Se você não puder atualizar para a versão mais recente, atualize seu agente para uma versão com no máximo 90 dias. Leia mais sobre como manter o agente atualizado.
Consulte a New Relic Ruby política de fim de vida útil do agente para obter informações sobre lançamentos de agentes e datas de suporte.
v9.1.0
A versão 9.1.0 do agente oferece suporte a dois novos recursos do Errors Inbox: impressão digital de erros e rastreamento de usuário, identifica o armazenamento de dados do Amazon Timestream, remove os avisos de distributed tracing dos logs do agente ao usar o Sidekiq, corrige bugs e é testada na versão recém-lançada do JRuby 9.4.2.0.
Recurso: impressão digital de erro - forneça seus próprios nomes de grupo do Errors Inbox
Suas ocorrências de erro estão mal agrupadas? Defina sua própria impressão digital de erro via uma função de retorno de chamada. Foi adicionado um novo método
set_error_group_callbackde API pública que aceitará um proc definido pelo usuário. O proc será invocado para cada erro notado e, sempre que retornar uma string, essa string será usada como o nome do grupo de erros para o erro e terá precedência sobre qualquer agrupamento no lado do servidor que ocorra com o Errors Inbox do New Relic. Isso oferece aos usuários um controle muito maior sobre o agrupamento de seus erros.Espera-se que o proc definido pelos clientes receba exatamente um argumento de entrada, um hash. O hash contém o seguinte:
Chave Valor :errorA instância da classe de erro Ruby. Ofertas #class,#messagee#backtrace:customAttributesQuaisquer atributos personalizados definidos pelo cliente para a transação atual :'request.uri'O URI da requisição atual, se disponível :'http.statusCode'O código de status HTTP (200, 404, etc.), se disponível :'http.method'O método HTTP (GET, PUT, etc.), se disponível :'error.expected'Se (verdadeiro) ou não (falso) o erro era esperado :'options'As opções aplicam hash passado para NewRelic::Agent.notice_errorO retorno de chamada só precisa ser definido uma vez por inicialização do agente da New Relic.
Exemplo de uso:
proc = proc { |hash| "Access" if hash[:'http.statusCode'] == 401 }NewRelic::Agent.set_error_group_callback(proc)Recurso: rastreamento de usuário - associar erros a um ID de usuário
Agora você pode ver o número de usuários impactados por um grupo de erros. Identifique o usuário final com um novo método de API pública
set_user_idque aceitará uma representação de string de um ID de usuário e associará esse ID de usuário à transação atual. Transações e erros terão então um novo atributo de agenteenduser.idassociado a eles. Isso permitirá que os usuários do agente adicionem tags a transações e erros como pertencentes a determinados IDs de usuário, para dar suporte a recursos aprimorados de filtragem e alerta.Identificar o Amazon Timestream quando o adaptador AR amazon_timestream é usado
Quando o agente detectar a gem activerecord-amazon-timestream-adapter sendo usada, ele agora identificará o armazenamento de dados como “Timestream”. Muito obrigado a @wagner por contribuir com esta melhoria! PR n.º 1872
Correção de bug: remover avisos relacionados ao distributed tracing dos logs do agente quando os cabeçalhos não estão presentes no Sidekiq
Anteriormente, o agente registrava um aviso em
newrelic_agent.logtoda vez que tentava aceitar cabeçalhos de distributed tracing vazios de trabalhos do Sidekiq, o que poderia resultar em um número excessivo de avisos. Agora, o agente não criará mais esses avisos ao usar o Sidekiq. PR#1834Correção de bug: registrar cabeçalhos de requisição em logs de nível de depuração em vez de Objetos legíveis por humanos
Anteriormente, o agente às vezes recebia filhos da classe
NewRelic::Agent::HTTPClients::AbstractRequestcomo argumento quandoNewRelic::Agent::Transaction::DistributedTracers#log_request_headersera chamado. Isso fazia com que as mensagens do log de nível de depuração que imprimem os cabeçalhos da requisição mostrassem Objetos legíveis por humanos (ex.#<NewRelic::Agent::HTTPClients::HTTPClientRequest:0x00007fd0dda983e0>) em vez dos cabeçalhos da requisição. Agora, o hash dos cabeçalhos da requisição deve ser sempre registrado no log. PR#1839Correção de bug: corrigido o método indefinido
controller_pathregistrado na Instrumentação do Action ControllerAnteriormente, o agente podia registrar um erro ao tentar determinar o nome da métrica na instrumentação do Action Controller se a classe do controlador não respondesse a
controller_path. Isso foi resolvido e o agente não chamará mais esse método, a menos que a classe responda a ele. Agradecemos a @gsar por nos informar sobre esse problema. PR#1844Correção de bug: corrige a exceção de Transaction#finish e diminui o nível de log para o aviso relacionado durante transações assíncronas
Anteriormente, o agente gerava um erro não fatal quando um segmento sem pai estava inacabado quando a transação era concluída. Esse erro era gerado durante a construção de uma mensagem do log de nível
warn. Agora que a instrumentação de Thread está ativada por padrão, essa mensagem do log é emitida com mais frequência e é menos preocupante. Nos casos em que vemos um segmento de Thread, Fiber ou concurrent-ruby em uma transação, a mensagem será rebaixada para um níveldebug. Agradecemos a @NielsKSchjoedt por criar o problema e a @boomer196 por testar as soluções. PR#1876CI: destino JRuby 9.4.2.0
O agente agora está sendo testado ativamente com o JRuby 9.4.2.0. OBSERVE que esta versão não contém nenhuma alteração não relacionada à CI para o JRuby. Espera-se que as versões antigas do agente ainda funcionem com JRubies mais recentes e que a versão mais recente do agente ainda funcione com JRubies mais antigos.
Importante
We recommend updating to the latest agent version as soon as it's available. If you can't upgrade to the latest version, update your agents to a version at most 90 days old. Read more about keeping agent up to date.
As of this release, the oldest supported version is 6.10.0
v9.0.0
Version 9.0.0 of the agent removes several deprecated configuration options and API methods, enables Thread tracing by default, adds Fiber instrumentation, removes support for Ruby versions 2.2 and 2.3, removes instrumentation for several deprecated gems, changes how the API method set_transaction_name works, and updates rails_defer_initialization to be an environment variable only configuration option.
Remove deprecated configuration options
The following configuration options have been removed and will no longer work. Please update all configs to use the replacements listed below. PR#1782
Removed | Replacement |
|
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Enable Thread instrumentation by default
The configuration option
instrumentation.thread.tracingis now enabled by default. This configuration allows the agent to properly monitor code occurring inside threads. In Ruby agent 9.0, instrumented code within threads will be recorded and associated with the current transaction when the thread was created.This may be a breaking change if you are currently using custom thread instrumentation. New transactions inside of threads will no longer be started if one already exists. PR#1767
Add Fiber instrumentation
Fiberinstances are now automatically instrumented similarly toThreadinstances. This can be configured usinginstrumentation.fiber. PR#1802Removed support for Ruby 2.2 and 2.3
Ruby 2.2 and 2.3 are no longer supported by the Ruby agent. To continue using the latest Ruby Agent version, please update to Ruby 2.4.0 or above. PR#1778
Removed deprecated instrumentation
Instrumentation for the following gems had been previously deprecated and has now been removed. PR#1788
- Acts As Solr
- Authlogic
- DataMapper
- Rainbows
- Sunspot
Versions of the following technologies had been previously deprecated and are no longer supported.
- Passenger: 2.2.x - 4.0.x
- Puma: 2.0.x
- Grape: 0.2.0
- Padrino: 0.14.x
- Rails: 3.2.x
- Sinatra: 1.4.x, 1.5.x
- Mongo: 1.8.x - 2.3.x
- Sequel: 3.37.x, 4.0.x
- Delayed_Job: 2.0.x - 4.0.x
- Sidekiq: 4.2.x
- Excon: below 0.55.0
- HttpClient: 2.2.0 - 2.8.0
- HttpRb: 0.9.9 - 2.2.1
- Typhoeus: 0.5.3 - 1.2.x
- Bunny: 2.0.x - 2.6.x
- ActiveMerchant: 1.25.0 - 1.64.x
Updated API method
set_transaction_nameWhen the method
NewRelic::Agent.set_transaction_nameis called, it will now always change the name and category of the currently running transaction to what is passed into the method. This is a change from previous agent versions.Previously, if
set_transaction_namewas called with a new transaction name and a new category that did not match the category already assigned to a transaction, neither the new name nor category would be saved to the transaction. If this method is being called in a situation in which it was previously ignored due to category differences, this will now change the name and category of the transaction. PR#1797Removed API method:
NewRelic::Agent.disable_transaction_tracingThe deprecated API method
NewRelic::Agent.disable_transaction_tracinghas been removed. Instead use eitherNewRelic::Agent#ignore_transactionto disable the recording of the current transaction orNewRelic::Agent.disable_all_tracingto yield a block without collecting any metrics or traces in any of the subsequent calls. PR#1792Renamed ActiveJob metrics
Previously, ActiveJob was categorized as a message broker, which is inaccurate. We've updated the naming of ActiveJob traces from leading with
MessageBroker/ActiveJobto simply leading withActiveJob. PR#1811Code cleanup
Thank you to community member @esquith for contributing some cleanup of orphaned constants in our code base. PR#1793 PR#1794 PR#1808
Community member @fchatterji helped standardize how we reference
NewRelicthroughout our codebase PR#1795 and updated our README's community header PR#1815. Thanks fchatterji!Bugfix: Allow rails initialization to be deferred by environment variable
The Ruby agent may force some Rails libraries to load on agent initialization, preventing some settings defined in
config/initializersfrom being applied. Changing the initialization process to run afterconfig/initializers, however, may break the configuration for other gems (ex. Roadie Rails).For those having troubles with agent initialization and Rails initializers, you can now pass the environment variable
NEW_RELIC_DEFER_RAILS_INITIALIZATION=trueto make the agent initialize afterconfig/initializersare run. This config option can only be set using an environment variable and can't be set using YAML. PR#1791Thanks to @jdelStrother for bringing this issue to our attention and testing our fixes along the way. Issue#662
Importante
We recommend updating to the latest agent version as soon as it's available. If you can't upgrade to the latest version, update your agents to a version at most 90 days old. Read more about keeping agent up to date.
As of this release, the oldest supported version is 6.9.0.363
v8.16.0
Version 8.16.0 introduces more Ruby on Rails instrumentation (especially for Rails 6 and 7) for various Action*/Active* libraries whose actions produce Active Support notifications events.
Add Various Ruby on Rails Library Instrumentations
New instrumentation is now automatically provided by several Action*/Active* libaries that generate Active Support notifications. With each Ruby on Rails release, new the Rails libraries add new events and sometimes existing events have their payload parameters updated as well. The New Relic Ruby agent will now automatically process more of these events and parameters with New Relic segments created for each event. At a minimum, each segment gives timing information for the event. In several cases, all non-sensitive event payload parameters are also passed along in the segment.
The agent now newly supports or has updated support for the following libraries:
- Action Cable (for WebSockets) PR#1749
- Action Controller (for the 'C' in MVC) PR#1744
- Action Mailbox (for sending mail) PR#1740
- Action Mailer (for routing mail) PR#1740
- Active Job (for background jobs) PR#1742
- Active Support (for caching operations) PR#1742
The instrumentations for each of these libaries are all enabled by default, but can be independently disabled via configuration by using the following parameters:
Configuration name Default Behavior disable_action_cablefalseIf true, disables Action Cable instrumentation.disable_action_controllerfalseIf true, disables Action Controller instrumentation.disable_action_mailboxfalseIf true, disables Action Mailbox instrumentation.disable_action_mailerfalseIf true, disables Action Mailer instrumentation.disable_activejobfalseIf true, disables Active Job instrumentation.disable_active_supportfalseIf true, disables Active Support instrumentation.
Importante
We recommend updating to the latest agent version as soon as it's available. If you are prevented from upgrading to the latest version, ensure that your agents are updated to a version at most 90 days old. Read more about keeping your agent up to date.
As of this release, the oldest supported version is 6.9.0.363
v8.15.0
Version 8.15.0 of the agent confirms compatibility with Ruby 3.2.0, adds instrumentation for concurrent-ruby, and confirms Sinatra 3 compatibility with Padrino 0.15.2. It also enables batching and compression for Infinite Tracing.
Add Support for Ruby 3.2.0
Following the 3.2.0 release of Ruby, the New Relic Ruby agent has confirmed compatibility with and now supports the official release of Ruby 3.2.0. PR#1715
Add instrumentation for concurrent-ruby
The agent now instruments the concurrent-ruby gem for versions 1.1.5 and above. This instrumentation provides visibility inside blocks passed to many of the gem's API methods, including
Concurrent::Promises.futureandConcurrent::Future.execute.
| Configuration name | Default | Behavior |
|---|---|---|
instrumentation.concurrent_ruby | auto | Controls auto-instrumentation of the concurrent-ruby library at start up. May be one of auto, prepend, chain, disabled. |
Infinite Tracing: Use batching and compression
For Infinite Tracing, which Ruby applications can leverage with the
newrelic-infinite_tracinggem, payloads will now be batched and compressed to signficantly decrease the amount of outbound network traffic. PR#1723
| Configuration name | Default | Behavior | |||
|---|---|---|---|---|---|
infinite_tracing.batching | true | If true (the default), the Trace Observer will receive data in batches instead of sending each span individually | |||
infinite_tracing.compression_level | high | Configure the compression level for data sent to the trace observer. May be one of [none | low | medium | high]. 'high' is the default. Set the level to 'none' to disable compression. |
Importante
We recommend updating to the latest agent version as soon as it's available. If your organization has established practices that prevent you from upgrading to the latest version, ensure that your agents are regularly updated to a version at most 90 days old. Read more about keeping your agent up to date.
As of this release, the oldest supported version is 6.8.0.359
v8.14.0
Version 8.14.0 of the agent restores desired Capistrano-based changelog lookup functionality when a deployment is performed, speeds up GUID generation, delivers support for instrumenting Rails custom event notifications, fixes potential compatibility issues with the RedisClient gem, and fixes bugs related to initialization in Rails.
Deployment Recipe: Restore desired Capistrano-based changelog lookup behavior
The New Relic Ruby agent offers a Capistrano recipe for recording app deployments. The recipe code was significantly cleaned up with PR#1498 which inadvertently changed the way the recipe handles the changelog for a deployment. Community member @arthurwozniak spotted and corrected this change in order to restore the desired changelog lookup functionality while retaining all of the previous cleanup. Thank you very much for your contribution, @arthurwozniak! PR#1653
Speed up GUID generation
The agent leverages random numbers in its GUID (globally unique identifier) generation and would previously always freshly calculate the result of 16^16 or 32^32 before generating a random number. Given that those 16^16 and 32^32 operations are expected, it makes sense to calculate their results up front and store them in constants to be referred to later. Doing so has resulted in a performance gain for the generation of GUIDs. Many thanks to @tungmq for contributing this optimisation and the benchmarks to support it! PR#1693
Support for Rails ActiveSupport::Notifications for custom events
When the new
active_support_custom_events_namesconfiguration parameter is set equal to an array of custom event names to subscribe to, the agent will now subscribe to each of the names specified and report instrumentation for the events when they take place. Creating custom events is simple and now reporting instrumentation for them to New Relic is simple as well. PR#1659Bugfix: Support older versions of the RedisClient gem, handle unknown Redis database index
With version 8.13.0 of the agent, support was added for the redis-rb gem v5+ and the new RedisClient gem. With versions of RedisClient older than v0.11, the agent could cause the monitored application to crash when attempting to determine the Redis database index. Version 8.14.0 adds two related improvements. Firstly, support for RedisClient versions older than v0.11 has been added to get at the database index value. Secondly, the agent will no longer crash or impact the monitored application in the event that the database index cannot be obtained. Thank you very much to our community members @mbsmartee and @patatepartie for bringing this issue to our attention, for helping us determine how to best reproduce it, and for testing out the update. We appreciate your help! Issue#1650 PR#1673
Bugfix: Defer agent startup in Rails until after application-defined initializers have runIn Rails, the agent previously loaded before any application-defined initializers. This allowed initializers to reference theadd_method_tracerAPI. However, this had the side-effect of forcing some framework libraries to load before initializers ran, preventing any configuration values related to these libraries from being applied. This fix provides an option to split initialization into two parts: loadadd_method_tracerbefore application-defined initializers and start the agent after application-defined initializers. This may cause other initializers to behave differently.If you'd like to use this feature, setdefer_rails_initializationtotrue. It isfalseby default, but may becometrueby default in a future release.Furthermore, our Action View instrumentation was missing anActiveSupport.on_loadblock around the code that loads our instrumentation.Thank you @jdelStrother for bringing this to our attention and collaborating with us on a fix. PR#1658Unfortunately, this bugfix is unreachable as written because the configuration value used to access the bugfix won't be applied until after initialization. Follow along for updates at Issue#662.
Importante
We recommend updating to the latest agent version as soon as it's available. If your organization has established practices that prevent you from upgrading to the latest version, ensure that your agents are regularly updated to a version at most 90 days old. Read more about keeping your agent up to date.
As of this release, the oldest supported version is 6.8.0.359
v8.13.1
Version 8.13.1 of the agent provides a bugfix for Redis v5.0 instrumentation.
Fix NoMethodError when using Sidekiq v7.0 with Redis Client v0.11
In some cases, the
RedisClientobject cannot directly access methods like db, port, or path. These methods are always available on theclient.configobject. This raised aNoMethodErrorin environments that used Sidekiq v7.0 and Redis Client v0.11. Thank you to fcheung and @stevenou for bringing this to our attention! Issue#1639
v8.13.0
Version 8.13.0 of the agent updates our Rack, Redis, and Sidekiq instrumentation. It also delivers some bugfixes.
Support for Redis v5.0
Redis v5.0 restructures where some of our instrumented methods are located and how they are named. It also introduces a new instrumentation middleware API. This API is used for pipelined and multi calls to maintain reporting parity with previous Redis versions. However, it is introduced later in the chain, so you may see errors that used to appear at the segment level on the transaction instead. The agent's behavior when used with older supported Redis versions will remain unaffected. PR#1611
Support for Sidekiq v7.0
Sidekiq v7.0 removed Delayed Extensions and began offering client and server middleware classes to inherit from. The agent's Sidekiq instrumentation has been updated accordingly. The agent's behavior when used with older Sidekiq versions will remain unaffected. PR#1615 NOTE: an issue was discovered with Sidekiq v7.0+ and addressed by Ruby agent v8.13.1. If you are using Sidekiq, please skip Ruby agent v8.13.0 and use v8.13.1 or above.
Support for Rack v3.0: Rack::Builder#new accepting a block
Via rack/rack#1942 (released with Rack v3.0),
Rack::Builder#runnow optionally accepts a block instead of an app argument. The agent's instrumentation has been updated to support the use of a block withRack::Builder#run. PR#1600Bugfix: Correctly identify Unicorn, Rainbows and FastCGI with Rack v3.0
Unicorn, Rainbows, or FastCGI web applications using Rack v3.0 may previously have had the "dispatcher" value incorrectly reported as "Webrick" instead of "Unicorn", "Rainbows", or "FastCGI". This issue has now been addressed. PR#1585
Bugfix: add_method_tracer fails to record code level metric attributes on private methods
When using
add_method_traceron a private method, the agent was unable to record code level metrics for the method. This resulted in the following being logged to the newrelic_agent.log file.WARN : Unable to determine source code info for 'Example', method 'private_method' - NameError: undefined method 'private_method' for class '#<Class:Example\>'Thank you @jdelStrother for bringing this issue to our attention and suggesting a fix! PR#1593
Bugfix: Category is a required keyword arg for NewRelic::Agent::Tracer.in_transaction
When support for Ruby 2.0 was dropped in version 8.0.0 of the agent, the agent API methods were updated to use the required keyword argument feature built into Ruby, rather than manually raising ArgumentErrors. The API method
NewRelic::Agent::Tracer.in_transactionremoved the ArgumentError raised by the agent, but did not update the method arguments to identify:categoryas a required keyword argument. This is now resolved. Thank you @tatzsuzuki for bringing this to our attention. PR#1587
Support statement
New Relic recommends that you upgrade the Ruby agent regularly and at a minimum of every 3 months. As of this release, the oldest supported version is 6.8.0.359.
v8.12.0
Version 8.12.0 of the Ruby agent delivers new Elasticsearch instrumentation. Version 8.12.0 of the Ruby agent also increases the default number of recorded custom events, announces the deprecation of Ruby 2.3, and brings some valuable code cleanup.
Support for Elasticsearch instrumentation
This release of the Ruby agent adds support to automatically instrument the elasticsearch gem. Versions 7.x and 8.x are supported. PR#1525
Configuration name Default Behavior instrumentation.elasticsearchauto Controls auto-instrumentation of the elasticsearch library at start up. May be one of auto,prepend,chain,disabled.elasticsearch.capture_queriestrue If true, the agent captures Elasticsearch queries in transaction traces.elasticsearch.obfuscate_queriestrue If true, the agent obfuscates Elasticsearch queries in transaction traces.Custom Event Limit Increase
This version of the Ruby agent increases the default limit of custom events from 1000 events per minute to 3000 events per minute. If your custom events were being limited, this change will allow more custom events to be sent to New Relic. There is also a new configurable maximum limit of 100,000 events per minute. To change the limits, see the documentation for max_samples_stored. To learn more about the change and how to determine if custom events are being dropped, see our Explorers Hub post. PR#1541
Deprecate support for Ruby 2.3
Ruby 2.3 reached end of life on March 31, 2019. The Ruby agent has deprecated support for Ruby 2.3 and will make breaking changes for this version in its next major release, v9.0.0 (release date not yet planned). All 8.x.x versions of the agent will remain compatible with Ruby 2.3.
Cleanup: Remove orphaned code
In both the agent and unit tests, changes have taken place over the years that have left certain bits of code unreachable. This orphaned code can complicate code maintenance and refactoring, so getting it squared away can be very helpful. Commmuniy member @ohbarye contributed two separate cleanup PRs for this release; one for the agent and one for the tests. PR#1537 PR#1548
Thank you to @ohbarye for contributing this helpful cleanup!
Support statement
New Relic recommends that you upgrade the Ruby agent regularly and at a minimum of every 3 months. As of this release, the oldest supported version is 6.7.0.359.