Importante
Major Version Update: This version of the Ruby agent is a SemVer MAJOR update and contains breaking changes. MAJOR versions may drop support for language runtimes that have reached End-of-Life according to the maintainer. Additionally, MAJOR versions may drop support for and remove certain instrumentation. For more details on these changes please see the migration guide here.
Importante
We recommend updating to the latest agent version as soon as it's available. If you can't upgrade to the latest version, update your agents to a version no more than 90 days old. Read more about keeping agents up to date.
See the New Relic Ruby agent EOL policy for information about agent releases and support dates.
v10.0.0
Breaking Change: Remove support for Ruby 2.4 and 2.5
Support for Ruby versions 2.4 and 2.5 has been removed. The new minimum required Ruby version is now 2.6. PR#3314
Breaking Change: Removal of Cross Application Tracing (CAT)
Previously, Cross Application Tracing (CAT) was deprecated in favor of Distributed Tracing. CAT functionality has now been removed. The configuration option
cross_application_tracer.enabledhas been removed. Public API methodsNewRelic::Agent::External.process_request_metadata,NewRelic::Agent::External.get_response_metadata,NewRelic::Agent::Transaction::ExternalRequestSegment#process_response_metadata,NewRelic::Agent::Transaction::ExternalRequestSegment#get_request_metadata, andNewRelic::Agent::Transaction::ExternalRequestSegment#read_response_headershave also been removed. PR#3333Breaking Change: Rename ActiveJob metrics and segments
ActiveJob metrics have been updated to include the job's class name for more specific reporting. This is a breaking change and may require updating custom dashboards or alerts. PR#3370 PR#3320
- Old format:
Ruby/ActiveJob/<QueueName>/<Method> - New format:
Ruby/ActiveJob/<QueueName>/<ClassName>/<Method>
In addition, segments created for Active Job enqueuing actions now include the job class.
- Old format:
ActiveJob/<QueueAdapter>/Queue/<Event>/Named/<QueueName> - New format:
ActiveJob/<QueueAdapter>/Queue/<Event>/Named/<QueueName>/<ClassName>
- Old format:
Breaking Change: Rename
bin/newreliccommand tobin/newrelic_rpmThe executable file for the agent's CLI has been renamed from
bin/newrelictobin/newrelic_rpm. This change resolves a name collision with the standalone New Relic CLI tool. PR#3323Breaking Change: Remove the
newrelic deploymentsCLI commandThe deprecated
newrelic deploymentsCLI command has been removed. To track changes and deployments in New Relic, please see our guide to Change Tracking for a list of available options. PR#3299Breaking Change: Remove the NewRelic::Agent::SqlSampler#notice_sql method
Users should call
NewRelic::Agent::Datastores.notice_sqlinstead. PR#3338Breaking Change: Remove unused arguments from various NewRelic::Agent::Datastores APIs
The following APIs from the
NewRelic::Agent::Datastoresclass have had method arguments removed:NewRelic::Agent::Datastores.notice_sql, previously had three positional arguments,query,scoped_metricandelapsed. Now, it only hasquery.NewRelic::Agent::Datastores.notice_statement, previously had two positional argumentsqueryandelapsed. Now it only hasquery.NewRelic::Agent::Datastores.wraprequires a proc. Previously the proc received three arguments: the result of the yield, the most specific scoped metric name, and the elapsed time of the call. Now, it only receives one: the result of the yield.
The values of the removed arguments are derived from the current segment at the time of the call. PR#3347
Breaking Change: Remove experimental feature Configurable Security Policies (CSP)
The experimental feature, Configurable Security Policies (CSP), is no longer supported and has been removed. PR#3292
Breaking Change: Remove support for Puma versions < 3.9.0
The minimum version of Puma now supported is 3.9.0 or higher. PR#3326
Breaking Change: Improve configuration validation and coercion
The internals used to coerce and validate the values provided for agent configuration are now more performant and more accurate.
- Warning messages will now be logged to the newrelic_agent.log file when nil is provided as a config value for a setting that does not support it.
- Integer values are permitted for Float configuration types
- Float values are permitted for Integer configuration types
- Fatal interruptions are prevented when a default value can be found to replace an invalid input value PR#3341
Breaking Change: Replace 'default' option with 'adaptive' for distributed tracing remote parent samplers
Previously, the default option for
distributed_tracing.sampler.remote_parent_sampledanddistributed_tracing.sampler.remote_parent_not_sampledwasdefault, which used the pre-existing adaptive sampler. Thedefaultoption has been renamed toadaptive. PR#3363Feature: Add
loggeras a dependencyThe
loggergem is now listed as a dependency of the agent to ensure continued logging functionality and support for Ruby 4.0.0 and newer versions. PR#3293Feature: Add Active Support notification allowlist configuration option
A new configuration option,
instrumentation.active_support_notifications.active_support_events, allows users to define an allowlist of Active Support notifications event names for the agent to subscribe to. By default, the agent subscribes to all Active Support: Caching and Active Support: Messages events. PR#3327Feature: Use Ruby's built-in Gzip compression
The agent now uses the built-in
Zlib.gzipmethod from the Ruby standard library for compression, replacing the previous custom implementation. PR#3332Feature: Add argument validation for the
NewRelic::Agent#record_custom_eventAPIThe
NewRelic::Agent#record_custom_eventAPI now raises anArgumentErrorwhen an invalidevent_typeis provided. A valid event type must consist only of alphanumeric characters, underscores (_), colons (:), or spaces (). PR#3319Feature: Add root sampling configuration options
You can now configure the sampling behavior for traces that originate within the current service using
distributed_tracing.sampler.root. PR#3330There are four modes available:
Mode Description adaptiveUses the existing adaptive sampler algorithm always_offMarks 0% of root traces as sampled always_onMarks 100% of root traces as sampled trace_id_ratio_basedSamples traces based on a ratio set in distributed_tracing.sampler.root.trace_id_ratio_based.ratio. The ratio must be float between 0.0 and 1.0Feature: Add Trace ID Ratio Based sampling options
The agent can now sample traces using the OpenTelemetry Trace ID Ratio Based sampler algorithm. PR#3330 This samples traces based on a probability between 0.0 and 1.0 based on the trace ID.
To use this option, you must first set your distributed tracing sampler configuration to
trace_id_ratio_basedand then set the correspondingdistributed_tracing.sampler.*.trace_id_ratio_based.ratiosampler to a Float between 0.0 and 1.0.For example:
distributed_tracing.sampler.remote_parent_sampled: 'trace_id_ratio_based'distributed_tracing.sampler.remote_parent_sampled.trace_id_ratio_based.ratio': 0.5This configuration would sample approximately 50% of your traces for all traces where the remote parent is sampled.
This option is available for:
distributed_tracing.sampler.rootdistributed_tracing.sampler.remote_parent_sampleddistributed_tracing.sampler.remote_parent_not_sampled
Feature: Add Entity GUID to Agent Control health check files
When the agent is started within an Agent Control environment, a health check file is created at the configured file location for every agent process. This file now includes the guid of the entity related to the agent when available. PR#3371
Bugfix: Resolve a
NoMethodErrorin GCP utilization detection.The GCP metadata discovery logic will now gracefully handle
nilor unexpected values, preventing service initialization crashes. PR#3388