newrelic_rpm 9.1.0 → 9.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -65
  3. data/.simplecov +1 -0
  4. data/Brewfile +1 -0
  5. data/CHANGELOG.md +33 -0
  6. data/Guardfile +1 -0
  7. data/bin/newrelic +1 -0
  8. data/bin/newrelic_cmd +1 -0
  9. data/lib/new_relic/agent/configuration/default_source.rb +69 -82
  10. data/lib/new_relic/agent/configuration/manager.rb +13 -0
  11. data/lib/new_relic/agent/error_collector.rb +1 -1
  12. data/lib/new_relic/agent/instrumentation/active_merchant.rb +3 -3
  13. data/lib/new_relic/agent/instrumentation/bunny/chain.rb +1 -1
  14. data/lib/new_relic/agent/instrumentation/bunny.rb +1 -1
  15. data/lib/new_relic/agent/instrumentation/delayed_job/chain.rb +1 -0
  16. data/lib/new_relic/agent/instrumentation/elasticsearch/chain.rb +1 -1
  17. data/lib/new_relic/agent/instrumentation/elasticsearch/instrumentation.rb +1 -0
  18. data/lib/new_relic/agent/instrumentation/elasticsearch.rb +1 -1
  19. data/lib/new_relic/agent/instrumentation/fiber/chain.rb +1 -1
  20. data/lib/new_relic/agent/instrumentation/fiber.rb +1 -1
  21. data/lib/new_relic/agent/instrumentation/grpc/client/chain.rb +1 -1
  22. data/lib/new_relic/agent/instrumentation/grpc/client/instrumentation.rb +1 -1
  23. data/lib/new_relic/agent/instrumentation/grpc/client/prepend.rb +1 -1
  24. data/lib/new_relic/agent/instrumentation/grpc/client/request_wrapper.rb +1 -1
  25. data/lib/new_relic/agent/instrumentation/grpc/server/instrumentation.rb +1 -1
  26. data/lib/new_relic/agent/instrumentation/grpc_client.rb +1 -1
  27. data/lib/new_relic/agent/instrumentation/grpc_server.rb +1 -1
  28. data/lib/new_relic/agent/instrumentation/memcache/dalli.rb +3 -1
  29. data/lib/new_relic/agent/instrumentation/memcache/prepend.rb +3 -1
  30. data/lib/new_relic/agent/instrumentation/memcache.rb +2 -2
  31. data/lib/new_relic/agent/instrumentation/mongodb_command_subscriber.rb +1 -1
  32. data/lib/new_relic/agent/instrumentation/sidekiq.rb +1 -0
  33. data/lib/new_relic/agent/method_tracer.rb +1 -1
  34. data/lib/new_relic/agent/new_relic_service.rb +0 -1
  35. data/lib/new_relic/agent/sampler.rb +1 -0
  36. data/lib/new_relic/agent/tracer.rb +1 -1
  37. data/lib/new_relic/agent/transaction/abstract_segment.rb +45 -39
  38. data/lib/new_relic/agent/transaction/distributed_tracing.rb +7 -8
  39. data/lib/new_relic/agent/transaction/tracing.rb +6 -0
  40. data/lib/new_relic/agent/transaction.rb +4 -0
  41. data/lib/new_relic/control/instrumentation.rb +0 -14
  42. data/lib/new_relic/dependency_detection.rb +10 -1
  43. data/lib/new_relic/version.rb +2 -2
  44. data/lib/tasks/coverage_report.rake +1 -1
  45. data/lib/tasks/instrumentation_generator/instrumentation.thor +8 -8
  46. data/lib/tasks/instrumentation_generator/templates/chain.tt +1 -1
  47. data/lib/tasks/instrumentation_generator/templates/dependency_detection.tt +1 -1
  48. data/lib/tasks/multiverse.rb +1 -0
  49. data/lib/tasks/newrelic.rb +1 -0
  50. data/newrelic.yml +5 -5
  51. metadata +73 -4
  52. data/lib/new_relic/agent/range_extensions.rb +0 -27
@@ -1,6 +1,6 @@
1
- # frozen_string_literal: true
2
1
  # This file is distributed under New Relic's license terms.
3
2
  # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
