Skip to content
CAI
Software that uses CAICheck a score

newrelic/newrelic-ruby-agent

50.5

Adequate · 6 November 2026

40.8k

lines of production code

Ruby

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Add Elasticsearch instrumentation

The New Relic Ruby agent now automatically instruments Elasticsearch client requests, capturing datastore metrics including host, port, and operation name. It supports both Elasticsearch gem versions prior to 8.0.0 and 8.0.0+, adapting the instrumentation target accordingly. Users can optionally enable the collection of the Elasticsearch cluster name and the actual query statements (with optional obfuscation) via configuration flags.

_lib/new\_relic/agent/instrumentation/aws\_sdk\_firehose, lib/new\_relic/agent/instrumentation/elasticsearch, lib/new\_relic/agent/instrumentation/semantic\logger · high confidence

Add New Relic instrumentation for Tilt template rendering

The agent now automatically instruments Tilt-based template rendering (used by frameworks like Sinatra) to capture performance metrics and errors. This change introduces a new instrumentation module that wraps the Tilt \render\ method, creating trace segments named \View/{Class}/{File}/Rendering\ and ensuring any exceptions raised during template rendering are recorded.

_lib/new\relic/agent/instrumentation/tilt · high confidence

Add New Relic instrumentation for the HTTPX Ruby library

The agent now automatically traces HTTP requests made using the HTTPX library. This change introduces instrumentation files that wrap the \send\_requests\ method to create external request segments, capture request headers, and process response headers. It also handles error detection by noticing errors when an \HTTPX::ErrorResponse\ is received, ensuring that HTTPX traffic is visible in New Relic performance monitoring.

_lib/new\relic/agent/instrumentation/httpx · high confidence

Add New Relic instrumentation for the Parallel gem

The agent now instruments the Parallel gem to capture transaction metrics from forked worker processes. When the Parallel gem's worker method is invoked, the agent ensures the pipe channel listener is active, registers a unique channel for the worker, and wraps the job execution in tracing. After forking, child processes merge their recorded metrics back into the parent process via an at\_exit hook, ensuring that performance data from parallelized tasks is not lost.

_lib/new\relic/agent/instrumentation/parallel · high confidence

Add New Relic instrumentation for the Roda web framework

This change introduces automatic instrumentation for Roda applications, enabling New Relic to capture transaction traces, performance metrics, and error data. The instrumentation hooks into Roda's main route handling and Rack app building processes to record traces with appropriate transaction names derived from the request path. It also supports ignoring specific routes or metrics (apdex, end-user) via new \newrelic\ignore\\ configuration options, allowing users to exclude noisy or irrelevant endpoints from monitoring.

_lib/new\relic/agent/instrumentation/roda · high confidence

Add New Relic instrumentation for the rdkafka Ruby client

The New Relic Ruby agent now automatically instruments the rdkafka library to capture distributed tracing and performance metrics for Kafka messaging. This change adds instrumentation for producer \produce\ and consumer \each\ operations, enabling automatic span creation, distributed trace header injection, and the recording of specific metrics such as \MessageBroker/Kafka/Nodes/{host}/{action}/{topic}\. The implementation supports both class-eval and prepend-based instrumentation strategies and includes version checks to ensure compatibility with rdkafka versions 0.16.0+ and Ruby 2.7.0+.

_lib/new\relic/agent/instrumentation/rdkafka · high confidence

Add Rails 3 controller and Rails 3.2 view instrumentation

This change introduces new instrumentation for Rails 3 applications. It adds controller tracing via \ActionController::Base\ to capture action metrics and parameters, and specifically targets Rails 3.2 for view instrumentation by wrapping \ActionView::TemplateRenderer\ and \ActionView::PartialRenderer\ to trace template and partial rendering. The implementation uses dependency detection to ensure it only activates on the supported Rails versions.

_lib/new\relic/agent/instrumentation/rails3 · high confidence

Add Ruby Logger instrumentation with supportability metrics and recursion protection

The agent now instruments Ruby's standard \Logger\ class to capture log events and record supportability metrics for method invocations. This change introduces a new instrumentation module that wraps the \format\_message\ method, allowing the agent to aggregate log data and decorate local logs. To prevent stack overflows from recursive logging within the agent itself, the implementation includes a recursion guard that marks specific internal loggers (such as \AgentLogger\ and \AuditLogger\) to skip instrumentation. The feature is controlled by the \instrumentation.logger\ configuration setting.

_lib/new\relic/agent/instrumentation/logger · high confidence

Add instrumentation for Concurrent::ThreadPoolExecutor and error handling

The New Relic Ruby agent now instruments the \Concurrent::ThreadPoolExecutor\#post\ method to wrap submitted tasks in a tracing segment, ensuring that background work is captured in transaction traces. Additionally, it patches \Concurrent::Promises\ internal rejection states to automatically record exceptions via \notice\_error\ when a promise is rejected, improving visibility into asynchronous failures.

_lib/new\_relic/agent/instrumentation/concurrent\ruby · high confidence

Add instrumentation for ViewComponent rendering

The agent now automatically instruments ViewComponent rendering, allowing users to see performance metrics for individual ViewComponents in their traces. This is achieved by wrapping the \render\_in\ method to start and finish a tracing segment, with logic to dynamically determine the metric name using either \source\_location\ or \identifier\ depending on the ViewComponent version.

_lib/new\_relic/agent/instrumentation/view\component · high confidence

Add instrumentation for the Logging gem to capture log events and MDC data

The New Relic Ruby agent now instruments the \Logging\ gem to automatically capture log events. When enabled via the \instrumentation.logging\ configuration, the agent decorates log output and records logging events in New Relic, including any MDC (Mapped Diagnostic Context) data associated with the log line. This allows users to correlate their application logs with New Relic traces and events.

_lib/new\relic/agent/instrumentation/logging · high confidence

Add instrumentation generator CLI for scaffolding new library instrumentation

A new Thor-based command-line interface (\instrumentation:scaffold\) has been added to automate the creation of file structures for new Ruby agent instrumentation. Running the command with a library name generates the necessary instrumentation files (chain, instrumentation, prepend, dependency detection), test suites, configuration files, and updates the default source configuration, significantly reducing the manual effort required to add support for new libraries.

_lib/tasks/instrumentation\generator · high confidence

Add instrumentation support for Sidekiq delayed extensions

The agent now instruments Sidekiq's delayed job extensions, ensuring that jobs created via \delay\ or \delay\_for\ are traced. This includes a new \Sidekiq::DelayExtensions::GenericJob\ tracer for modern Sidekiq versions and a \Sidekiq::Extensions::DelayedClass\ tracer for Sidekiq versions prior to 7.0, allowing users to see performance data for these asynchronous jobs in their dashboards.

_lib/new\relic/agent/instrumentation/sidekiq/extensions · high confidence

Added AWS SQS instrumentation for message tracing

The agent now instruments the AWS SQS client to automatically trace message production and consumption. When \send\_message\, \send\_message\_batch\, or \receive\_message\ are called, the agent creates message broker segments, capturing attributes such as the queue name, AWS region, and account ID, which allows users to monitor SQS activity within their application traces.

_lib/new\_relic/agent/instrumentation/aws\sqs · high confidence

Added New Relic instrumentation for AWS SQS

The agent now automatically instruments the AWS SQS client to capture distributed tracing data for message production and consumption. When using \send\_message\, \send\_message\_batch\, or \receive\_message\, the agent creates message broker segments, records attributes such as the queue name, AWS region, and account ID, and links these spans to the broader trace context.

_lib/new\relic/agent/instrumentation/opensearch · high confidence

Added New Relic instrumentation plugin for Sequel models

A new plugin file has been added to the library to integrate New Relic APM with the Sequel ORM. This plugin automatically instruments common Sequel::Model methods (such as save, update, delete, create, and find operations) to generate datastore metrics in New Relic, allowing users to monitor database performance and transaction details for their Sequel-based applications.

lib/sequel/plugins · high confidence

Added Ruby Fiber instrumentation with Ruby 2.7+ compatibility

