• EnglishEspañol日本語한국어Português
  • EntrarComeçar agora

Ruby agent v9.3.0

June 26, 2023Download

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.3.0

Version 9.3.0 of the agent adds log-level filtering, adds custom attributes for log events, and updates instrumentation for Action Cable. It also provides fixes for how Fiber args are treated, Code-Level Metrics, unnecessary files being included in the gem, and NewRelic::Agent::Logging::DecoratingFormatter#clear_tags! being incorrectly private.

  • Feature: Filter forwarded logs based on level

    Previously, all log events, regardless of their level, were forwarded to New Relic when log forwarding was enabled. Now, you may specify the lowest log level you'd like forwarded to New Relic.

    Configuration nameDefaultBehaviorValid values
    application_logging.forwarding.log_leveldebugSets the minimum log level for events forwarded to New Relicdebug, info, warn, error, fatal, unknown

    This setting uses Ruby's Logger::Severity constants integer values to determine precedence.

  • Feature: Custom attributes for logs

    You can now add custom attributes to log events forwarded to New Relic! You can pass these attributes using an API and/or a configuration option.

    Configuration nameDefaultBehavior
    application_logging.forwarding.custom_attributes{}A hash with key/value pairs to add as custom attributes to all log events forwarded to New Relic. If sending using an environment variable, the value must be formatted like: "key1=value1,key2=value2"

Call the API using NewRelic::Agent.add_custom_log_attributes and passing your attributes as a hash. For example, you could call: NewRelic::Agent.add_custom_log_attributes(dyno: ENV['DYNO'], pod_name: ENV['POD_NAME']), to add the attributes dyno and pod_name to your log events.

Attributes passed to the API or the configuration will be added to all log events.

Thanks to @rajpawar02 for raising this issue and @askreet for helping us with the solution. Issue#1141, PR#2084, PR#2087

  • Feature: Instrument transmit_subscription-related Action Cable actions

    This change subscribes the agent to the Active Support notifications for:

    • transmit_subscription_confirmation.action_cable
    • transmit_subscription_rejection.action_cable
  • Bugfix: Removed unwanted files from being included in file_list in gemspec

    Previously, the agent was including some files in the gem that were not needed but added to the size of the gem. These files will no longer be included. Thanks to @manuraj17 for the contribution! PR#2089

  • Bugfix: Report Code-Level Metrics for Rails controller methods

    Controllers in Rails automatically render views with names that correspond to valid routes. This means that a controller method may not have a corresponding method in the controller class. Code-Level Metrics now report on these methods and don't log false warnings. Thanks to @jcrisp for reporting this issue. PR#2061

  • Bugfix: Code-Level Metrics for ActiveRecord models

    Classes that inherit from ActiveRecord were not reporting Code-Level Metrics due to an error in the agent when identifying the class name. This has been fixed and Code-Level Metrics will now report for ActiveRecord models. Thanks to @abigail-rolling for reporting this issue. PR#2092.

  • Bugfix: Private method clear_tags! for NewRelic::Agent::Logging::DecoratingFormatter

    As part of a refactor included in a previous release of the agent, the method NewRelic::Agent::Logging::DecoratingFormatter#clear_tags! was incorrectly made private. This method is now public again. Thanks to @dark-panda for reporting this issue. PR#

  • Bugfix: Fix the way args are handled for Fibers

    Previously, the agent treated Fiber args the same as it was treating Thread args, which is not correct. Args are passed to Fiber#resume, and not Fiber.new. This has been fixed, and the agent will properly preserve args for both Fiber and Thread classes. This also caused an error to occur when using Async 2.6.2, due to mismatching initalize definitions for Fiber prepended modules. This has been fixed as well. Thanks to @travisbell for bringing this to our attention. PR#2083

Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.