3
+ # frozen_string_literal: true
4
4
 
5
5
  require_relative 'request_wrapper'
6
6
  require_relative '../helper'
@@ -1,6 +1,6 @@
1
- # frozen_string_literal: true
2
1
  # This file is distributed under New Relic's license terms.
3
2
  # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
3
+ # frozen_string_literal: true
4
4
 
5
5
  require_relative 'instrumentation'
6
6
 
@@ -1,6 +1,6 @@
1
- # frozen_string_literal: true
2
1
  # This file is distributed under New Relic's license terms.
3
2
  # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
3
+ # frozen_string_literal: true
4
4
 
5
5
  module NewRelic
6
6
  module Agent
@@ -1,6 +1,6 @@
1
- # frozen_string_literal: true
2
1
  # This file is distributed under New Relic's license terms.
3
2
  # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
3
+ # frozen_string_literal: true
4
4
 
5
5
  require_relative '../helper'
6
6
 
@@ -1,6 +1,6 @@
1
- # frozen_string_literal: true
2
1
  # This file is distributed under New Relic's license terms.
3
2
  # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
3
+ # frozen_string_literal: true
4
4
 
5
5
  require_relative 'grpc/client/chain'
6
6
  require_relative 'grpc/client/prepend'
@@ -1,6 +1,6 @@
1
- # frozen_string_literal: true
2
1
  # This file is distributed under New Relic's license terms.
3
2
  # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
3
+ # frozen_string_literal: true
4
4
 
5
5
  require_relative 'grpc/server/chain'
6
6
  require_relative 'grpc/server/rpc_server_prepend'
@@ -58,7 +58,9 @@ module NewRelic
58
58
  end.class_eval do
59
59
  include NewRelic::Agent::Instrumentation::Memcache::Tracer
60
60
 
61
- # TODO: Dalli - 3.1.0 renamed send_multiget to pipelined_get, but the method is otherwise the same
61
+ # TODO: MAJOR VERSION
62
+ # Dalli - 3.1.0 renamed send_multiget to pipelined_get, but the method is otherwise the same
63
+ # Once we no longer support Dalli < 3.1.0, remove this conditional logic
62
64
  if Gem::Version.new(::Dalli::VERSION) >= Gem::Version.new('3.1.0')
63
65
  alias_method(:pipelined_get_without_newrelic_trace, :pipelined_get)
64
66
  def pipelined_get(keys)
@@ -84,7 +84,9 @@ module NewRelic::Agent::Instrumentation
84
84
  extend Helper
85
85
  include NewRelic::Agent::Instrumentation::Memcache::Tracer
86
86
 
87
- # TODO: Dalli - 3.1.0 renamed send_multiget to pipelined_get, but the method is otherwise the same
87
+ # TODO: MAJOR VERSION
88
+ # Dalli - 3.1.0 renamed send_multiget to pipelined_get, but the method is otherwise the same
89
+ # Once we no longer support Dalli < 3.1.0, remove this conditional logic
88
90
  if Gem::Version.new(::Dalli::VERSION) >= Gem::Version.new('3.1.0')
89
91
  def pipelined_get(keys)
90
92
  send_multiget_with_newrelic_tracing(keys) { super }
@@ -58,7 +58,7 @@ DependencyDetection.defer do
58
58
  prepend_instrument client_class, instrumenting_module, 'MemcachedDalli'
59
59
  end
60
60
  else
61
- chain_instrument NewRelic::Agent::Instrumentation::Memcache::Dalli
61
+ chain_instrument NewRelic::Agent::Instrumentation::Memcache::Dalli, 'MemcachedDalli'
62
62
  end
63
63
  end
64
64
  end
@@ -81,7 +81,7 @@ DependencyDetection.defer do
81
81
  prepend_instrument client_class, instrumenting_module, 'MemcachedDalliCAS'
82
82
  end
83
83
  else
84
- chain_instrument NewRelic::Agent::Instrumentation::Memcache::DalliCAS
84
+ chain_instrument NewRelic::Agent::Instrumentation::Memcache::DalliCAS, 'MemcachedDalliCAS'
85
85
  end
86
86
  end
87
87
  end
@@ -21,7 +21,7 @@ module NewRelic
21
21
  end
22
22
  end