The New Relic Ruby agent now instruments Ruby Fibers to capture execution context, ensuring that fiber-based code is properly traced within the current transaction. This change introduces new instrumentation files (\chain.rb\, \instrumentation.rb\, \prepend.rb\) that wrap Fiber initialization to propagate tracing data. To maintain compatibility across Ruby versions, the implementation uses keyword arguments (\\*\*kwargs\) for Ruby 2.7 and later, while falling back to positional arguments for earlier versions, ensuring accurate thread and fiber tracing regardless of the runtime version.

_lib/new\relic/agent/instrumentation/fiber · high confidence

Added instrumentation for AWS SDK Lambda client methods

The agent now includes instrumentation for the AWS SDK Lambda client, specifically wrapping the \invoke\, \invoke\_async\, and \invoke\_with\_response\_stream\ methods. This allows New Relic to automatically trace and monitor these Lambda invocation calls made by the application.

_lib/new\_relic/agent/instrumentation/aws\_sdk\lambda · high confidence

Added instrumentation for Async::HTTP client

New Relic now automatically captures distributed tracing data for HTTP requests made using the Async::HTTP library. This change introduces instrumentation that wraps the client's \call\ method to create external request segments, ensuring that request headers are injected for tracing and response headers are processed, allowing users to monitor the performance and dependencies of their async HTTP traffic.

_lib/new\_relic/agent/instrumentation/async\http · high confidence

Added instrumentation for the Ethon HTTP client library

The agent now automatically traces HTTP requests made via Ethon. This includes tracing individual requests through \Ethon::Easy\ (capturing method, URL, headers, and errors based on return codes) and batched requests via \Ethon::Multi\. Users will see external request segments in their New Relic data for Ethon-based traffic.

_lib/new\relic/agent/instrumentation/ethon · high confidence

Added rake task to generate Infinite Tracing proto files

A new rake task (\rake proto:generate\) has been added to the agent to automatically generate Ruby gRPC code from the \infinite\_tracing.proto\ definition. This task uses \grpc\_tools\_ruby\_protoc\ to compile the protocol buffers and automatically applies license headers while removing redundant require statements from the generated output, streamlining the maintenance of the Infinite Tracing client code.

_infinite\tracing/tasks · high confidence

Automated generation of Ruby agent configuration documentation and newrelic.yml templates

The Ruby agent now includes a new set of helper modules in lib/tasks/helpers (Format, Matches, NewRelicYML, Prompt, VersionBump) and ERB templates (config.html.erb, config.text.erb) that automate the creation of the \newrelic.yml\ configuration file and the associated configuration reference documentation. These tools read directly from the agent's internal \default\_source.rb\ configuration definitions to generate up-to-date HTML and text documentation, ensuring that the public-facing docs always reflect the current available settings, environment variable mappings, and default values without manual maintenance.

lib/tasks/helpers · high confidence

Automated schema generation and versioning for Fleet Control

Added a new schema generation toolchain in \.fleetControl/schemaGeneration\ that automatically produces the JSON Schema (Draft 2020-12) used by Fleet Control to validate and render Ruby agent configuration. The \generate\_schema.rb\ script derives the schema directly from the agent's \DEFAULTS\, ensuring it stays in sync without manual maintenance, while \schema\_diff.rb\ and \bump\_schema\_version.rb\ analyze changes against the previous release to recommend or apply semantic version bumps (major, minor, or patch) based on breaking, additive, or cosmetic modifications. This automation is integrated into the CI pipeline to regenerate the schema on pushes and handle versioning during prereleases.

.fleetControl/schemaGeneration · high confidence

Infinite Tracing integration for segment span events and agent lifecycle

This change introduces the agent-side integration layer for Infinite Tracing within the Ruby agent. It adds logic to the Agent class to manage the infinite tracer lifecycle, including starting the gRPC streaming thread, handling force restarts from the server, and closing connections. Additionally, it integrates span event recording into the agent's segment hierarchy (base Segment, DatastoreSegment, and ExternalRequestSegment), ensuring that span events are queued to the infinite tracer upon segment completion, while explicitly skipping recording for ignored transactions.

_infinite\_tracing/lib/infinite\_tracing/agent\integrations · high confidence

Initial OpenTelemetry bridge for trace instrumentation

The New Relic Ruby agent now includes an initial bridge that allows OpenTelemetry spans to be recorded as New Relic transactions and segments. This implementation maps OpenTelemetry span kinds (server, client, consumer, producer, internal) to appropriate New Relic transaction or segment types, translates span attributes into New Relic intrinsic, agent, and custom attributes, and supports span links, events, and error recording. The bridge also handles context propagation from OpenTelemetry propagators and manages transaction starting rules based on parent context and span kind.

_lib/new\relic/agent/opentelemetry/trace · high confidence

Initial OpenTelemetry bridge implementation

The agent now includes an initial bridge to integrate with OpenTelemetry, introducing new files under lib/new\_relic/agent/opentelemetry. This bridge maps OpenTelemetry spans to New Relic segments via an AttributeTranslator that dispatches to specific translators (Datastore, Redis, HTTP, RPC, Messaging, Generic) based on instrumentation scope, discriminating attributes, or span kind. It patches core agent components (AbstractSegment, Transaction, Trace, SpanEventPrimitive) to create New Relic spans as children of OpenTelemetry spans, attach span links and span events, handle timestamp normalization, and manage context propagation, enabling visibility into OpenTelemetry-traced workloads within New Relic.

_lib/new\relic/agent/opentelemetry · high confidence

Initialize development environment configuration files

Added foundational configuration files for the development environment, including \.rubocop.yml\ (targeting Ruby 2.7 with minitest, performance, and rake plugins), \.simplecov\ for branch coverage, \.snyk\ to exclude the Dockerfile from security scans, and a \Brewfile\ specifying local dependencies like Elasticsearch, MongoDB, MySQL, PostgreSQL, and Redis. Also added \.build\_ignore\, \.gitignore\, \.yardopts\, \Guardfile\, \Dockerfile\, \DOCKER.md\, \CLAUDE.md\, \CONTRIBUTING.md\, and \LICENSE\ to standardize local development, testing, and contribution workflows.

(repo-wide) · high confidence

Instrument ActiveSupport::Logger broadcast to capture distributed traces

The agent now instruments ActiveSupport::Logger's broadcast method to ensure that log messages sent to multiple destinations are traced correctly. By wrapping the broadcast operation with tracing logic, the agent records instrumentation invocation metrics and marks broadcasted loggers to prevent redundant instrumentation, ensuring that only the primary logger (such as Rails.logger) is instrumented while maintaining trace context across all broadcast targets.

_lib/new\_relic/agent/instrumentation/active\_support\logger · high confidence

Introduce Infinite Tracing support with gRPC streaming and batching

This change adds the core Infinite Tracing implementation to the agent, enabling high-volume span data transmission via a bi-directional gRPC stream to a Trace Observer. The new \infinite\_tracing\ library includes a \StreamingBuffer\ that supports both individual span streaming and batched submissions (with configurable compression and hold times) to improve throughput. It introduces a \Client\ and \Connection\ singleton to manage the gRPC lifecycle, handling reconnection backoffs, agent connectivity waits, and server signals (such as suspension or stream closure). The feature is gated by configuration (\infinite\_tracing.trace\_observer.host\) and requires Distributed Tracing and Span Events to be enabled.

_infinite\_tracing/lib/infinite\tracing · high confidence

Introduce OpenTelemetry-based continuous profiling data pipeline

The continuous profiling subsystem now exports profile data using the OpenTelemetry Protocol (OTLP) format instead of a proprietary structure. This change adds vendored OpenTelemetry protobuf definitions (common, resource, profiles, and profiles\_service) and a new ProfileEncoder that serializes samples into OTLP ExportProfilesServiceRequest messages. The encoder correlates profile samples with distributed tracing by attaching trace and span identifiers via OTLP Links, and enriches resource attributes with service name, host, and entity GUID. The Session and StackProfSampler classes have been updated to manage the profiling lifecycle, collect raw samples, and pass them to the new encoder, enabling compatibility with OTLP collectors.

_lib/new\_relic/agent/continuous\profiling · high confidence

