newrelic_rpm 9.22.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: 002be7971239046fa416e4760bcf3032c7494fd74b5600eec63e0c1d9b8a1a6b
4
- data.tar.gz: 603a67f73b504580e3a5db28e046b914f4b957a50b9eaab29fe4aee87c92822b
3
+ metadata.gz: c3bc35eb6cc82a0dd1ba947b3270d18b515da940533c11362ff531cfbeb05575
4
+ data.tar.gz: afd55578e5580b8bfb50280259c007c8c6e039a3d2029d9b8be2a2b2b4ea289c
5
5
  SHA512:
6
- metadata.gz: 4fca3a0ad0b86891bdb6bf0c306d9ce55e4c6fc215e74fc943178d8ed5116ab781ea2d879e7b78918b73313e460c5e876e714ab47828f4315b8894c35845eae2
7
- data.tar.gz: 51a42bdb53145e747ebb91c6492e0710cc8d4a272929dd316e48deb5e8e0c70a185292d6185eeb531e776721dd05aef444131c8c3bb9e08988ad353a5c682a68
6
+ metadata.gz: 75bd39b66cf822e975b2e704360eea2bc3ac44fbd2f63ed38b069a7115ae1a502a29c149adca19f3d057fe1332f3e5122afcdec4f42aec9182195d432db1f206
7
+ data.tar.gz: 44a1abc2d6f0ce8c28ac20e0912b21a1081baa474e455c561c3f4ace6ade983d2fd1922174ef3922fc51d99f7a771b0d13756fc10f14c8a4f420b5cb84ec4a20
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
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
+
3
17
  ## v9.22.0
4
18
 
5
19
  - **Feature: One-step instrumentation for Kubernetes**
@@ -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
@@ -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
@@ -6,7 +6,7 @@
6
6
  module NewRelic
7
7
  module VERSION # :nodoc:
8
8
  MAJOR = 9
9
- MINOR = 22
9
+ MINOR = 23
10
10
  TINY = 0
11
11
 
12
12
  STRING = "#{MAJOR}.#{MINOR}.#{TINY}"
data/newrelic.yml CHANGED
@@ -791,6 +791,10 @@ common: &default_settings
791
791
  # will be included.
792
792
  # sidekiq.args.include: []
793
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
+
794
798
  # If true, the agent collects slow SQL queries.
795
799
  # slow_sql.enabled: true
796
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.22.0
4
+ version: 9.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tanna McClure