23
23
 
24
- ERROR_KEYS = %w[ writeErrors writeConcernError writeConcernErrors ].freeze
24
+ ERROR_KEYS = %w[writeErrors writeConcernError writeConcernErrors].freeze
25
25
 
26
26
  def error_key_present?(event)
27
27
  if reply = event.reply
@@ -1,6 +1,7 @@
1
1
  # This file is distributed under New Relic's license terms.
2
2
  # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
3
3
  # frozen_string_literal: true
4
+
4
5
  require_relative 'sidekiq/client'
5
6
  require_relative 'sidekiq/server'
6
7
  require_relative 'sidekiq/extensions/delayed_class'
@@ -134,7 +134,7 @@ module NewRelic
134
134
  # Foo._nr_default_metric_name_code('bar') #=> "Custom/#{Foo.name}/bar"
135
135
  def _nr_default_metric_name(method_name)
136
136
  class_name = _nr_derived_class_name
137
- -> (*) { "Custom/#{class_name}/#{method_name}" }
137
+ ->(*) { "Custom/#{class_name}/#{method_name}" }
138
138
  end
139
139
 
140
140
  # Checks to see if the method we are attempting to trace
@@ -462,7 +462,6 @@ module NewRelic
462
462
  Net::HTTPRequestURITooLong,
463
463
  Net::HTTPUnsupportedMediaType,
464
464
  Net::HTTPExpectationFailed,
465
- Net::HTTPUnsupportedMediaType,
466
465
  Net::HTTPRequestHeaderFieldsTooLarge
467
466
  handle_unrecoverable_server_exception(response, endpoint)
468
467
  when Net::HTTPConflict,
@@ -1,6 +1,7 @@
1
1
  # This file is distributed under New Relic's license terms.
2
2
  # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
3
3
  # frozen_string_literal: true
4
+
4
5
  #
5
6
  # A Sampler is used to capture meaningful metrics in a background thread
6
7
  # periodically. They will be invoked about once a minute, each time the agent
@@ -424,7 +424,7 @@ module NewRelic
424
424
  current_txn = ::Thread.current[:newrelic_tracer_state]&.current_transaction if ::Thread.current[:newrelic_tracer_state]&.is_execution_traced?
425
425
  proc do
426
426
  begin
427
- if current_txn
427
+ if current_txn && !current_txn.finished?
428
428
  NewRelic::Agent::Tracer.state.current_transaction = current_txn
429
429
  current_txn.async = true
430
430
  segment_name += "/Thread#{::Thread.current.object_id}/Fiber#{::Fiber.current.object_id}" if NewRelic::Agent.config[:'thread_ids_enabled']
@@ -2,7 +2,6 @@
2
2
  # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
3
3
  # frozen_string_literal: true
4
4
 
5
- require 'new_relic/agent/range_extensions'
6
5
  require 'new_relic/agent/guid_generator'
7
6
 
8
7
  module NewRelic
@@ -105,38 +104,6 @@ module NewRelic
105
104
  @start_time.to_f..@end_time.to_f
106
105
  end
107
106
 
108
- def timings_overlap?(timing1, timing2)
109
- (timing1.first >= timing2.first && timing1.first <= timing2.last) ||
110
- (timing2.first >= timing1.first && timing2.first <= timing1.last)
111
- end
112
-
113
- def merge_timings(timing1, timing2)
114
- [([timing1.first, timing2.first].min),
115
- ([timing1.last, timing2.last].max)]
116
- end
117
-
118
- # @children_timings is an array of array, with each inner array
119
- # holding exactly 2 values, a child segment's start time and finish
120
- # time (in that order). When it's time to record, these timings are
121
- # converted into an array of range objects (using the same start and
122
- # end values as the original array). Any two range objects that
123
- # intersect and merged into a larger range. This checking for a
124
- # intersections and merging of ranges is expensive, so the operation
125
- # is only done at recording time.
126
- def children_time_ranges
127
- @children_time_ranges ||= begin
128
- overlapped = @children_timings.each_with_object([]) do |timing, timings|
129
- i = timings.index { |t| timings_overlap?(t, timing) }
130
- if i
131
- timings[i] = merge_timings(timing, timings[i])
132
- else
133
- timings << timing
134
- end
135
- end
136
- overlapped.map { |t| Range.new(t.first, t.last) }
137
- end
138
- end
139
-
140
107
  def children_time_ranges?