New ActiveSupport::Notifications-based instrumentation for Rails components

The agent now instruments several Rails subsystems using the modern ActiveSupport::Notifications API instead of older monkey-patching or callback methods. New subscribers have been added for ActionCable, ActionDispatch (middleware), ActionMailbox, ActionMailer, ActionView, ActiveJob, and ActiveRecord, providing more accurate and consistent metric collection for these areas. Additionally, a new subscriber for ActionController handles other controller events, and specific instrumentation files for ActionDispatch, ActionMailbox, and ActionMailer have been created to manage dependency detection and subscription setup for these newer Rails features.

_lib/new\relic/agent/instrumentation · high confidence

New CLI entry points for command execution and debugging

The repository now includes two new executable scripts in the bin directory: \newrelic\_rpm\ and \nrdebug\. The \newrelic\_rpm\ script serves as the primary CLI entry point, delegating execution to the \NewRelic::Cli::Command\ module to run specific agent commands. The \nrdebug\ script is a new diagnostic tool that attaches to a running Ruby process via GDB to capture thread backtraces and process information (such as CPU, memory, and open files) on Linux and macOS, aiding in troubleshooting agent behavior.

bin · high confidence

New Claude Code development workflow and instrumentation scaffolding skill

This change introduces a structured development environment for the New Relic Ruby Agent within Claude Code. It adds a comprehensive development guide (.claude/development.md) covering testing, Docker setup, and Git workflows. It also installs two stop-hooks (check\_comments.sh, check\_rubocop.sh) that enforce code quality by blocking commits that introduce non-compliant comments or RuboCop offenses. Additionally, a new 'instrumentation' skill is added, providing a detailed, step-by-step guide for scaffolding new agent instrumentations for third-party gems, including category classification, design previews, and file generation contracts.

.claude · high confidence

New DynamoDB instrumentation for AWS SDK v2

Added instrumentation for the AWS SDK for Ruby v2 (DynamoDB), enabling automatic tracing of DynamoDB operations such as get\_item, put\_item, query, and scan. The new implementation captures datastore segments with attributes including the table name, AWS region, operation type, and resource ARN, providing visibility into DynamoDB performance within New Relic.

_lib/new\relic/agent/instrumentation/dynamodb · high confidence

New Kinesis instrumentation with message broker spans

The agent now instruments the AWS SDK for Kinesis, adding tracing for data-plane operations (put\_record, put\_records, get\_records) as message broker segments with produce/consume actions, while control-plane operations are traced as standard segments. This change introduces new instrumentation files (chain.rb, instrumentation.rb, prepend.rb) that wrap Kinesis client methods, capture stream ARNs and names, and record platform attributes for better visibility into Kinesis stream activity.

_lib/new\_relic/agent/instrumentation/aws\_sdk\kinesis · high confidence

New LLM event tracking and OpenAI response header parsing

The agent now captures detailed LLM interaction data by introducing a new \LlmEvent\ class that records custom events with attributes such as request ID, span/trace IDs, and metadata. Additionally, a new \ResponseHeaders\ module parses OpenAI-specific HTTP headers (including rate limits, organization, version, and request ID) and maps them to period-delimited attribute names for upstream reporting.

_lib/new\relic/agent/llm · high confidence

New OpenTelemetry attribute translators for HTTP, RPC, Datastore, and Messaging

The agent now includes a new set of OpenTelemetry attribute translators in the \lib/new\_relic/agent/opentelemetry/translators\ directory to map OTel semantic conventions to New Relic attributes. This change introduces a \BaseTranslator\ with a shared translation strategy, alongside specific translators for HTTP client/server, RPC (gRPC), Datastore (including Redis), and Messaging systems. These components define mappings for attributes such as HTTP status codes, database operations, and RPC methods, ensuring that telemetry data from OpenTelemetry instrumentation is correctly translated into New Relic transaction traces and events.

_lib/new\relic/agent/opentelemetry/translators · high confidence

New Rake tasks for configuration, versioning, and testing infrastructure

The Ruby agent now includes a comprehensive set of Rake tasks in lib/tasks to streamline development and release workflows. Users can generate and validate configuration documentation via \rake newrelic:config:docs\ and update the \newrelic.yml\ file with \rake newrelic:update\_newrelicyml\. Version management is handled by \rake newrelic:version:bump\ and \rake newrelic:version:current\. Testing capabilities have been expanded with \rake test:multiverse\ for functional suite testing, \rake test:newrelic\ for unit tests (supporting line-number-based filtering), and \rake coverage:report\ for collating SimpleCov results. Additionally, \rake continuous\_profiling:generate\_proto\ allows regeneration of vendored OpenTelemetry proto classes, and \rake gha:update\_versions\ automates GitHub Action version updates across workflows.

lib/tasks · high confidence

New Relic Ruby agent adds instrumentation for OpenAI API calls

The agent now automatically instruments the OpenAI Ruby library to capture LLM-specific metrics and events. This change introduces instrumentation for both chat completions and embeddings, recording details such as model names, token counts, and message content (when content recording is enabled). It also supports custom LLM attributes from transaction metadata and provides supportability metrics to track instrumentation usage across different OpenAI library versions.

_lib/new\_relic/agent/instrumentation/ruby\openai · high confidence

New Relic agent bootstrapping via lib/boot/strap.rb

A new file, lib/boot/strap.rb, has been added to enable bootstrapping the New Relic Ruby agent in applications that use Bundler. This mechanism allows the agent to be introduced to a Ruby app without modifying the app's dependencies or source code, by requiring the file via the RUBYOPT environment variable. The script patches Bundler::Runtime to ensure the New Relic gem is loaded before the application's own gems.

lib/boot · high confidence

New Relic instrumentation extension for Sequel databases

Added the \:new\_relic\_instrumentation\ extension to Sequel, enabling automatic instrumentation of database connections and queries for New Relic APM. This extension registers a database extension that instruments SQL execution, allowing New Relic to capture datastore metrics and SQL statements. It supports both standard connection pools and thread-safe pools (including \TimedQueueConnectionPool\ on Ruby 3.2+), and respects New Relic's configuration settings for enabling or disabling instrumentation.

lib/sequel/extensions · high confidence

New gRPC client instrumentation for distributed tracing

The agent now instruments the gRPC client to automatically capture distributed traces for all four streaming modes: unary (request\_response), server streaming, client streaming, and bidirectional streaming. This change introduces a new instrumentation module that wraps \GRPC::ClientStub\ methods (via both prepend and chain strategies) to create external request segments, inject New Relic metadata into gRPC headers for cross-process tracing, and record attributes such as gRPC status codes and error messages. Users will see gRPC client calls appear in their APM traces with proper parent-child relationships to downstream services.

_lib/new\relic/agent/instrumentation/grpc/client · high confidence

New gRPC server instrumentation for distributed tracing and metrics

The New Relic Ruby agent now instruments gRPC servers to capture distributed tracing data, synthetic request metrics, and transaction traces. This change introduces instrumentation for \GRPC::RpcServer\ (handling port binding and server startup) and \GRPC::RpcDesc\ (handling request-response, client-streaming, server-streaming, and bidi-streaming RPCs). The agent extracts distributed tracing headers (traceparent, tracestate, New Relic key) and synthetic headers (x-newrelic-synthetics) from incoming metadata to link transactions and identify synthetic traffic. It also records server host, port, and method details as transaction attributes, enabling visibility into gRPC server performance and request flows.

_lib/new\relic/agent/instrumentation/grpc/server · high confidence

New instrumentation for Grape API framework

Added support for automatic instrumentation of Grape API applications, enabling New Relic to capture transaction names, request parameters, and API version information. The implementation includes a new chain-based instrumentation strategy (chain.rb) and a prepend-based strategy (prepend.rb) to wrap the Grape API call method, ensuring that transaction data is captured correctly for both older and newer versions of the Grape gem.

_lib/new\relic/agent/instrumentation/grape · high confidence

New instrumentation for HTTPClient and HTTPrb libraries

