• /
  • EnglishEspañolFrançais日本語한국어Português
  • 로그인지금 시작하기

Ruby agent release notesRSS

September 30, 2024
Ruby agent v9.14.0

중요

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

Version 9.14.0 adds Apache Kafka instrumentation for the rdkafka and ruby-kafka gems, introduces a configuration-based, automatic way to add custom instrumentation method tracers, correctly captures MIME type for ActionDispatch 7.0+ requests, properly handles Boolean coercion for newrelic.yml configuration, fixes a JRuby bug in the configuration manager, fixes a bug related to Bundler.rubygems.installed_specs, and fixes a bug to make the agent compatible with ViewComponent v3.15.0+.

  • Feature: Add Apache Kafka instrumentation for the rdkafka and ruby-kafka gems

    The agent now has instrumentation for both the rdkafka and ruby-kafka gems. The agent will record transactions and message broker segments for produce and consume calls made using these gems. PR#2824 PR#2842

  • Feature: Add a configuration option to permit custom method tracers to be defined automatically

    A new :automatic_custom_instrumentation_method_list configuration parameter has been added to permit the user to define a list of fully qualified (namespaced) Ruby methods for the agent to automatically add custom instrumentation for without requiring any code modifications to be made to the classes that define the methods.

    The list should be an array of CLASS#METHOD (for instance methods) and/or CLASS.METHOD (for class methods) strings.

    Use fully qualified class names (using the :: delimiter) that include any module or class namespacing.

    Here is some Ruby source code that defines a render_png instance method for an Image class and a notify class method for a User class, both within a MyCompany module namespace:

    module MyCompany
    class Image
    def render_png
    # code to render a PNG
    end
    end
    class User
    def self.notify
    # code to notify users
    end
    end
    end

    Given that source code, the newrelic.yml config file might request instrumentation for both of these methods like so:

    automatic_custom_instrumentation_method_list:
    - MyCompany::Image#render_png
    - MyCompany::User.notify

    That configuration example uses YAML array syntax to specify both methods. Alternatively, a comma-delimited string can be used instead:

    automatic_custom_instrumentation_method_list: 'MyCompany::Image#render_png, MyCompany::User.notify'

    Whitespace around the comma(s) in the list is optional. When configuring the agent with a list of methods via the NEW_RELIC_AUTOMATIC_CUSTOM_INSTRUMENTATION_METHOD_LIST environment variable, this comma-delimited string format should be used:

    export NEW_RELIC_AUTOMATIC_CUSTOM_INSTRUMENTATION_METHOD_LIST='MyCompany::Image#render_png, MyCompany::User.notify'

    PR#2851

  • Feature: Collect just MIME type for ActionDispatch 7.0+ requests

    Rails 7.0 introduced changes to the behavior of ActionDispatch::Request#content_type, adding extra request-related details the agent wasn't expecting to collect. Additionally, the agent's use of content_type was triggering deprecation warnings. The agent now uses ActionDispatch::Request#media_type to capture the MIME type. Thanks to @internethostage for letting us know about this change. Issue#2500 PR#2855

  • Bugfix: Corrected Boolean coercion for newrelic.yml configuration

    Previously, any String assigned to New Relic configurations expecting a Boolean value were evaluated as true. This could lead to unexpected behavior. For example, setting application_logging.enabled: 'false' in newrelic.yml would incorrectly evaluate to application_logging.enabled: true due to the truthy nature of Strings.

    Now, the agent strictly interprets Boolean configuration values. It recognizes both actual Boolean values and certain Strings/Symbols:

    • 'true', 'yes', or 'on' (evaluates to true)
    • 'false', 'no', or 'off' (evaluates to false)

    Any other inputs will revert to the setting's default configuration value. PR#2847

  • Bugfix: JRuby not saving configuration values correctly in configuration manager

    Previously, a change made to fix a different JRuby bug caused the agent to not save configuration values correctly in the configuration manager when running on JRuby. This has been fixed. PR#2848

  • Bugfix: Update condition to verify Bundler.rubygems.installed_specs is available

    To address a recent Bundler deprecation warning, we started using Bundler.rubygems.installed_specs instead of Bundler.rubygems.all_specs in environments that seemed appropriate. We discovered the version constraint we used was too low. Now, rather than check the version, we check for the method using respond_to?. PR#2853

  • Bugfix: Support view_component v3.15.0+

    Previously the agent had been making use of a private API to obtain a component identifier value. This private API was dropped in v3.15.0 of view_component, resulting in errors from the New Relic Ruby agent's continued attempts to use it. Many thanks to community member @navidemad for bringing this issue to our attention and supplying a bugfix with PR#2870.