141
108
  !@children_timings.empty?
142
109
  end
@@ -299,12 +266,6 @@ module NewRelic
299
266
  end
300
267
 
301
268
  def record_exclusive_duration
302
- overlapping_duration = if children_time_ranges?
303
- RangeExtensions.compute_overlap(time_range, children_time_ranges)
304
- else
305
- 0.0
306
- end
307
-
308
269
  @exclusive_duration = duration - children_time - overlapping_duration
309
270
  transaction.total_time += @exclusive_duration
310
271
  params[:exclusive_duration_millis] = @exclusive_duration * 1000 if transaction.async?
@@ -314,6 +275,51 @@ module NewRelic
314
275
  transaction.metrics
315
276
  end
316
277
 
278
+ def ranges_intersect?(r1, r2)
279
+ r1.begin > r2.begin ? r2.cover?(r1.begin) : r1.cover?(r2.begin)
280
+ end
281
+
282
+ def range_overlap(range)
283
+ return 0.0 unless ranges_intersect?(range, time_range)
284
+
285
+ [range.end, time_range.end].min - [range.begin, time_range.begin].max
286
+ end
287
+
288
+ # Child segments operating concurrently with this segment may have
289
+ # start and end times that overlap with this segment's own times. The
290
+ # amount of overlap needs to be removed from the `children_time` total
291
+ # when calculating an `@exclusive_duration` value to be added to the
292
+ # transaction's total time.
293
+ #
294
+ # If there aren't any child segments, return 0.0. Otherwise, take the
295
+ # `@children_timings` array of arrays (each array holds a child
296
+ # segment's start time and end time), sort it by the first elements
297
+ # (start times), and use the start and finish times to create Range
298
+ # objects. Combine all of the child segment ranges that overlap with
299
+ # one another into new bigger ranges. Then take those bigger ranges
300
+ # and calculate how much overlap there is between them and this
301
+ # segment's own time range. Keep a running sum of all of the overlap
302
+ # amounts and then return it.
303
+ def overlapping_duration
304
+ sum = 0.0
305
+ return sum unless children_time_ranges?
306
+
307
+ @children_timings.sort_by!(&:first)
308
+ range = Range.new(*@children_timings.first)
309
+ (1..(@children_timings.size - 1)).each do |i|
310
+ possible = Range.new(*@children_timings[i])
311
+
312
+ if ranges_intersect?(range, possible)
313
+ range = range.begin..possible.end
314
+ else
315
+ sum += range_overlap(range)
316
+ range = possible
317
+ end
318
+ end
319
+
320
+ sum += range_overlap(range)
321
+ end
322
+
317
323
  def transaction_state
318
324
  @transaction_state ||= if @transaction
319
325
  transaction.state
@@ -119,14 +119,13 @@ module NewRelic
119
119
  end
120
120
 
121
121
  def check_required_fields_present(payload)
122
- if \
123
- !payload.version.nil? &&
124
- !payload.parent_account_id.nil? &&
125
- !payload.parent_app_id.nil? &&
126
- !payload.parent_type.nil? &&
127
- (!payload.transaction_id.nil? || !payload.id.nil?) &&
128
- !payload.trace_id.nil? &&
129
- !payload.timestamp.nil?
122
+ if !payload.version.nil? &&
123
+ !payload.parent_account_id.nil? &&
124
+ !payload.parent_app_id.nil? &&
125
+ !payload.parent_type.nil? &&
126
+ (!payload.transaction_id.nil? || !payload.id.nil?) &&
127
+ !payload.trace_id.nil? &&
128
+ !payload.timestamp.nil?
130
129
 
131
130
  true
132
131
  else
@@ -29,6 +29,12 @@ module NewRelic
29
29
  else
30
30
  segment.record_on_finish = true
31
31
  ::NewRelic::Agent.logger.debug("Segment limit of #{segment_limit} reached, ceasing collection.")