The agent now automatically traces HTTP requests made via the HTTPClient and HTTPrb gems. This change introduces new instrumentation modules that wrap the core request methods (do\_get\_block for HTTPClient and perform for HTTPrb) to capture external request segments, including request/response headers and error handling, ensuring these libraries are monitored for performance and error data.

_lib/new\relic/agent/instrumentation/httpclient · high confidence

New instrumentation for Ruby Kafka client library

The New Relic Ruby agent now includes support for instrumenting the \ruby-kafka\ library. This change adds chain and prepend instrumentation strategies to automatically capture distributed tracing headers on message production and consumption, record metrics for specific Kafka nodes and topics, and inject configuration into producer and consumer instances.

_lib/new\_relic/agent/instrumentation/ruby\kafka · high confidence

New instrumentation generator templates for Ruby agent

The instrumentation generator now provides a complete set of Thor templates (Envfile, chain, prepend, instrumentation, dependency detection, and test scaffolding) to help developers create custom instrumentation for Ruby libraries. These templates support both method chaining and prepending strategies, include dependency detection logic, and generate basic test structures, enabling users to easily add New Relic monitoring to their own gems or applications.

_lib/tasks/instrumentation\generator/templates · high confidence

New observability capabilities: LLM event tracking, AWS Lambda instrumentation, and OpenTelemetry bridge

The agent now supports tracking Large Language Model interactions by introducing LLM event structures (ChatCompletionMessage, ChatCompletionSummary, Embedding) that capture request and response attributes for AI workloads. It adds dedicated instrumentation for AWS Lambda functions, automatically creating segments with cloud metadata (account, region, ARN) and handling function errors. Additionally, an OpenTelemetry bridge is introduced via a custom TracerProvider that allows the agent to intercept and manage OpenTelemetry traces, excluding specific tracers as configured.

_newrelic\rpm · high confidence

New samplers for CPU, memory, VM, objects, and Delayed Job metrics

The agent now includes dedicated samplers for CPU utilization, memory usage, Ruby VM/GC statistics, live object counts, and Delayed Job queue status. CPU sampling uses Process.clock\_gettime for accurate user/system time and utilization calculations, with JRuby support enabled for version 1.7.0 and higher. Memory sampling adapts to the platform, using /proc status on Linux, ps commands on macOS/FreeBSD/Solaris, and Java heap metrics on JRuby. The VM sampler records GC runs, heap live/free, thread counts, and cache invalidations. Object sampling tracks live objects via ObjectSpace. Delayed Job sampling tracks failed and locked jobs, and breaks down queue length by name or priority where supported.

_lib/new\relic/agent/samplers · high confidence

OpenTelemetry context propagation support

The agent now supports extracting and injecting distributed tracing context via OpenTelemetry propagators. A new TracePropagator implementation allows the agent to inject New Relic distributed tracing headers into outbound requests and extract incoming trace context (including trace ID, span ID, trace flags, and trace state) to link transactions with OpenTelemetry spans.

_lib/new\relic/agent/opentelemetry/context · high confidence

Architecture

New Relic Ruby Agent control module restructured into sub-modules

The New Relic Ruby Agent's control module has been reorganized into distinct sub-modules (class\_methods, instance\_methods, instrumentation, private\_instance\_methods, security\_interface, and frameworks) to improve code maintainability and extensibility. This refactoring preserves the existing public API and agent initialization behavior, ensuring that users experience no functional changes while benefiting from a cleaner internal architecture that separates configuration, logging, instrumentation loading, and security interface logic.

_lib/new\relic/control · high confidence

Refactor agent lifecycle into modular helper components

The agent's core lifecycle logic has been reorganized into distinct modules within the \AgentHelpers\ namespace to improve maintainability. Connection handling, including retry backoff and license error management, is now in \AgentHelpers::Connect\. Data harvesting and transmission for metrics, traces, and events are split between \AgentHelpers::Harvest\ and \AgentHelpers::Transmit\. Startup sequencing, including dispatcher-specific deferrals and exit handler installation, is handled by \AgentHelpers::Startup\ and \AgentHelpers::SpecialStartup\. Background worker thread management and event loop execution are now in \AgentHelpers::StartWorkerThread\, while graceful shutdown procedures are isolated in \AgentHelpers::Shutdown\. This modularization clarifies the agent's operational flow without changing its external behavior.

_lib/new\_relic/agent/agent\helpers · high confidence

Refactored connect service request and response handling

The connect service logic has been reorganized into dedicated modules: a new RequestBuilder constructs the payload sent to the New Relic collector (including environment metadata and event harvest configuration), and a ResponseHandler processes server-side configuration updates. This change improves code maintainability and clarity for how the agent initializes and communicates with the backend.

_lib/new\relic/agent/connect · high confidence

Behavioural changes

Configurable New Relic agent initialization timing in Rails

The New Relic agent now supports deferred initialization in Rails applications via the NEW\_RELIC\_DEFER\_RAILS\_INITIALIZATION environment variable. When enabled, the agent includes method tracers before other config initializers run but delays the full plugin initialization until after config initializers have loaded, allowing applications to configure the agent using standard Rails config mechanisms. If the environment variable is not set, the agent initializes before config initializers as before.

lib · high confidence

Defer trace creation until harvest

The agent now defers the creation of transaction traces until the harvest phase, rather than creating them immediately. This change, implemented via the introduction of TraceBuilder and AbstractSegment\#finalize, optimizes resource usage by avoiding the allocation of trace data for transactions that may be dropped or filtered later in the process.

_lib/new\relic/agent · high confidence

Deferred loading of Infinite Tracing library

The Infinite Tracing library is now loaded via a deferred dependency detection mechanism, ensuring that it only initializes after the New Relic Agent core has been fully configured. This change prevents premature loading issues and ensures that the library respects the agent's configuration state before requiring its internal components such as the worker, connection, and client modules.

_infinite\tracing/lib/newrelic · high confidence

Delayed Job instrumentation now uses module prepending

The New Relic Ruby agent has refactored its Delayed Job instrumentation to use Ruby's module prepend mechanism instead of alias chaining. This change ensures that the agent's tracing hooks are applied before any other modifications to the \Delayed::Worker\ and \Delayed::Job\ classes, improving compatibility with other gems that also monkey-patch these classes. For users, this results in more reliable transaction and span data capture for background jobs, particularly in environments where multiple libraries interact with Delayed Job.

_lib/new\_relic/agent/instrumentation/delayed\job · high confidence

Excon instrumentation refactored to use external segments and Tracer API

The Excon HTTP client instrumentation has been rewritten to use the new external segment API and Tracer, replacing the previous middleware-based approach. This change ensures that tracing segments are properly started and finished using the dedicated Tracer, handles idempotent requests correctly by preventing duplicate instrumentation, and updates header processing to use the new process\_response\_headers method. Users will see more accurate and consistent distributed tracing data for Excon requests, with improved handling of errors and response headers.

_lib/new\relic/agent/instrumentation/excon · high confidence

Introduce vendor-based cloud utilization detection

The agent now uses a new \Vendor\ base class and specific subclasses (AWS, Azure, GCP, ECS, PCF) to detect and collect utilization metadata from cloud environments. This refactors the previous monolithic detection logic into a modular system where each cloud provider has its own configuration for endpoints, headers, and key transforms. For AWS, this includes support for IMDSv2 token-based requests. Users running on these platforms will see their environment metadata collected through this new, more robust and extensible detection framework.

_lib/new\relic/agent/utilization · high confidence

Introduces new segment and distributed tracing architecture

The agent introduces a new segment hierarchy with \AbstractSegment\ as the base class, alongside new concrete segment types for datastores (\DatastoreSegment\), external requests (\ExternalRequestSegment\), and message brokers (\MessageBrokerSegment\). This change also centralizes distributed tracing logic into a new \DistributedTracer\ class and \DistributedTracing\ module, which handle the creation and acceptance of trace payloads and headers. Additionally, a new \RequestAttributes\ class is added to manage the collection and assignment of HTTP request attributes to transactions.

_lib/new\relic/agent/transaction · high confidence

Introduction of StatsHash for metric storage