August 22, 2024
Ruby agent v9.13.0

중요

최신 에이전트 버전이 출시되면 즉시 업데이트하는 것이 좋습니다. 최신 버전으로 업그레이드할 수 없는 경우, 에이전트를 90일 이내 버전으로 업데이트하세요. 에이전트에게 최신 정보를 제공하는 방법 에 대해 자세히 알아보세요.

에이전트 릴리스 및 지원 날짜에 대한 정보는 뉴렐릭 루비 에이전트 EOL 정책을 참조하세요.

v9.13.0

버전 9.13.0은 AWS Lambda 함수에 대한 지원을 강화하고, 실험적인 OpenSearch 계측을 추가하며, 프레임워크 감지를 업데이트하고, Bundler 지원 중단 경고를 숨기고, Falcon 디스패처 감지를 수정하고, 레디스 계측 설치와 관련된 버그를 수정하며, JRuby 관련 동시성 문제를 해결합니다.

  • 기능: AWS Lambda 함수 계측 강화

최신 AWS Lambda용 뉴렐릭 루비 레이어를 통해 활용할 경우, 이제 에이전트는 향상된 AWS Lambda 함수 계측 지원을 제공합니다.

  • AWS Lambda 함수에 대한 에이전트의 계측이 이제 분산 추적을 지원합니다.

  • 웹 트리거 호출은 이제 API Gateway 호출이 포함될 때 “web” 기반인 것으로 식별되며, API Gateway 버전 1.0과 2.0을 모두 지원합니다.

  • 웹 기반 호출에는 HTTP 메서드, URI 및 상태 코드가 기록됩니다.

  • 에이전트는 이제 Lambda 함수 호출을 트리거할 수 있는 12개의 개별 AWS 리소스를 인식하고 보고합니다: ALB, API Gateway V1, API Gateway V2, CloudFront, CloudWatch Scheduler, DynamoStreams, Firehose, Kinesis, S3, SES, SNS 및 SQS.

  • 각 리소스에 대해 트리거하는 리소스의 유형과 해당 ARN이 기록되며, 많은 리소스의 경우 리소스별 추가 속성도 기록됩니다. 예를 들어, S3 버킷 활동으로 트리거된 Lambda 함수 호출의 경우 이제 S3 버킷 이름이 기록됩니다. PR#2811

  • 기능: 실험적인 OpenSearch 계측 추가

    에이전트는 이제 opensearch-ruby gem을 자동으로 계측합니다. 이 계측을 완전히 테스트하려면 더 많은 작업이 필요하므로 실험적인 기능으로 표시합니다. OpenSearch 계측은 Elasticsearch와 유사한 텔레메트리를 제공합니다. 문제를 보고해 주신 @Earlopain 님과 계측의 초기 초안을 작성해 주신 @praveen-ks 님께 감사드립니다. Issue#2228 PR#2796

  • 기능: Grape 및 Padrino의 프레임워크 감지 정확도 향상

    이전에 Grape 프레임워크를 사용하는 애플리케이션은 환경 보고서 내에서 프레임워크를 ruby (으)로 설정했습니다. 이제 Grape 애플리케이션은 grape(으)로 설정됩니다. 마찬가지로 Padrino 프레임워크를 사용하는 애플리케이션은 sinatra(으)로 설정되었습니다. 이제 padrino(으)로 설정됩니다. 이는 뉴렐릭 보안 에이전트 호환성 검사에 도움이 됩니다. 이 변경 작업을 수행해 주신 @prateeksen 님께 감사드립니다. Issue#2777 PR#2789

  • 기능: Bundler all_specs 지원 중단 경고 숨김 처리

    Bundler.rubygems.all_specs Bundler 버전 2 이상에서는 Bundler.rubygems.installed_specs (으)로 대체되어 더 이상 사용되지 않게 되었으며, 이로 인해 에이전트가 사용 중단 경고를 발생시켰습니다. Bundler 2 이상이 감지될 때 메서드가 업데이트되었으며 이제 경고가 표시되지 않습니다. 이 문제를 보고해 주신 @jcoyne 님께 감사드립니다. Issue#2733 PR#2823

  • 버그 수정: Falcon 디스패처 감지 수정

    이전에는 객체 공간을 사용하여 Falcon 웹 서버가 사용 중인지 확인하려고 했습니다. 하지만 환경 보고서가 생성된 후에야 Falcon이 객체 공간에 추가되므로, 그 결과 nil 디스패처가 반환되는 문제가 있었습니다. 이제 File.basename을(를) 사용하여 디스패처를 검색했던 이전 전략으로 되돌아갑니다. 이 문제를 보고하고 원인을 조사해 주신 @prateeksen 님께 감사드립니다. Issue#2778 PR#2795

  • 버그 수정: Redis::Cluster::Client가 존재할 때 발생하는 레디스 계측 오류 수정

    이전의 레디스 계측에는 메서드 외부에서 루비 return을(를) 사용함으로 인해 Redis::Cluster::Client이(가) 존재할 때 오류를 발생시키는 버그가 있었습니다. 이 버그를 보고해 주셨을 뿐만 아니라 근본적인 원인까지 알려주신 @jdelStrother 님께 진심으로 감사드립니다. Issue#2814 PR#2816

  • 버그 수정: 설정 해시 액세스와 관련된 JRuby 동시성 문제 해결

    에이전트의 내부 설정 클래스는 가끔 다시 빌드되는 해시를 유지 관리합니다. 다시 빌드하는 동안 이전에 동적으로 결정된 특정 계측 값은 뉴렐릭 루비 보안 에이전트를 위해 보존됩니다. 수정되는 동안 해시에 액세스하는 것과 관련된 동시성 문제에 대한 JRuby 고객의 보고가 있은 후, 이전에 해시 재빌드 로직에 두 가지 개별 수정 사항이 적용되었습니다: Hash#dup 작업 및 synchronize do 블록. 하지만 여전히 오류가 보고되었습니다. 정확히 동일한 버전의 JRuby와 보고된 모든 소프트웨어를 사용했음에도 불구하고 이러한 동시성 오류를 재현할 수 없었습니다. 문제의 해시 액세스 코드가 루비 보안 에이전트(비프로덕션 전용 보안 테스트 환경에서만 작동함)에만 필요하다는 것을 확인한 후, JRuby가 실행 중이지만 보안 에이전트가 실행되지 않을 때 문제가 되는 코드를 단순히 건너뛰는 JRuby 고객을 위한 새로운 수정 사항을 도입했습니다. PR#2798

