newrelic_rpm 9.21.0 → 9.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 28a51810c279118b462ee016c67fd8d62cde2bf457bfc2ca33e687712a3b3514
4
- data.tar.gz: c9b530fcf6ea3c2775c1100dfa112ba1d356c8a18a2b18535be1184ebcbc7805
3
+ metadata.gz: c3bc35eb6cc82a0dd1ba947b3270d18b515da940533c11362ff531cfbeb05575
4
+ data.tar.gz: afd55578e5580b8bfb50280259c007c8c6e039a3d2029d9b8be2a2b2b4ea289c
5
5
  SHA512:
6
- metadata.gz: 299297fc139e0ed8475254cfd73d1d43cea58743fcc89c6e9a02c31a59a44545062c47da422c1126306ac55a9d93a3dc028d9a235739c3d1d8cb642df5f0fc18
7
- data.tar.gz: c41fdc820bcc54b2fd2a61777b979319af9aeabf77c4b9721a2f385bfd4cef62277d84030b281a38ab8e02684f88603e76a45be6cad64324517f310e6ba1d877
6
+ metadata.gz: 75bd39b66cf822e975b2e704360eea2bc3ac44fbd2f63ed38b069a7115ae1a502a29c149adca19f3d057fe1332f3e5122afcdec4f42aec9182195d432db1f206
7
+ data.tar.gz: 44a1abc2d6f0ce8c28ac20e0912b21a1081baa474e455c561c3f4ace6ade983d2fd1922174ef3922fc51d99f7a771b0d13756fc10f14c8a4f420b5cb84ec4a20
data/CHANGELOG.md CHANGED
@@ -1,5 +1,43 @@
1
1
  # New Relic Ruby Agent Release Notes
2
2
 