The agent now uses a new \StatsHash\ class to store metric data, replacing the previous \SynchronizedHash\ implementation. This class internally separates metrics into scoped and unscoped collections, providing a Hash-like interface for recording and merging transaction metrics. It includes specific handling for corrupted default procs during lookups and supports marshaling for serialization, ensuring metrics are correctly captured and merged into the stats engine.

_lib/new\_relic/agent/stats\engine · high confidence

MongoDB instrumentation refactored into dedicated metric and event formatter modules

The MongoDB datastore instrumentation has been restructured to improve clarity and supportability. A new \EventFormatter\ module now handles the formatting of MongoDB commands for query capture, including obfuscation of specific keys like \filter\, \query\, and \pipeline\, and removal of denylisted keys. A new \MetricTranslator\ module centralizes the logic for translating MongoDB operations into metrics, handling collection name extraction from selectors, supporting new operations like \createIndexes\, and ensuring metric consistency for renamed operations (e.g., mapping \delete\ to \remove\ for older driver versions). This refactoring separates concerns, making the instrumentation easier to maintain and extend.

_lib/new\relic/agent/datastores/mongo · high confidence

New --force option for the newrelic install command

The \newrelic install\ CLI command now accepts a \--force\ (or \-f\) flag, allowing users to overwrite an existing \newrelic.yml\ configuration file. Previously, the command would fail with an error if the target file already existed; with this change, users can explicitly choose to replace the current configuration without manual deletion.

_lib/new\relic/cli/commands · high confidence

New Curb instrumentation using method prepending

The New Relic Ruby agent now instruments the Curb HTTP client library using Ruby's method prepending mechanism instead of the previous aliasing approach. This change introduces new files (chain.rb, instrumentation.rb, prepend.rb) to wrap Curb::Easy and Curb::Multi methods (such as http, perform, and add) with tracing segments, ensuring that external request metrics are captured correctly for both serial and parallel requests while avoiding potential conflicts with other libraries that might monkey-patch the same classes.

_lib/new\relic/agent/instrumentation/curb · high confidence

New Relic Ruby Agent configuration system refactored into layered sources

The agent's configuration management has been rewritten to use a layered source architecture, replacing the previous monolithic approach. The new system introduces distinct configuration sources—DefaultSource, YamlSource, EnvironmentSource, ServerSource, HighSecuritySource, and ManualSource—that are merged in a specific priority order within a new Configuration::Manager. This change enables server-side configuration overrides, stricter high-security mode enforcement (e.g., disabling SQL recording and parameter capture), and environment variable mapping via the EnvironmentSource. It also introduces new configuration classes like DottedHash for key flattening and EventHarvestConfig to handle server-driven event harvest limits, providing a more robust and flexible way to manage agent settings across different environments and security policies.

_lib/new\relic/agent/configuration · high confidence

Padrino instrumentation refactored to use method prepending

The New Relic agent's instrumentation for the Padrino framework has been updated to use Ruby's method prepending mechanism instead of the previous module inclusion and aliasing approach. This change modifies how the agent wraps the \dispatch\ and \invoke\_route\ methods in Padrino applications, ensuring that tracing is applied via prepended modules. Users of the agent with Padrino applications will experience this as a transparent update to the underlying instrumentation strategy, which may affect compatibility with older Padrino versions or custom monkey-patches that relied on the previous aliasing structure.

_lib/new\relic/agent/instrumentation/padrino · high confidence

Rack instrumentation refactored to use prepending and support Rack v3+ middleware patterns

The Rack instrumentation mechanism has been rewritten to use Ruby module prepending instead of aliasing, which improves compatibility with modern Ruby and Rack versions. This change introduces support for Rack v3+ middleware patterns, specifically handling the shift where \Rack::Builder\#run\ accepts a block instead of arguments. The new implementation also includes deferred dependency detection to ensure all libraries are loaded before instrumentation hooks are applied, and adds version checks to ensure compatibility with Rack 1.1.0+ and Puma 3.9.0+.

_lib/new\relic/agent/instrumentation/rack · high confidence

Rails instrumentation now uses ActiveSupport::Notifications for Action Cable, Action Controller, Action View, and custom events

The Rails agent has replaced its previous instrumentation approach with a new, event-based system using ActiveSupport::Notifications. This change introduces dedicated subscribers for Action Cable (monitoring perform\_action, transmit, and broadcast events, available in Rails 5+), Action Controller (tracking process\_action and fragment/cache operations like read\_fragment, write\_fragment, and send\_stream, available in Rails 4+), Action View (tracking render events, available in Rails 4+), and custom ActiveSupport events (subscribing to user-defined event names via the active\_support\_custom\_events\_names config). This provides more granular and reliable visibility into Rails request lifecycles and custom application events.

_lib/new\_relic/agent/instrumentation/rails\notifications · high confidence

Rake instrumentation now uses method prepending

The New Relic Ruby agent has refactored its Rake task instrumentation to use Ruby's \prepend\ mechanism instead of aliasing. This change modifies how the agent hooks into \Rake::Task\#invoke\ and \\#execute\, ensuring that the original methods are called via \super\ rather than through aliased methods. This approach improves compatibility with other gems that may also instrument Rake tasks, reducing the risk of method resolution conflicts or broken call chains.

_lib/new\relic/agent/instrumentation/rake · high confidence

Re-architected framework detection into modular control classes

The agent's framework detection logic has been restructured from a monolithic implementation into distinct, modular classes under \NewRelic::Control::Frameworks\. New files define specific control classes for Ruby, Rails (with inheritance chains for Rails 3, 4, and Notifications), Sinatra, Padrino, Grape, Roda, and an External context. This change introduces framework-specific initialization, environment resolution, and instrumentation shimming (e.g., including \ControllerInstrumentation::Shim\ into \Sinatra::Base\ or \Roda\), while also adding support for previously uninstrumented frameworks like Grape and Roda.

_lib/new\relic/control/frameworks · high confidence

Redis instrumentation refactored to support Redis gem v5 and clustering

The Redis instrumentation has been restructured to support both the legacy Redis gem (v3–v4) and the newer Redis gem v5+ (which uses redis-client). This change introduces a modular instrumentation layer that uses prepending for standard Redis clients, middleware for redis-client-based connections, and a dedicated cluster middleware to ensure Redis Cluster environments are monitored. Users benefit from consistent APM visibility across different Redis client versions and cluster setups, with improved error capturing and configuration handling.

_lib/new\relic/agent/instrumentation/redis · high confidence

Refactor HTTP client instrumentation to use a unified wrapper architecture

The agent's HTTP client instrumentation has been restructured to use a new \AbstractRequest\ and \AbstractResponse\ base class, with specific wrapper implementations for Typhoeus, Curb, Ethon, Excon, http.rb, HTTPClient, AsyncHTTP, Net::HTTP, and HTTPX. This change standardizes how external request data (such as hostnames, headers, status codes, and URIs) is extracted and normalized across different libraries, ensuring consistent external segment reporting and improving maintainability by centralizing URI parsing and header handling logic.

_lib/new\_relic/agent/http\clients · high confidence

Refactor core agent modules and introduce thread-local storage abstraction

The New Relic Ruby agent has been refactored to improve code organization and performance. Key changes include the introduction of a \ThreadLocalStorage\ module to abstract thread-local data access, allowing for flexible storage strategies (thread variables vs. thread hashes) via configuration. A new \Coerce\ module centralizes type conversion logic for metrics and parameters, ensuring data integrity before sending to the collector. Additionally, \MetricData\ and \MetricSpec\ classes have been updated to use this coercion logic, and \SupportabilityHelper\ now pre-instantiates API supportability metrics for better performance. The \Helper\ module also includes updated logic for Bundler compatibility.

_lib/new\relic · high confidence

Refactored Bunny instrumentation to use prepend and add messaging attributes

The Bunny instrumentation has been restructured to use Ruby's prepend mechanism instead of alias\_method, improving compatibility with other libraries that may monkey-patch the same classes. The instrumentation now wraps Bunny::Exchange\#publish, Bunny::Queue\#pop, and Bunny::Queue\#purge with tracing segments that record additional attributes such as server address, port, messaging destination name, and routing key. Consumer handling has also been updated to wrap message consumption in AMQP consume transactions with detailed delivery information.