32
+
33
+ if finished?
34
+ ::NewRelic::Agent.logger.debug("Transaction #{best_name} has finished but segments still being created, resetting state.")
35
+ NewRelic::Agent::Tracer.state.reset
36
+ NewRelic::Agent.record_metric('Supportability/Transaction/SegmentLimitReachedAfterFinished/ResetState', 1)
37
+ end
32
38
  end
33
39
  segment.transaction_assigned
34
40
  end
@@ -439,6 +439,10 @@ module NewRelic
439
439
  segments.first
440
440
  end
441
441
 
442
+ def finished?
443
+ initial_segment.finished?
444
+ end
445
+
442
446
  def create_initial_segment(options = {})
443
447
  segment = create_segment(@default_name, options)
444
448
  segment.record_scoped_metric = false
@@ -62,7 +62,6 @@ module NewRelic
62
62
  File.join(instrumentation_path, app.to_s, '*.rb')
63
63
  @instrumentation_files.each { |pattern| load_instrumentation_files(pattern) }
64
64
  DependencyDetection.detect!
65
- ruby_deprecation
66
65
  rails_32_deprecation
67
66
  ::NewRelic::Agent.logger.info('Finished instrumentation')
68
67
  end
@@ -81,19 +80,6 @@ module NewRelic
81
80
  )
82
81
  end
83
82
 
84
- def ruby_deprecation
85
- return unless RUBY_VERSION < '2.4.0'
86
-
87
- deprecation_msg = 'The Ruby Agent is dropping support for Rubies below 2.4 ' \
88
- 'in version 9.0.0. Please upgrade your Ruby version to continue receiving support. ' \
89
-
90
- ::NewRelic::Agent.logger.log_once(
91
- :warn,
92
- :deprecated_ruby_version,
93
- deprecation_msg
94
- )
95
- end
96
-
97
83
  include Instrumentation
98
84
  end
99
85
  end
@@ -179,6 +179,15 @@ module DependencyDetection
179
179
  return valid_value
180
180
  end
181
181
 
182
+ # update any :auto config value to be either :prepend or :chain after auto
183
+ # determination has selected one of those to use
184
+ def update_config_value(use_prepend)
185
+ if config_key && auto_configured?
186
+ NewRelic::Agent.config.instance_variable_get(:@cache)[config_key] = use_prepend ? :prepend : :chain
187
+ end
188
+ use_prepend
189
+ end
190
+
182
191
  def config_value
183
192
  return AUTO_CONFIG_VALUE unless config_key
184
193
 
@@ -202,7 +211,7 @@ module DependencyDetection
202
211
  end
203
212
 
204
213
  def use_prepend?
205
- prepend_configured? || (auto_configured? && !prepend_conflicts?)
214
+ update_config_value(prepend_configured? || (auto_configured? && !prepend_conflicts?))
206
215
  end
207
216
 
208
217
  def prepend_conflicts?
@@ -6,8 +6,8 @@
6
6
  module NewRelic
7
7
  module VERSION # :nodoc:
8
8
  MAJOR = 9
9
- MINOR = 1
10
- TINY = 0
9
+ MINOR = 2
10
+ TINY = 1
11
11
 
12
12
  STRING = "#{MAJOR}.#{MINOR}.#{TINY}"
13
13
  end
@@ -1,6 +1,6 @@
1
- # frozen_string_literal: true
2
1
  # This file is distributed under New Relic's license terms.
3
2
  # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
3
+ # frozen_string_literal: true
4
4
 
5
5
  if ENV['CI']
6
6
  namespace :coverage do
@@ -97,14 +97,14 @@ class Instrumentation < Thor
97
97
 
98
98
  def config_block(name)
99
99
  <<~CONFIG
100
- :'instrumentation.#{name.downcase}' => {
101
- :default => 'auto',
102
- :public => true,
103
- :type => String,
104
- :dynamic_name => true,
105
- :allowed_from_server => false,
106
- :description => 'Controls auto-instrumentation of the #{name} library at start up. May be one of [auto|prepend|chain|disabled].'
107
- },
100
+ :'instrumentation.#{name.downcase}' => {
101
+ :default => 'auto',
102
+ :public => true,
103
+ :type => String,
104
+ :dynamic_name => true,
105
+ :allowed_from_server => false,
106
+ :description => 'Controls auto-instrumentation of the #{name} library at start up. May be one of [auto|prepend|chain|disabled].'
107
+ },
108
108
  CONFIG