July 24, 2024
Ruby agent v9.12.0

중요

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

Version 9.12.0 adds support for the newrelic_security agent, introduces instrumentation for the LogStasher gem, improves instrumentation for the redis-clustering gem, and updates the Elasticsearch instrumentation to only attempt to get the cluster name once per client, even if it fails.

  • Feature: Add support for the newrelic_security agent

    New Relic Interactive Application Security Testing (IAST) can help you prevent cyberattacks and breaches on your applications by probing your running code for exploitable vulnerabilities.

    The newrelic_security gem provides this feature for Ruby. It depends on newrelic_rpm. This is the first version of newrelic_rpm compatible with newrelic_security.

    At this time, the security agent is intended for use only within a dedicated security testing environment with data that can tolerate modification or deletion. The security agent is available as a separate Ruby gem, newrelic_security. It is recommended that this separate gem only be introduced to a security testing environment by leveraging Bundler grouping like so:

    # Gemfile
    gem 'newrelic_rpm' # New Relic APM observability agent
    gem 'newrelic-infinite_tracing' # New Relic Infinite Tracing
    group :security do
    gem 'newrelic_security', require: false # New Relic security agent
    end

    In order to run the security agent, you need to update your configuration. At a minimum, security.agent.enabled and security.enabled must be set to true. They are false by default. Similar to the gem installation, we recommend you set these configurations for a special security testing environment only.

    Here's an example using newrelic.yml:

    common: &default_settings
    license_key: <%= ENV['NEW_RELIC_LICENSE_KEY'] %>
    app_name: "Example app"
    development:
    <<: *default_settings
    app_name: <%= app_name %> (Development)
    security:
    <<: *default_settings
    security.enabled: true
    security.agent.enabled: true
    production:
    <<: *default_settings

    The following configuration relate to the newrelic_security gem:

    Configuration nameDefaultBehavior
    security.agent.enabledfalseIf true, the security agent is loaded (a Ruby 'require' is performed)
    security.enabledfalseIf true, the security agent is started (the agent runs in its event loop)
    security.mode'IAST'Defines the mode for the security agent to operate in. Currently only 'IAST' is supported
    security.validator_service_url'wss://csec.nr-data.net'Defines the endpoint URL for posting security related data
    security.detection.rci.enabledtrueIf true, enables RCI (remote code injection) detection
    security.detection.rxss.enabledtrueIf true, enables RXSS (reflected cross-site scripting) detection
    security.detection.deserialization.enabledtrueIf true, enables deserialization detection
    security.application_info.portnilAn Integer representing the port the application is listening on. This setting is mandatory for Passenger servers. Other servers should be detected by default.
  • Feature: Add instrumentation for LogStasher

    The agent will now record logs generated by LogStasher. Versions 1.0.0 and above of the LogStasher gem are supported. PR#2559

  • Feature: Add instrumentation for redis-clustering

    Version 5.x of the redis gem moved cluster behavior into a different gem, redis-clustering. This gem can access instrumentation registered through RedisClient::Middleware. Previously, the agent only instrumented the call_pipelined method through this approach, but now users of the redis-clustering gem will also have instrumentation registered for connect and call methods. In addition, the way the database_name attribute is set for Redis datastore spans is now compatible with all versions of Redis supported by the New Relic Ruby agent. Thank you, @praveen-ks for bringing this to our attention. Issue#2444 PR#2720

  • Bugfix: Update Elasticsearch instrumentation to only attempt to get the cluster name once per client

    Previously, the agent would attempt to get the cluster name every time a call was made if it was not already captured. This could lead to a large number of failures if the cluster name could not be retrieved. Now, the agent will only attempt to get the cluster name once per client, even if it fails. Thank you, @ascoppa for bringing this to our attention. Issue#2730 PR#2743

  • Feature: Produce metrics for 4 additional Action Controller Rails notifications

    Four additional Action Controller related Rails notifications are now subscribed to by the agent to produce telemetry. These 4 are exist_fragment?, expire_fragment, read_fragment, and write_fragment. As with instrumentation for Action Controller itself, these notifications are enabled by default and can be disabled by setting :disable_action_controller to true in the agent's newrelic.yml configuration file. PR#2745