_lib/new\relic/agent/instrumentation/bunny · high confidence

Refactored CLI command loading and execution logic

The CLI command infrastructure has been restructured to improve maintainability and namespace clarity. The core command dispatcher is now centralized in a new \lib/new\_relic/cli/command.rb\ file, which handles argument parsing, help display, and the dynamic loading of command subclasses from the \commands/\ directory. This change also includes renaming the executable from \bin/newrelic\ to \bin/newrelic\_rpm\ to better reflect its association with the RPM agent, and cleans up the loading mechanism for \Cli::Command\ subclasses to ensure they are registered correctly upon inheritance.

_lib/new\relic/cli · high confidence

Refactored Dalli instrumentation to support modern versions and instance tracking

The Memcache instrumentation for the Dalli gem has been rewritten to support Dalli 3.1.0 through 5.1.1, including specific handling for protocol changes (Binary vs. Meta) and method renames (e.g., \send\_multiget\ to \pipelined\_get\). This update introduces detailed instance tracking for datastore segments, allowing the agent to correctly identify the specific Memcached server (host and port) involved in operations like \get\_multi\ and \server\_for\_key\. The instrumentation now uses a prepend-based approach for cleaner method interception and ensures compatibility with keyword argument changes introduced in Dalli 5.1.0 and 5.1.1.

_lib/new\relic/agent/instrumentation/memcache · high confidence

Refactored Net::HTTP instrumentation to use module prepending

The Net::HTTP instrumentation mechanism has been updated to use Ruby's module prepending strategy instead of the previous class-eval aliasing approach. This change introduces a dedicated \Prepend\ module that wraps the \request\ method, ensuring that tracing logic is applied via \request\_with\_tracing\ before delegating to the original implementation. This architectural shift improves compatibility with modern Ruby patterns and ensures that the instrumentation correctly intercepts HTTP requests for external request segment creation, header processing, and OpenAI-specific response header population without interfering with the underlying \Net::HTTP\ class structure.

_lib/new\_relic/agent/instrumentation/net\http · high confidence

Refactored RUM middleware into dedicated AgentMiddleware base class

The Real User Monitoring (RUM) browser monitoring logic has been restructured to improve code organization and safety. The previous \TransactionReset\ module has been renamed to \AgentMiddleware\, providing a shared base class that handles transaction naming and includes the \MiddlewareTracing\ module. The \BrowserMonitoring\ middleware now inherits from this new base class, centralizing common instrumentation logic. Additionally, a new \AgentHooks\ middleware was introduced to handle cases where middleware instrumentation is disabled, ensuring the agent can still capture necessary data by manually tracing calls.

_lib/new\relic/rack · high confidence

Refactored SQL obfuscation and explain plan handling for multiple database dialects

The database agent now supports SQL obfuscation and explain plan processing for Oracle, Cassandra, and SQLite in addition to existing MySQL and PostgreSQL support. This change introduces dialect-specific regex patterns to correctly handle unique syntax features (such as Oracle's quoted strings and Cassandra's UUIDs) and improves reliability by adding fallback handling for malformed SQL queries. Additionally, explain plan results are now properly obfuscated for PostgreSQL to prevent sensitive data leakage, and the system prevents explaining multi-query SQL expressions to avoid executing unwanted SQL.

_lib/new\relic/agent/database · high confidence

Refactored SegmentTermsRule into a dedicated class with improved validation and performance

The SegmentTermsRule logic has been extracted from the RulesEngine into its own file, introducing stricter validation that requires prefixes to have exactly two segments and ensuring prefix matches occur on complete segment boundaries. This change also optimizes execution by reducing allocations, collapsing adjacent placeholder segments to prevent redundancy, and stashing results to improve performance, while ensuring that invalid segment terms rules do not clobber valid ones.

_lib/new\_relic/agent/rules\engine · high confidence

Refactored VM metrics collection with monotonic GC timing and CRuby/JRuby separation

The VM metrics subsystem has been restructured to improve accuracy and compatibility. A new MonotonicGCProfiler ensures that GC total time is measured as a steadily increasing value without double-counting, addressing previous issues with GC::Profiler resets. The previous generic VM class has been removed and replaced with specific implementations: CRubyVM now gathers detailed GC stats (runs, counts, heap usage) and RubyVM-specific metrics (method/constant cache invalidations) with version-aware gating for Ruby 3.2+, while JRubyVM provides a simplified snapshot focusing on GC runs and thread count. Both implementations use a shared Snapshot class to record metrics, and the codebase now relies on Process.clock\_gettime for timestamps and NewRelic::Helper.version\_satisfied? for version checks.

_lib/new\relic/agent/vm · high confidence

Refactored agent command routing and thread profiling architecture

The agent's command handling and profiling logic has been restructured to improve modularity and reliability. A new AgentCommandRouter now centralizes the dispatching of agent commands, replacing previous ad-hoc handling with a clear handler map that supports start/stop commands for both the thread profiler and continuous profiling. The ThreadProfilerSession has been extracted into its own class, managing the lifecycle of thread profiling sessions (start, stop, harvest) and integrating with the BacktraceService via a subscription model rather than direct method calls. This change ensures that thread profiling respects the 'thread\_profiler.enabled' configuration and properly handles unsupported environments (like Resque) by raising specific errors. Additionally, the AgentCommand class was introduced to encapsulate raw collector commands, providing a cleaner interface for command processing.

_lib/new\relic/agent/commands · high confidence

Refactored collector data marshalling and encoding into modular components

The New Relic agent's collector communication layer has been restructured to improve maintainability and support new configuration options. Data marshalling is now handled by a new \JsonMarshaller\ class that explicitly warns users about incompatible versions of the \yajl-ruby\ gem (specifically versions older than 1.2.1) to prevent thread profiling segfaults. Encoding logic has been extracted into a dedicated \Encoders\ module, introducing support for a \simple\_compression\ configuration option that allows users to bypass gzip/deflate compression in favor of identity encoding, which can reduce CPU overhead. Additionally, the system now respects a \normalize\_json\_string\_encodings\ setting to control whether string encodings are normalized before JSON serialization, and the base64 dependency has been removed in favor of a custom internal implementation.

_lib/new\_relic/agent/new\_relic\service · high confidence

Refactored datastore metrics and added Redis argument recording

The agent now uses a centralized \MetricHelper\ to generate structured datastore metrics (statement, operation, instance, and rollup) for all database integrations, replacing the previous metric naming logic. Additionally, Redis instrumentation has been enhanced to record command arguments in transaction traces, with support for truncating long arguments and handling binary data, while MongoDB monitoring is now gated to supported versions (2.1.0+) to ensure compatibility.

_lib/new\relic/agent/datastores · high confidence

Refactored distributed tracing and synthetics monitoring into dedicated monitor classes

The agent's handling of incoming distributed tracing and synthetics headers has been restructured into new, dedicated monitor classes (\DistributedTracing::Monitor\, \SyntheticsMonitor\) that inherit from a shared \InboundRequestMonitor\ base. This change consolidates previously scattered logic, ensuring that distributed tracing acceptance is strictly gated by the \distributed\_tracing.enabled\ configuration flag and that synthetics payload validation (version, length, trust) is centralized. It also standardizes JSON deserialization across both monitors to use \JSON.parse\ instead of the deprecated \JSON.load\, improving security and consistency in how inbound request headers are processed.

_lib/new\relic/agent/monitors · high confidence

Refactored distributed tracing into modular components with W3C TraceContext support

The distributed tracing logic has been reorganized into dedicated modules (DistributedTraceAttributes, DistributedTraceMetrics, DistributedTracePayload, DistributedTraceTransportType, TraceContext, and TraceContextPayload) to improve code clarity and maintainability. This change introduces support for W3C TraceContext headers (traceparent/tracestate) alongside New Relic's proprietary headers, allowing the agent to parse and insert both formats. It also adds new distributed trace metrics (DurationByCaller, TransportDuration, ErrorsByCaller) and ensures trace context payloads are correctly formatted, including handling invalid payloads and preventing scientific notation in priority values.