109
109
  end
110
110
 
@@ -3,7 +3,7 @@
3
3
  # frozen_string_literal: true
4
4
 
5
5
  module NewRelic::Agent::Instrumentation
6
- module <%= @class_name %>
6
+ module <%= @class_name %>::Chain
7
7
  def self.instrument!
8
8
  ::<%= @class_name %>.class_eval do
9
9
  include NewRelic::Agent::Instrumentation::<%= @class_name %>
@@ -23,7 +23,7 @@ DependencyDetection.defer do
23
23
  if use_prepend?
24
24
  prepend_instrument ::<%= @class_name %>, NewRelic::Agent::Instrumentation::<%= @class_name %>::Prepend
25
25
  else
26
- chain_instrument NewRelic::Agent::Instrumentation::<%= @class_name %>
26
+ chain_instrument NewRelic::Agent::Instrumentation::<%= @class_name %>::Chain
27
27
  end
28
28
  end
29
29
  end
@@ -1,6 +1,7 @@
1
1
  # This file is distributed under New Relic's license terms.
2
2
  # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
3
3
  # frozen_string_literal: true
4
+
4
5
  #
5
6
  # Rake task for running Ruby agent multiverse tests. This file may be required
6
7
  # from third party gems. It is also used by the agent itself to run multiverse.
@@ -1,6 +1,7 @@
1
1
  # This file is distributed under New Relic's license terms.
2
2
  # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
3
3
  # frozen_string_literal: true
4
+
4
5
  #
5
6
  # If you are looking to instrument rake tasks in a Rails environment, but the
6
7
  # task doesn't depend on :environment, this task may be included to ensure that
data/newrelic.yml CHANGED
@@ -352,7 +352,7 @@ common: &default_settings
352
352
 
353
353
  # Controls auto-instrumentation of Excon at start up.
354
354
  # May be one of [enabled|disabled].
355
- # instrumentation.excon: auto
355
+ # instrumentation.excon: enabled
356
356
 
357
357
  # Controls auto-instrumentation of Grape at start up.
358
358
  # May be one of [auto|prepend|chain|disabled].
@@ -388,7 +388,7 @@ common: &default_settings
388
388
 
389
389
  # Controls auto-instrumentation of Mongo at start up.
390
390
  # May be one of [enabled|disabled].
391
- # instrumentation.mongo: auto
391
+ # instrumentation.mongo: enabled
392
392
 
393
393
  # Controls auto-instrumentation of Net::HTTP at start up.
394
394
  # May be one of [auto|prepend|chain|disabled].
@@ -545,7 +545,7 @@ common: &default_settings
545
545
  # slow_sql.enabled: false
546
546
 
547
547
  # If true, the agent collects explain plans in slow SQL queries. If this setting
548
- # is omitted, the transaction_tracer.explain.enabled setting will be applied as
548
+ # is omitted, the transaction_tracer.explain_enabled setting will be applied as
549
549
  # the default setting for explain plans in slow SQL as well.
550
550
  # slow_sql.explain_enabled: false
551
551
 
@@ -639,13 +639,13 @@ common: &default_settings
639
639
  # transaction_tracer.enabled: true
640
640
 
641
641
  # Threshold (in seconds) above which the agent will collect explain plans.
642
- # Relevant only when explain.enabled is true.
642
+ # Relevant only when explain_enabled is true.
643
643
  # transaction_tracer.explain_threshold: 0.5
644
644
 
645
645
  # If true, enables the collection of explain plans in transaction traces.
646
646
  # This setting will also apply to explain plans in slow SQL traces if
647
647
  # slow_sql.explain enabled is not set separately.
648
- # transaction_tracer.explain.enabled: true
648
+ # transaction_tracer.explain_enabled: true
649
649
 
650
650
  # Maximum number of transaction trace nodes to record in a single transaction
651
651
  # trace.
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.1.0
4
+ version: 9.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tanna McClure
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2023-03-30 00:00:00.000000000 Z
14
+ date: 2023-05-01 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
@@ -83,6 +83,76 @@ dependencies:
83
83
  - - '='
84
84
  - !ruby/object:Gem::Version