June 20, 2024
Ruby agent v9.11.0

중요

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

Version 9.11.0 introduces instrumentation for the aws-sdk-sqs gem, fixes a bug related to expected errors not bearing a "true" value for the "expected" attribute if expected as a result of an HTTP status code match and changes the way Stripe instrumentation metrics are named to prevent high-cardinality issues.

  • Feature: Add instrumentation for SQS

    The agent has added instrumentation for the aws-sdk-sqs gem. The agent will now record message broker spans for SQS client calls made with the aws-sdk-sqs gem. PR#2679

  • Bugfix: HTTP status code based expected errors will now have an "expected" value of "true"

    Previously when an error was treated as expected by the agent as a result of a matching HTTP status code being found in the :'error_collector.expected_status_codes' configuration setting, the error would not appear with an "expected" attribute value of "true" in the errors in the errors inbox. PR#2710

  • Bugfix: Stripe metric names will no longer include full request paths to limit the unique name count

    The Stripe instrumentation introduced in agent version v9.5.0 produced instrumentation metric names that used the full Stripe request path. For any significant Stripe usage, this could quickly lead to very large number of distinct metric names. Now only the API version and the category part of the request path are included in the metric name which still includes the "Stripe" opener and method (ex: "get") closer. Thanks to @jdelStrother and @jsneedles for bringing this issue to our attention and providing terrific information explaining the problem and potential paths to resolution. PR#2716

June 6, 2024
Ruby agent v9.10.2

중요

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