_lib/new\_relic/agent/distributed\tracing · high confidence

Refactored thread profiling into a subscription-based BacktraceService with isolated agent threads

The threading module has been restructured to improve thread safety and performance. A new \AgentThread\ class ensures that internal agent threads are created with tracing disabled, preventing them from interfering with application transaction state. The previous \ThreadProfilingService\ has been replaced by a \BacktraceService\ that operates on a subscription model, allowing it to start, stop, and adjust polling periods dynamically based on active transactions. Thread profiles are now aggregated into categorized buckets (agent, background, request, other) and supportability metrics have been added to track profiling overhead and node counts.

_lib/new\relic/agent/threading · high confidence

Resque instrumentation refactored to use prepend and support FORK\_PER\_JOB

The Resque instrumentation mechanism has been restructured to use Ruby's prepend feature instead of aliasing, improving compatibility and reducing side effects. This change introduces a new helper module to correctly evaluate the FORK\_PER\_JOB environment variable, ensuring that event loop stopping and pipe flushing occur only when appropriate. Additionally, the instrumentation now records supportability metrics for gem method invocations and sets the span kind to CONSUMER for better observability.

_lib/new\relic/agent/instrumentation/resque · high confidence

Sidekiq instrumentation refactored for v7.0+ with span kinds and attribute filtering

The Sidekiq instrumentation has been restructured into dedicated client and server middleware classes to support Sidekiq v7.0+. For users, this introduces span.kind=consumer for Sidekiq jobs, enabling better visibility into background task execution in distributed traces. The server middleware now supports the new sidekiq.separate\_transactions configuration to isolate job transactions from web transactions, and implements attribute pre-filtering for sidekiq.args to control which job arguments are recorded. Additionally, error reporting is suppressed when sidekiq.ignore\_retry\_errors is enabled, and distributed trace headers are only processed when present.

_lib/new\relic/agent/instrumentation/sidekiq · high confidence

Sinatra instrumentation refactored to support ignore settings and improved transaction naming

The Sinatra instrumentation has been restructured into modular components (chain, prepend, ignorer, transaction\_namer) to enhance reliability and feature support. Users can now explicitly ignore specific routes, Apdex calculations, or end-user timing data using the new \newrelic\_ignore\, \newrelic\_ignore\_apdex\, and \newrelic\_ignore\_enduser\ DSL methods. Transaction naming logic has been moved to a dedicated namer class, improving accuracy for both standard Sinatra routes and Padrino applications, while also including safeguards against ReDoS attacks by limiting route text length during processing.

_lib/new\relic/agent/instrumentation/sinatra · high confidence

Thread tracing now shares only the current transaction

The thread instrumentation has been refactored to limit the data shared with new threads to the current transaction context, rather than propagating the entire agent state. This change, implemented in the new \MonitoredThread\ module (replacing the previous \ThreadMonitor\), ensures that child threads inherit necessary tracing information without carrying over unrelated internal state, reducing potential side effects and memory overhead while maintaining visibility into thread execution.

_lib/new\relic/agent/instrumentation/thread · high confidence

Typhoeus instrumentation now uses prepend instead of aliasing

The New Relic Ruby agent has refactored its Typhoeus HTTP client instrumentation to use Ruby's prepend mechanism rather than the previous aliasing approach. This change modifies how the agent wraps the \Typhoeus::Hydra\#run\ method and individual requests, ensuring that the original implementation is preserved via \super\ calls. For users, this provides a more robust instrumentation layer that is less likely to conflict with other gems or future changes to the Typhoeus library, while maintaining the same external behavior of tracing requests and recording supportability metrics.

_lib/new\relic/agent/instrumentation/typhoeus · high confidence

gRPC instrumentation helper for method cleaning and host filtering

Added a helper module for the gRPC instrumentation that provides utilities to normalize RPC method names by stripping leading slashes and to filter out specific hosts based on a configurable denylist, ensuring that internal New Relic tracing endpoints are excluded from instrumentation.

_lib/new\relic/agent/instrumentation/grpc · high confidence

Fixes

Fix exception in Rails broadcast logger instrumentation

The New Relic agent now correctly instruments Rails broadcasted loggers without raising exceptions. The implementation ensures that when a log is broadcast, the agent records the event for the primary logger while temporarily skipping instrumentation on the broadcasted loggers to prevent recursive errors, then restores their instrumentation state afterward.

_lib/new\_relic/agent/instrumentation/active\_support\_broadcast\logger · high confidence

Test coverage

Add ActiveRecord multiverse test suite; Add ActiveRecord test suite configuration files; Add HTTPClient instrumentation tests; Add JSON serialization test suite; Add Rails 4.1 test environment configuration; Add Rails 8.0 test environment scaffold; Add multiverse test suite for ActiveRecord with PostgreSQL; Add multiverse test suite for Padrino framework support; Add test infrastructure for Rails 4.2 and Rails 5.0 environments; Add test suite for Sidekiq Delay Extensions instrumentation; Added ActiveRecord database migration test fixtures; Added Perfverse performance testing infrastructure; Added PostgreSQL ActiveRecord migration tests; Added RUM insertion location test fixtures; Added Rails 3+ test application for multiverse suite; Added Rails 6.0 test environment configuration; Added Rails 7 test application for New Relic agent verification; Added Rails 7 test initializer with Bloodhound model for method tracing; Added Rails 7.1 test environment; Added Rails 7.1 test environment scaffold; Added Rails 8.0 performance test application configuration; Added Rails 8.1 edge test environment configuration; Added Rails edge test environment scaffolding; Added Rails environment configuration files for the performance test app; Added basic marshalling test suite; Added comprehensive test coverage for agent configuration sources and validation; Added datastore API cross-agent tests; Added functional tests for Puma instrumentation; Added integration tests for Infinite Tracing agent behavior and segment streaming; Added memcache instrumentation tests for Dalli and Memcached gems; Added minimal Rails 4.0 test environment; Added multiverse test scripts for agent startup, environment handling, and API safety; Added multiverse test suite examples for execution modes; Added multiverse test suite examples for gem isolation; Added multiverse test suite for Infinite Tracing; Added multiverse test suite for MongoDB instrumentation; Added multiverse test suite for Rack and Puma instrumentation; Added multiverse test suite for Sidekiq instrumentation; Added multiverse test suite for Unicorn integration; Added multiverse tests for ActiveMerchant integration; Added multiverse tests for Delayed Job instrumentation and sampling; Added multiverse tests for Ruby logging instrumentation; Added multiverse tests for Typhoeus HTTP client instrumentation; Added multiverse tests for Yajl JSON marshalling; Added multiverse tests for the http.rb gem; Added performance test suites for agent instrumentation and core components; Added test configuration and fixtures for unit testing; Added test configuration for the active\_record\_pg multiverse suite; Added test coverage for AWS SQS instrumentation; Added test coverage for DynamoDB instrumentation; Added test coverage for Infinite Tracing components; Added test coverage for Rails 7.0 environment setup; Added test coverage for Rails instrumentation subscribers and agent helpers; Added test coverage for agent monitors; Added test coverage for gRPC client and server instrumentation; Added test coverage for standalone method tracers; Added test coverage for utilization vendor classes; Added test environment for Rails 4.2.0.beta1; Added test environment setup for Rails 5.0; Added test harness for Rails prepend metrics; Added test helper modules for configuration scanning, Docker detection, and metrics; Added test helper script to configure New Relic agent version; Added test infrastructure files for the Rails performance app; Added test infrastructure for Infinite Tracing; Added test infrastructure for MongoDB server and replica set management; Added test infrastructure for Rails performance testing; Added test infrastructure for generating performance report graphs; Added test initializer for Rails 6.0 agent instrumentation; Added test initializers for Rails environments; Added test suite for Bunny RabbitMQ instrumentation; Added test suite for Excon HTTP client instrumentation; Added test suite for OpenTelemetry hybrid agent bridge; Added test suite for Sidekiq error handling when ignore\_retry\_errors is enabled; Added test suite for continuous profiling integration and proto isolation; Added test suite for high security mode enforcement; Added test suite for running tests without the agent; Added test suite for the Parallel gem instrumentation; Added test support utilities for Infinite Tracing; Added tests for ActiveSupport Logger broadcast behavior; Added tests for ActiveSupport::BroadcastLogger instrumentation; Added tests for CPU, Memory, and VM samplers; Added tests for HTTP client URI utility functions; Added tests for MongoDB event formatting and metric translation; Added tests for NewRelicService JSON marshaller configuration; Added tests for OpenSearch instrumentation; Added tests for Rails instrumentation subscribers; Added tests for Rails prepend supportability metrics; Added tests for Roda agent-disabled shim behavior; Added tests for Roda instrumentation and ignore configurations; Added tests for SQL and Postgres Explain plan obfuscation; Added tests for Sinatra agent-disabled shims; Added tests for Slack notification gem and notifier scripts; Added tests for Stripe instrumentation user data filtering and metric cardinality; Added tests for Tilt template instrumentation; Added tests for VM GC profiling and snapshotting; Added tests for ViewComponent instrumentation; Added tests for agent lifecycle, configuration, and data coercion; Added tests for connect request builder and response handler; Added tests for datastore metric helper, Redis command formatting, and NoSQL obfuscation; Added tests for deferred Sinatra instrumentation; Added tests for newrelic.yml config file loading logic; Added tests for schema generation, diffing, and version bumping logic; Added tests for the GitHub Actions release notes generation script; Added tests for the New Relic CLI install command; Added tests for the boot/strap bundler patcher; Added tests for thread and fiber instrumentation parent-child relationships and argument preservation; Added tests for trace\_execution\_scoped metric recording and timing; Added tests for version bump rake task; Added unit tests for GC profiling and StatsHash; Added unit tests for LLM event classes and feedback API; Added unit tests for New Relic Control module components; Added unit tests for New Relic Rack middleware components; Added unit tests for Rails browser monitoring installation; Added unit tests for Sinatra transaction naming logic; Added unit tests for agent command routing and thread profiling; Added unit tests for agent startup, connection, and worker thread logic; Added unit tests for continuous profiling session and sampler; Added unit tests for distributed tracing metrics, payloads, and W3C Trace Context parsing; Added unit tests for method tracer class methods; Added unit tests for the threading subsystem; Added unit tests for transaction tracing components; Expanded test coverage for New Relic Ruby agent internals; Introduce Ruby Agent performance testing framework; Introduce multiverse test infrastructure and timing reporting; Introduce standardized test infrastructure and helpers; New multiverse test suite for agent-only functionality; New performance test runner scripts for baseline and multi-commit testing; New test runner script and external server helper; Rails multiverse test suite updated for Rails 8.0 and Ruby 3.3; Refactored CI installation scripts for better environment control.