85
85
  version: 12.3.3
86
+ - !ruby/object:Gem::Dependency
87
+ name: rubocop
88
+ requirement: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - '='
91
+ - !ruby/object:Gem::Version
92
+ version: 1.44.1
93
+ type: :development
94
+ prerelease: false
95
+ version_requirements: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - '='
98
+ - !ruby/object:Gem::Version
99
+ version: 1.44.1
100
+ - !ruby/object:Gem::Dependency
101
+ name: rubocop-ast
102
+ requirement: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - '='
105
+ - !ruby/object:Gem::Version
106
+ version: 1.24.1
107
+ type: :development
108
+ prerelease: false
109
+ version_requirements: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - '='
112
+ - !ruby/object:Gem::Version
113
+ version: 1.24.1
114
+ - !ruby/object:Gem::Dependency
115
+ name: rubocop-minitest
116
+ requirement: !ruby/object:Gem::Requirement
117
+ requirements:
118
+ - - '='
119
+ - !ruby/object:Gem::Version
120
+ version: 0.27.0
121
+ type: :development
122
+ prerelease: false
123
+ version_requirements: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - '='
126
+ - !ruby/object:Gem::Version
127
+ version: 0.27.0
128
+ - !ruby/object:Gem::Dependency
129
+ name: rubocop-performance
130
+ requirement: !ruby/object:Gem::Requirement
131
+ requirements:
132
+ - - '='
133
+ - !ruby/object:Gem::Version
134
+ version: 1.16.0
135
+ type: :development
136
+ prerelease: false
137
+ version_requirements: !ruby/object:Gem::Requirement
138
+ requirements:
139
+ - - '='
140
+ - !ruby/object:Gem::Version
141
+ version: 1.16.0
142
+ - !ruby/object:Gem::Dependency
143
+ name: rubocop-rake
144
+ requirement: !ruby/object:Gem::Requirement
145
+ requirements:
146
+ - - '='
147
+ - !ruby/object:Gem::Version
148
+ version: 0.6.0
149
+ type: :development
150
+ prerelease: false
151
+ version_requirements: !ruby/object:Gem::Requirement
152
+ requirements:
153
+ - - '='
154
+ - !ruby/object:Gem::Version
155
+ version: 0.6.0
86
156
  - !ruby/object:Gem::Dependency
87
157
  name: simplecov
88
158
  requirement: !ruby/object:Gem::Requirement
@@ -439,7 +509,6 @@ files:
439
509
  - lib/new_relic/agent/pipe_service.rb
440
510
  - lib/new_relic/agent/prepend_supportability.rb
441
511
  - lib/new_relic/agent/priority_sampled_buffer.rb
442
- - lib/new_relic/agent/range_extensions.rb
443
512
  - lib/new_relic/agent/rules_engine.rb
444
513
  - lib/new_relic/agent/rules_engine/replacement_rule.rb
445
514
  - lib/new_relic/agent/rules_engine/segment_terms_rule.rb
@@ -600,7 +669,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
600
669
  - !ruby/object:Gem::Version
601
670
  version: 1.3.1
602
671
  requirements: []
603
- rubygems_version: 3.1.6
672
+ rubygems_version: 3.4.10
604
673
  signing_key:
605
674
  specification_version: 4
606
675
  summary: New Relic Ruby Agent
@@ -1,27 +0,0 @@
1
- # This file is distributed under New Relic's license terms.
2
- # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
3
- # frozen_string_literal: true
4
-
5
- module NewRelic
6
- module Agent
7
- module RangeExtensions
8
- module_function
9
-
10
- def intersects?(r1, r2)
11
- r1.begin > r2.begin ? r2.cover?(r1.begin) : r1.cover?(r2.begin)
12
- end
13
-
14
- # Computes the amount of overlap between range and an array of ranges.
15
- # For efficiency, it assumes that range intersects with each of the
16
- # ranges in the ranges array.
17
- def compute_overlap(range, ranges)
18
- ranges.inject(0) do |memo, other|
19
- next memo unless intersects?(range, other)
20
-
21
- memo += ([range.end, other.end].min) -
22
- ([range.begin, other.begin].max)
23
- end
24
- end
25
- end
26
- end
27
- end