Version 9.10.2 fixes a bug related to the new DynamoDB instrumentation and removes Rails::Command::RakeCommand from the default list of denylisted constants.

  • Bugfix: DynamoDB instrumentation logging errors when trying to get account_id

    When trying to access data needed to add the account_id to the DynamoDB span, the agent encountered an error when certain credentials classes were used. This has been fixed. Thanks to @kichik for bringing this to our attention. PR#2864

  • Bugfix: Remove Rails::Command::RakeCommand from the default list of autostart.denylisted_constants

    The default value for the autostart.denylisted_constants configuration was changed in 9.10.0 to include Rails::Command::RunnerCommand and Rails::Command::RakeCommand. The inclusion of Rails::Command::RakeCommand prevented the agent from starting automatically when Solid Queue was started using bin/rails solid_queue:start. We recognize there are many commands nested within Rails::Command::RakeCommand and have decided to remove it from the default list. We encourage users who do not want the agent to run on Rails::Command::RakeCommand to add the constant to their configuration. This can be accomplished by adding the following to your newrelic.yml file:

    autostart.denylisted_constants: "Rails::Command::ConsoleCommand,Rails::Command::CredentialsCommand,Rails::Command::Db::System::ChangeCommand,Rails::Command::DbConsoleCommand,Rails::Command::DestroyCommand,Rails::Command::DevCommand,Rails::Command::EncryptedCommand,Rails::Command::GenerateCommand,Rails::Command::InitializersCommand,Rails::Command::NotesCommand,Rails::Command::RakeCommand,Rails::Command::RoutesCommand,Rails::Command::RunnerCommand,Rails::Command::SecretsCommand,Rails::Console,Rails::DBConsole"

    Thank you, @edariedl, for reporting this issue. Issue#2677 PR#2694

June 3, 2024
Ruby agent v9.10.1

중요

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

  • Bugfix: Incompatibility with Bootstrap

Version 9.10.1 fixes an incompatibility between the agent and the Bootstrap gem caused by agent v9.10.0's introduction of a lib/bootstrap.rb file. Thank you to @dorner for reporting the bug and identifying the 'bootstrap' name collision as the root cause. BUG#2675 PR#2676

May 29, 2024
Ruby agent v9.10.0

중요

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

Version 9.10.0 introduces instrumentation for DynamoDB, adds a new feature to automatically apply nonces from the Rails content security policy, fixes a bug that would cause an expected error to negatively impact a transaction's Apdex, and fixes the agent's autostart logic so that by default rails runner and rails db commands will not cause the agent to start.

  • Feature: Add instrumentation for DynamoDB

    The agent has added instrumentation for the aws-sdk-dynamodb gem. The agent will now record datastore spans for DynamoDB client calls made with the aws-sdk-dynamodb gem. PR#2642

  • Feature: Automatically apply nonces from the Rails content security policy

    To auto-inject browser monitoring with the New Relic Ruby agent, you either need to set your content security policy to 'unsafe-inline' or provide a nonce. Previously, the only way to provide a nonce was by using the NewRelic::Agent.browser_timing_header API. Now, when a Rails application uses the content security policy configuration to add a nonce, the nonce will be automatically applied to the browser agent. A new configuration option, browser_monitoring.content_security_policy_nonce, toggles this feature. It is on by default. Thank you @baldarn for submitting this feature! PR#2544

  • Bugfix: Expected errors related to HTTP status code, class, and message won't impact Apdex

    The agent is supposed to prevent observed application errors from negatively impacting Apdex if the errors are either ignored or expected. There are two ways for the agent to expect an error: via the notice_error API receiving an expected: true argument or via matches made against user-configured lists for expected HTTP status codes (:'error_collector.expected_status_codes'), expected error classes (:'error_collector.expected_classes'), or expected error messages (:'error_collector.expected_messages'). Previously, only errors expected via the notice_error API were correctly prevented from impacting Apdex. Expected errors set by configuration incorrectly impacted Apdex. This behavior has been fixed and now both types of expected errors will correctly not impact Apdex. Thanks very much to @florianpilz for bringing this issue to our attention. PR#2619

  • Bugfix: Do not start the agent automatically when rails runner or rails db commands are run

    PR#2239 taught the agent how to recognize bin/rails based contexts that it should not automatically start up in. But bin/rails runner and bin/rails db commands would still see the agent start automatically. Those 2 contexts will now no longer see the agent start automatically. Thank you to @jdelStrother for both bringing the bin/rails context to our attention and for letting us know about the bin/rails runner and bin/rails db outliers that still needed fixing. PR#2623

    Older agent versions that are still supported by New Relic can update to the new list of denylisted constants by having the following line added to the newrelic.yml configuration file:

    autostart.denylisted_constants: "Rails::Command::ConsoleCommand,Rails::Command::CredentialsCommand,Rails::Command::Db::System::ChangeCommand,Rails::Command::DbConsoleCommand,Rails::Command::DestroyCommand,Rails::Command::DevCommand,Rails::Command::EncryptedCommand,Rails::Command::GenerateCommand,Rails::Command::InitializersCommand,Rails::Command::NotesCommand,Rails::Command::RakeCommand,Rails::Command::RoutesCommand,Rails::Command::RunnerCommand,Rails::Command::SecretsCommand,Rails::Console,Rails::DBConsole"