3
+ ## v9.23.0
4
+
5
+ - **Feature: Add sidekiq.ignore_retry_errors configuration option**
6
+
7
+ A new configuration option, `sidekiq.ignore_retry_errors`, has been added to control if Sidekiq job retries are captured. Retry errors are captured by default, but now if `sidekiq.ignore_retry_errors` is set to `true`, the agent will ignore exceptions raised during Sidekiq's retry attempts and will only report the error if the job permanently fails. Thank you [DonGiulio](https://github.com/DonGiulio) for recognizing this improvement and contributing a solution. [PR#3317](https://github.com/newrelic/newrelic-ruby-agent/pull/3317)
8
+
9
+ - **Feature: Deprecation notice for recording deployments using Capistrano**
10
+
11
+ Sending application deployment information using a Capistrano recipe is deprecated and will be removed in agent version 10.0.0. For recording deployments, please see our guide to [Change Tracking](https://docs.newrelic.com/docs/change-tracking/change-tracking-introduction/) for a list of available options.
12
+
13
+ - **Feature: Use remote parent sampling configurations for decisions in more scenarios**
14
+
15
+ Previously, the `distributed_tracing.sampler.remote_parent_sampled` and `distributed_tracing.sampler.remote_parent_not_sampled` configuration options were used for the sampling decision only when the `traceparent` and `tracestate` headers were present. Now, these configuration options are applied in cases when the `tracestate` header is missing and when only the `newrelic` header is available. This change makes distributed trace sampling more consistent and predictable. [PR#3306](https://github.com/newrelic/newrelic-ruby-agent/pull/3306)
16
+
17
+ ## v9.22.0
18
+
19
+ - **Feature: One-step instrumentation for Kubernetes**
20
+
21
+ The Kubernetes APM auto-attach automatically instruments applications and manages agent upgrades within Kubernetes deployments. This feature has exited preview and is now generally avaliable. Learn more about [Kubernetes auto-attach](https://docs.newrelic.com/docs/kubernetes-pixie/kubernetes-integration/installation/k8s-agent-operator/). [PR#2635](https://github.com/newrelic/newrelic-ruby-agent/pull/2635) [PR#3287](https://github.com/newrelic/newrelic-ruby-agent/pull/3287)
22
+
23
+ - **Feature: Deprecation notice for Ruby 2.4 and Ruby 2.5**
24
+
25
+ Ruby agent support for Ruby versions 2.4 and 2.5 is deprecated and will be removed in agent version 10.0.0. The new miniumum required Ruby version will become Ruby 2.6 and we will stop testing with Ruby 2.4 and 2.5. [PR#3288](https://github.com/newrelic/newrelic-ruby-agent/pull/3288)
26
+
27
+ - **Feature: Deprecation notice for the `newrelic deployments` command**
28
+
29
+ Support for recording deployments using the `newrelic deployments` command is now deprecated and will be removed in agent version 10.0.0.
30
+
31
+ Going forward, there are a number of automated and manual ways ways to record changes in New Relic. Please see our guide to [Change Tracking](https://docs.newrelic.com/docs/change-tracking/change-tracking-introduction/) for a list of available options. [PR#3262](https://github.com/newrelic/newrelic-ruby-agent/pull/3262)
32
+
33
+ - **Feature: Deprecation reminder for cross application tracing**
34
+
35
+ Cross application tracing has been deprecated since major version 8.0.0 of the Ruby agent. We will remove support for it entirely in version 10.0.0 of the agent. [PR#3288](https://github.com/newrelic/newrelic-ruby-agent/pull/3288)
36
+
37
+ - **Feature: Ensure compatibility with Ruby 3.5 change to Method#source_location**
38
+
39
+ Updated the agent to correctly parse the return value of Method#source_location, which is changing in Ruby 3.5 from a two-element to a five-element array. This change maintains support for older Ruby versions while adding support for the future release. [PR#3257](https://github.com/newrelic/newrelic-ruby-agent/pull/3257)
40
+
3
41
  ## v9.21.0
4
42
 
5
43
  - **Feature: In Serverless APM mode, use event source name as transaction name prefix**
data/lib/boot/strap.rb CHANGED
@@ -5,8 +5,6 @@
5
5
  # This file is designed to bootstrap a `Bundler.require`-based Ruby app (such as
6
6
  # a Ruby on Rails app) so the app can be instrumented and observed by the
7
7
  # New Relic Ruby agent without the agent being added to the app as a dependency.
8
- # NOTE: introducing the agent into your application via bootstrap is in beta.
9
- # Use at your own risk.
10
8
  #
11
9
  # Given a production-ready Ruby app that optionally has a pre-packaged "frozen"
12
10
  # or "deployment"–gem bundle, the New Relic Ruby agent can be introduced
@@ -428,7 +428,7 @@ module NewRelic
428
428
  :type => String,
429
429
  :allowed_from_server => false,
430
430
  :exclude_from_reported_settings => true,
431
- :description => 'Your New Relic <InlinePopover type="userKey" />. Required when using the New Relic REST API v2 to record deployments using the `newrelic deployments` command.'
431
+ :description => '# DEPRECATED: The `api_key` config setting is now deprecated. Its only use was for the `newrelic deployments` command, which is being removed in agent version 10.0.0.'
432
432
  },
433
433
  :backport_fast_active_record_connection_lookup => {
434
434
  :default => false,
@@ -2140,6 +2140,13 @@ module NewRelic
2140
2140
  argument array elements and job argument scalars will be excluded.
2141
2141
  SIDEKIQ_ARGS_EXCLUDE
2142
2142
  },
2143
+ :'sidekiq.ignore_retry_errors' => {
2144
+ :default => false,
2145
+ :public => true,
2146
+ :type => Boolean,
2147
+ :allowed_from_server => false,
2148
+ :description => %Q(If `true`, the agent will ignore exceptions raised during Sidekiq's retry attempts and will only report the error if the job permanently fails.)
2149
+ },
2143
2150
  # Slow SQL
2144
2151
  :'slow_sql.enabled' => {
2145
2152
  :default => value_of(:'transaction_tracer.enabled'),
@@ -2510,7 +2517,7 @@ module NewRelic
2510
2517
  :description => 'Number of seconds betwixt connections to the New Relic span event collection services.'
2511
2518
  },
2512
2519
  # TODO: Sync with the other agents to see what the config should be named, how it should be enabled, how it should be described
2513
- :'opentelemetry_bridge.enabled' => {
2520
+ :'opentelemetry.enabled' => {
2514
2521
  :default => false,
2515
2522
  :public => false,
2516
2523
  :type => Boolean,
@@ -96,6 +96,16 @@ module NewRelic
96
96
  @timestamp = timestamp
97
97
  end
98
98
 
99
+ # This is an invalid instance of the TraceContextPayload that is used to
100
+ # help us determine the sampling decision for an incoming trace when the
101
+ # tracestate header is missing. Creating an invalid instance allows us
102
+ # to call methods like .sampled on it without throwing errors.
103
+ # The timestamp value will represent the time it was created/when this
104
+ # class was initialized.
105
+ #
106
+ # @api private
107
+ INVALID = create
108
+
99
109
  def parent_type
100
110
  @parent_type_string ||= PARENT_TYPES[@parent_type_id]
101
111
  end
@@ -40,13 +40,19 @@ DependencyDetection.defer do
40
40
  end
41
41
  end
42
42
 
43
- if config.respond_to?(:error_handlers)
43
+ if config.respond_to?(:error_handlers) && !NewRelic::Agent.config[:'sidekiq.ignore_retry_errors']
44
44
  # Sidekiq 3.0.0 - 7.1.4 expect error_handlers to have 2 arguments
45
45
  # Sidekiq 7.1.5+ expect error_handlers to have 3 arguments
46
46
  config.error_handlers << proc do |error, _ctx, *_|
47
47
  NewRelic::Agent.notice_error(error)
48
48
  end
49
49
  end
50
+
51
+ if config.respond_to?(:death_handlers) && NewRelic::Agent.config[:'sidekiq.ignore_retry_errors']
52
+ config.death_handlers << proc do |_, error|
53
+ NewRelic::Agent.notice_error(error)
54
+ end
55
+ end
50
56
  end
51
57
  end
52
58
  end
@@ -50,8 +50,8 @@ module NewRelic
50
50
  return ::NewRelic::EMPTY_HASH if info.empty?
51
51
 
52
52
  namespace, location, is_class_method = info
53
- @code_information[cache_key] = {filepath: location.first,
54
- lineno: location.last,
53
+ @code_information[cache_key] = {filepath: location[0],
54
+ lineno: location[1],
55
55
  function: "#{'self.' if is_class_method}#{method_name}",
56
56
  namespace: namespace}.freeze
57
57
  rescue StandardError => e
@@ -8,7 +8,7 @@ module NewRelic
8
8
  def initialize
9
9
  # no-op without OpenTelemetry API & config
10
10
  return unless defined?(OpenTelemetry) &&
11
- NewRelic::Agent.config[:'opentelemetry_bridge.enabled']
11
+ NewRelic::Agent.config[:'opentelemetry.enabled']
12
12
 
13
13
  OpenTelemetryBridge.install
14
14
  end
@@ -161,6 +161,25 @@ module NewRelic
161
161
  transaction.parent_span_id = payload.id
162
162
 
163
163
  unless payload.sampled.nil?
164
+ if payload.sampled == true
165
+ set_priority_and_sampled_newrelic_header(NewRelic::Agent.config[:'distributed_tracing.sampler.remote_parent_sampled'], payload)
166
+ elsif payload.sampled == false
167
+ set_priority_and_sampled_newrelic_header(NewRelic::Agent.config[:'distributed_tracing.sampler.remote_parent_not_sampled'], payload)
168
+ else
169
+ transaction.sampled = payload.sampled
170
+ transaction.priority = payload.priority if payload.priority
171
+ end
172
+ end
173
+ end
174
+
175
+ def set_priority_and_sampled_newrelic_header(config, payload)
176
+ if config == 'always_on'
177
+ transaction.sampled = true
178
+ transaction.priority = 2.0
179
+ elsif config == 'always_off'
180
+ transaction.sampled = false
181
+ transaction.priority = 0
182
+ else # case for 'default' value
164
183
  transaction.sampled = payload.sampled
165
184
  transaction.priority = payload.priority if payload.priority
166
185
  end
@@ -132,11 +132,17 @@ module NewRelic
132
132
  transaction.trace_id = header_data.trace_id
133
133
  transaction.parent_span_id = header_data.parent_id
134
134
 
135
- return false unless payload = assign_trace_state_payload
135
+ trace_flags = header_data.trace_parent['trace_flags']
136
+ payload = assign_trace_state_payload
136
137
 
137
- transaction.distributed_tracer.parent_transaction_id = payload.transaction_id
138
+ if payload
139
+ determine_sampling_decision(payload, trace_flags)
140
+ else
141
+ determine_sampling_decision(TraceContextPayload::INVALID, trace_flags)
142
+ return false
143
+ end
138
144
 
139
- determine_sampling_decision(payload, header_data.trace_parent['trace_flags'])
145
+ transaction.distributed_tracer.parent_transaction_id = payload.transaction_id
140
146
 
141
147
  NewRelic::Agent.increment_metric(ACCEPT_SUCCESS_METRIC)
142
148
  true
@@ -15,6 +15,19 @@ require 'new_relic/agent/hostname'
15
15
  require 'new_relic/control' unless defined? NewRelic::Control
16
16
 
17
17
  class NewRelic::Cli::Deployments < NewRelic::Cli::Command
18
+ # DEPRECATION NOTICE (Effective September 2025)
19
+ #
20
+ # The entire `NewRelic::Cli::Deployments` class and its associated
21
+ # `newrelic deployments` command are deprecated and will be removed in
22
+ # agent version 10.0.0.
23
+ #
24
+ # Users should migrate to recording deployments directly via New Relic's
25
+ # APIs. For more information, please see the official Change Tracking
26
+ # documentation: https://docs.newrelic.com/docs/change-tracking/change-tracking-introduction/
27
+ #
28
+ # @api public
29
+ #
30
+
18
31
  attr_reader :control
19
32
  def self.command; 'deployments'; end
20
33
 
@@ -64,6 +77,12 @@ class NewRelic::Cli::Deployments < NewRelic::Cli::Command
64
77
  # Run the Deployment upload in New Relic via Active Resource.
65
78
  # Will possibly print errors and exit the VM
66
79
  def run
80
+ msg = <<~TEXT
81
+ DEPRECATED: The `newrelic deployments` command will be removed in v10.0.0. Learn more about the alternate options: https://docs.newrelic.com/docs/change-tracking/change-tracking-introduction/
82
+ TEXT
83
+ NewRelic::Agent.logger.log_once(:warn, 'newrelic_deployments'.to_sym, msg)
84
+ warn msg
85
+
67
86
  begin
68
87
  @description = nil if @description && @description.strip.empty?
69
88
 
@@ -6,7 +6,7 @@
6
6
  module NewRelic
7
7
  module VERSION # :nodoc:
8
8
  MAJOR = 9
9
- MINOR = 21
9
+ MINOR = 23
10
10
  TINY = 0
11
11
 
12
12
  STRING = "#{MAJOR}.#{MINOR}.#{TINY}"
data/newrelic.yml CHANGED
@@ -52,8 +52,9 @@ common: &default_settings
52
52
  # If true, enables capture of all HTTP request headers for all destinations.
53
53
  # allow_all_headers: false
54
54
 
55
- # Your New Relic userKey. Required when using the New Relic REST API v2 to
56
- # record deployments using the newrelic deployments command.
55
+ # # DEPRECATED: The api_key config setting is now deprecated. Its only use was
56
+ # for the newrelic deployments command, which is being removed in agent version
57
+ # 10.0.0.
57
58
  # api_key: ""
58
59
 
59
60
  # If true, enables log decoration and the collection of log events and metrics.
@@ -790,6 +791,10 @@ common: &default_settings
790
791
  # will be included.
791
792
  # sidekiq.args.include: []
792
793
 
794
+ # If true, the agent will ignore exceptions raised during Sidekiq's retry
795
+ # attempts and will only report the error if the job permanently fails.
796
+ # sidekiq.ignore_retry_errors: false
797
+
793
798
  # If true, the agent collects slow SQL queries.
794
799
  # slow_sql.enabled: true
795
800
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newrelic_rpm
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.21.0
4
+ version: 9.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tanna McClure