Dependencies

Introduce newrelic-infinite\_tracing gem and update test environment dependencies

The Ruby agent now includes a dedicated \newrelic-infinite\_tracing\ gem for tail-based distributed tracing, which depends on \newrelic\_rpm\, \grpc\ (\~\> 1.34), and \google-protobuf\ (\< 4.0). The main \newrelic\_rpm\ gem has been updated to require Ruby 2.6+ and declares \logger\ as a runtime dependency. Test environments have been refreshed to support Rails 7.0 through 8.1, with specific version constraints for \sqlite3\ (e.g., \< 2 for Rails 6.x, \>= 2.1 for Rails 8.x) and conditional inclusion of \base64\, \bigdecimal\, \mutex\_m\, and \ostruct\ for Ruby 3.4+.

(dependencies) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 47 → 50 (+3.6)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 63 → 63 (+0.0)
  • Architecture 89 → 88 (-1.2)
  • Maturity 35 → 45 (+9.8)
  • Readiness 46 → 46 (+0.0)
  • Security 68 → 59 (-9.3)

Resolved (11)

  • Change coupling: default_source.rb ↔ session.rb (lib/new_relic/agent/configuration/default_source.rb)
  • Duplicate intent: Both methods appear to perform the core logic of determining a schema version bump based on baseline and current schemas. BumpSchemaVersion.apply includes config_def_path and write (side effects), while SchemaDiff.bump seems to be a pure calculation or internal helper. However, the naming apply vs bump is inconsistent for similar operations, and the parameter overlap suggests SchemaDiff might be duplicating logic that BumpSchemaVersion should own, or vice versa.
  • Duplicate signature with different parameter names: The Segment type lists merge_untrusted_agent_attributes twice with different first parameter names (attributes vs agent_attributes). This indicates either a documentation error or an actual inconsistency in the API surface definition.
  • Duplicate signature with different parameter names: Transaction.set_default_transaction_name is listed twice with different first parameter names (partial_name vs name). This is a clear inconsistency in the API definition.
  • Duplicate signature with different parameter names: Transaction.set_overriding_transaction_name is listed twice with different first parameter names (partial_name vs name).
  • Inconsistent naming and parameter types: Agent.notice_error and Transaction.notice_error do the same thing (record an error). However, Transaction has two signatures listed: notice_error(e, options) and notice_error(error, options). This is likely a documentation artifact, but if real, it's a duplicate signature. More importantly, the Agent-level method delegates to the Transaction-level method, but the naming is consistent (notice_error). The real issue is the potential duplication of Transaction.notice_error with different parameter names for the first arg (e vs error), which suggests inconsistent internal refactoring or documentation errors.
  • Off-boarding risk: anonymized user #1
  • Off-boarding risk: anonymized user #2
  • Off-boarding risk: anonymized user #3
  • Orphaned file (lib/new_relic/agent/instrumentation/action_view_subscriber.rb)
  • Orphaned file (lib/new_relic/agent/instrumentation/middleware_tracing.rb)

New (7)

  • Documentation: no map of the repository's parts (README.md)
  • Further sole-owners (lower concentration)
  • Off-boarding risk: anonymized user #3
  • Off-boarding risk: anonymized user #1
  • Off-boarding risk: anonymized user #2
  • Orphaned file (lib/new_relic/agent/instrumentation/active_record_subscriber.rb)
  • Orphaned file (lib/new_relic/agent/instrumentation/ethon/instrumentation.rb)

Changes since last survey

  • 24 commits — 23 feature/other, 1 fixes

By area

  • lib/new_relic — 9 commits
  • (repo) — 8 commits
  • .github/workflows — 3 commits
  • (root) — 2 commits
  • test/multiverse — 2 commits

Notable commits

  • fix: fix rack 3 case issue
  • change: Add disable_view_partial_instrumentation configuration option
  • change: Add thank you note to contributor
  • change: Bump actions/download-artifact from 8.0.1 to 8.0.2
  • change: Bump actions/upload-artifact from 7.0.1 to 7.0.2
  • change: Bump ruby/setup-ruby from 1.327.0 to 1.335.0
  • change: Merge pull request #3709 from newrelic/update_release_note_generator
  • change: Merge pull request #3713 from newrelic/updates_aim_on_default
  • change: Merge pull request #3714 from newrelic/rack_3_changes
  • change: Merge pull request #3716 from andrewfader/view-partial-instrumentation-setting
  • change: Merge pull request #3717 from newrelic/update_changelog_view_partial
  • change: Merge pull request #3720 from newrelic/dependabot/github_actions/actions/download-artifact-8.0.2
  • change: Merge pull request #3721 from newrelic/dependabot/github_actions/ruby/setup-ruby-1.335.0
  • change: Merge pull request #3722 from newrelic/dependabot/github_actions/actions/upload-artifact-7.0.2
  • change: Update lib/new_relic/agent/configuration/default_source.rb
  • change: Update lib/new_relic/agent/instrumentation/action_view_subscriber.rb
  • change: changelog
  • change: cleanup
  • change: remove redundant check
  • change: update changelog
  • …and 4 more

Architecture

  • Unchanged — 0 containers · 1 contexts · 0 edges

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

newrelic/newrelic-ruby-agent was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 6 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 38a1e899685a23e6735f6d120df75f1bb33a0b66 — the exact code this score is about.
  • Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.2+preprod-5c4e66d9318b.