April 17, 2024
Ruby agent v9.9.0

중요

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

Version 9.9.0 introduces support for AWS Lambda serverless function observability, adds support for Elasticsearch 8.13.0, and adds the 'request.temperature' attribute to chat completion summaries in ruby-openai instrumentation.

  • Feature: Serverless Mode for AWS Lambda

    The Ruby agent is now capable of operating in a quick and light serverless mode suitable for observing AWS Lambda function invocations. For serverless use, the agent is delivered by a New Relic Lambda layer that can be associated with a Lambda function. All reported data will appear in New Relic's dedicated serverless UI views. Only AWS based Lambda functions are supported for now, though support for other cloud hosted serverless offerings may be added in future depending on Ruby customer demand. The serverless functionality is only intended for use with the official New Relic Ruby layers for Lambda. Any existing workflows that involve the manual use of the Ruby agent in an AWS Lambda context without a New Relic layer should not be impacted.

  • Feature: Add support for Elasticsearch 8.13.0

    Elasticsearch 8.13.0 increased the number of arguments used in the method the agent instruments, Elastic::Transport::Client#perform_request. Now, the agent supports a variable number of arguments for the instrumented method to prevent future ArgumentErrors.

  • Bugfix: Add 'request.temperature' to ruby-openai chat completion summaries

    Previously, the agent was not reporting the request.temperature attribute on LlmChatCompletionSummary events through ruby-openai instrumentation. We are now reporting this attribute.

March 26, 2024
Ruby agent v9.8.0

중요

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

Version 9.8.0 introduces instrumentation for ruby-openai, adds the option to store tracer state on the thread-level, hardens the browser agent insertion logic to better proactively anticipate errors, and prevents excpetions from being raised in the Active Support Broadcast logger instrumentation.

  • Feature: Add instrumentation for ruby-openai

    Instrumentation has been added for the ruby-openai gem, supporting versions 3.4.0 and higher (PR#2442). While ruby-openai instrumentation is enabled by default, the configuration option ai_monitoring.enabled is disabled by default and controls all AI monitoring. ai_monitoring.enabled must be set to true in order to receive ruby-openai instrumentation. High-Security Mode must be disabled in order to receive AI monitoring.

    Calls to embedding and chat completion endpoints are automatically traced. These events can be enhanced with the introduction of two new APIs. Custom attributes can also be added to LLM events using the API NewRelic::Agent.add_custom_attributes, but they must be prefixed with llm.. For example, NewRelic::Agent.add_custom_attributes({'llm.user_id': user_id}).

  • Feature: Add AI monitoring APIs

    This version introduces two new APIs that allow users to record additional information on LLM events:

    • NewRelic::Agent.record_llm_feedback_event - Records user feedback events.
    • NewRelic::Agent.set_llm_token_count_callback - Sets a callback proc for calculating token_count attributes for embedding and chat completion message events.

    Visit RubyDoc for more information on each of these APIs.

  • Feature: Store tracer state on thread-level

    A new configuration option, thread_local_tracer_state, stores New Relic's tracer state on the thread-level, as opposed to the default fiber-level storage. This configuration is turned off by default. Our thanks go to community member @markiz who contributed the idea, code, configuration option, and tests for this new feature! PR#2475.

  • Bugfix: Harden the browser agent insertion logic

    With Issue#2462, community member @miry explained that it was possible for an HTTP response headers hash to have symbols for values. Not only would these symbols prevent the inclusion of the New Relic browser agent tag in the response body, but more importantly they would cause an exception that would bubble up to the monitored web application itself. With PR#2465 symbol based values are now supported and all other potential future exceptions are now handled. Additionally, the refactor to support symbols has been shown through benchmarking to give the processing of string and mixed type hashes a slight speed boost too.

  • Bugfix: Prevent Exception in Active Support Broadcast logger instrumentation

    Previously, in certain situations the agent could cause an exception to be raised when attempting to interact with a broadcast log event. This has been fixed. Thanks to @nathan-appere for reporting this issue and providing a fix! PR#2510

Copyright © 2026 New Relic Inc.

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