newrelic_rpm 9.5.0 → 9.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +80 -6
  3. data/Rakefile +1 -1
  4. data/lib/new_relic/agent/configuration/default_source.rb +80 -33
  5. data/lib/new_relic/agent/http_clients/async_http_wrappers.rb +83 -0
  6. data/lib/new_relic/agent/http_clients/ethon_wrappers.rb +111 -0
  7. data/lib/new_relic/agent/http_clients/httpx_wrappers.rb +93 -0
  8. data/lib/new_relic/agent/instrumentation/active_record_helper.rb +1 -2
  9. data/lib/new_relic/agent/instrumentation/active_support_broadcast_logger/chain.rb +69 -0
  10. data/lib/new_relic/agent/instrumentation/active_support_broadcast_logger/instrumentation.rb +13 -0
  11. data/lib/new_relic/agent/instrumentation/active_support_broadcast_logger/prepend.rb +37 -0
  12. data/lib/new_relic/agent/instrumentation/active_support_broadcast_logger.rb +23 -0
  13. data/lib/new_relic/agent/instrumentation/active_support_logger.rb +3 -1
  14. data/lib/new_relic/agent/instrumentation/async_http/chain.rb +23 -0
  15. data/lib/new_relic/agent/instrumentation/async_http/instrumentation.rb +37 -0
  16. data/lib/new_relic/agent/instrumentation/async_http/prepend.rb +15 -0
  17. data/lib/new_relic/agent/instrumentation/async_http.rb +26 -0
  18. data/lib/new_relic/agent/instrumentation/ethon/chain.rb +39 -0
  19. data/lib/new_relic/agent/instrumentation/ethon/instrumentation.rb +105 -0
  20. data/lib/new_relic/agent/instrumentation/ethon/prepend.rb +35 -0
  21. data/lib/new_relic/agent/instrumentation/ethon.rb +39 -0
  22. data/lib/new_relic/agent/instrumentation/httpx/chain.rb +20 -0
  23. data/lib/new_relic/agent/instrumentation/httpx/instrumentation.rb +51 -0
  24. data/lib/new_relic/agent/instrumentation/httpx/prepend.rb +15 -0
  25. data/lib/new_relic/agent/instrumentation/httpx.rb +27 -0
  26. data/lib/new_relic/agent/instrumentation/mongodb_command_subscriber.rb +1 -3
  27. data/lib/new_relic/agent/instrumentation/net_http/instrumentation.rb +1 -1
  28. data/lib/new_relic/agent/instrumentation/rails_notifications/action_controller.rb +1 -0
  29. data/lib/new_relic/agent/instrumentation/roda/ignorer.rb +45 -0
  30. data/lib/new_relic/agent/instrumentation/roda/instrumentation.rb +12 -0
  31. data/lib/new_relic/agent/instrumentation/roda/roda_transaction_namer.rb +1 -2
  32. data/lib/new_relic/agent/instrumentation/roda.rb +2 -0
  33. data/lib/new_relic/agent/instrumentation/sidekiq.rb +3 -1
  34. data/lib/new_relic/agent/instrumentation/sinatra/transaction_namer.rb +1 -3
  35. data/lib/new_relic/agent/messaging.rb +2 -2
  36. data/lib/new_relic/agent/monitors/synthetics_monitor.rb +12 -1
  37. data/lib/new_relic/agent/rules_engine.rb +1 -1
  38. data/lib/new_relic/agent/span_event_primitive.rb +16 -4
  39. data/lib/new_relic/agent/system_info.rb +26 -0
  40. data/lib/new_relic/agent/tracer.rb +1 -3
  41. data/lib/new_relic/agent/transaction/abstract_segment.rb +3 -0
  42. data/lib/new_relic/agent/transaction/external_request_segment.rb +5 -2
  43. data/lib/new_relic/agent/transaction/message_broker_segment.rb +1 -2
  44. data/lib/new_relic/agent/transaction/request_attributes.rb +1 -3
  45. data/lib/new_relic/agent/transaction.rb +25 -2
  46. data/lib/new_relic/agent/transaction_error_primitive.rb +16 -0
  47. data/lib/new_relic/agent/transaction_event_primitive.rb +19 -0
  48. data/lib/new_relic/agent/utilization/gcp.rb +1 -3
  49. data/lib/new_relic/agent.rb +6 -2
  50. data/lib/new_relic/constants.rb +3 -0
  51. data/lib/new_relic/control/frameworks/rails.rb +14 -2
  52. data/lib/new_relic/language_support.rb +4 -0
  53. data/lib/new_relic/version.rb +1 -1
  54. data/lib/tasks/instrumentation_generator/instrumentation.thor +3 -3
  55. data/lib/tasks/tests.rake +71 -0
  56. data/newrelic.yml +49 -33
  57. data/newrelic_rpm.gemspec +4 -1
  58. metadata +36 -2
@@ -31,9 +31,14 @@ module NewRelic
31
31
  SYNTHETICS_RESOURCE_ID_KEY = 'nr.syntheticsResourceId'.freeze
32
32
  SYNTHETICS_JOB_ID_KEY = 'nr.syntheticsJobId'.freeze
33
33
  SYNTHETICS_MONITOR_ID_KEY = 'nr.syntheticsMonitorId'.freeze
34
+ SYNTHETICS_TYPE_KEY = 'nr.syntheticsType'
35
+ SYNTHETICS_INITIATOR_KEY = 'nr.syntheticsInitiator'
36
+ SYNTHETICS_KEY_PREFIX = 'nr.synthetics'
34
37
  PRIORITY_KEY = 'priority'.freeze
35
38
  SPAN_ID_KEY = 'spanId'.freeze
36
39
 
40
+ SYNTHETICS_PAYLOAD_EXPECTED = [:synthetics_resource_id, :synthetics_job_id, :synthetics_monitor_id, :synthetics_type, :synthetics_initiator]
41
+
37
42
  def create(noticed_error, payload, span_id)
38
43
  [
39
44
  intrinsic_attributes_for(noticed_error, payload, span_id),
@@ -71,9 +76,20 @@ module NewRelic
71
76
  end
72
77
 
73
78
  def append_synthetics(payload, sample)
79
+ return unless payload[:synthetics_job_id]
80
+
74
81
  sample[SYNTHETICS_RESOURCE_ID_KEY] = payload[:synthetics_resource_id] if payload[:synthetics_resource_id]
75
82
  sample[SYNTHETICS_JOB_ID_KEY] = payload[:synthetics_job_id] if payload[:synthetics_job_id]
76
83
  sample[SYNTHETICS_MONITOR_ID_KEY] = payload[:synthetics_monitor_id] if payload[:synthetics_monitor_id]
84
+ sample[SYNTHETICS_TYPE_KEY] = payload[:synthetics_type] if payload[:synthetics_type]
85
+ sample[SYNTHETICS_INITIATOR_KEY] = payload[:synthetics_initiator] if payload[:synthetics_initiator]
86
+
87
+ payload.each do |k, v|
88
+ next unless k.to_s.start_with?('synthetics_') && !SYNTHETICS_PAYLOAD_EXPECTED.include?(k)
89
+
90
+ new_key = SYNTHETICS_KEY_PREFIX + NewRelic::LanguageSupport.camelize(k.to_s.gsub('synthetics_', ''))
91
+ sample[new_key] = v
92
+ end
77
93
  end
78
94
 
79
95
  def append_cat(payload, sample)
@@ -38,6 +38,11 @@ module NewRelic
38
38
  SYNTHETICS_RESOURCE_ID_KEY = 'nr.syntheticsResourceId'
39
39
  SYNTHETICS_JOB_ID_KEY = 'nr.syntheticsJobId'
40
40
  SYNTHETICS_MONITOR_ID_KEY = 'nr.syntheticsMonitorId'
41
+ SYNTHETICS_TYPE_KEY = 'nr.syntheticsType'
42
+ SYNTHETICS_INITIATOR_KEY = 'nr.syntheticsInitiator'
43
+ SYNTHETICS_KEY_PREFIX = 'nr.synthetics'
44
+
45
+ SYNTHETICS_PAYLOAD_EXPECTED = [:synthetics_resource_id, :synthetics_job_id, :synthetics_monitor_id, :synthetics_type, :synthetics_initiator]
41
46
 
42
47
  def create(payload)
43
48
  intrinsics = {
@@ -71,9 +76,23 @@ module NewRelic
71
76
  optionally_append(SYNTHETICS_RESOURCE_ID_KEY, :synthetics_resource_id, sample, payload)
72
77
  optionally_append(SYNTHETICS_JOB_ID_KEY, :synthetics_job_id, sample, payload)
73
78
  optionally_append(SYNTHETICS_MONITOR_ID_KEY, :synthetics_monitor_id, sample, payload)
79
+ optionally_append(SYNTHETICS_TYPE_KEY, :synthetics_type, sample, payload)
80
+ optionally_append(SYNTHETICS_INITIATOR_KEY, :synthetics_initiator, sample, payload)
81
+ append_synthetics_info_attributes(sample, payload)
74
82
  append_cat_alternate_path_hashes(sample, payload)
75
83
  end
76
84
 
85
+ def append_synthetics_info_attributes(sample, payload)
86
+ return unless payload.include?(:synthetics_job_id)
87
+
88
+ payload.each do |k, v|
89
+ next unless k.to_s.start_with?('synthetics_') && !SYNTHETICS_PAYLOAD_EXPECTED.include?(k)
90
+
91
+ new_key = SYNTHETICS_KEY_PREFIX + NewRelic::LanguageSupport.camelize(k.to_s.gsub('synthetics_', ''))
92
+ sample[new_key] = v.to_s
93
+ end
94
+ end
95
+
77
96
  def append_cat_alternate_path_hashes(sample, payload)
78
97
  if payload.include?(:cat_alternate_path_hashes)
79
98
  sample[CAT_ALTERNATE_PATH_HASHES_KEY] = payload[:cat_alternate_path_hashes].sort.join(COMMA)
@@ -24,10 +24,8 @@ module NewRelic
24
24
  body
25
25
  end
26
26
 
27
- SLASH = '/'.freeze
28
-
29
27
  def trim_leading(value)
30
- value.split(SLASH).last
28
+ value.split(NewRelic::SLASH).last
31
29
  end
32
30
  end
33
31
  end
@@ -633,7 +633,9 @@ module NewRelic
633
633
  def add_new_segment_attributes(params, segment)
634
634
  # Make sure not to override existing segment-level custom attributes
635
635
  segment_custom_keys = segment.attributes.custom_attributes.keys.map(&:to_sym)
636
- segment.add_custom_attributes(params.reject { |k, _v| segment_custom_keys.include?(k.to_sym) })
636
+ segment.add_custom_attributes(params.reject do |k, _v|
637
+ segment_custom_keys.include?(k.to_sym) if k.respond_to?(:to_sym) # param keys can be integers
638
+ end)
637
639
  end
638
640
 
639
641
  # Add custom attributes to the span event for the current span. Attributes will be visible on spans in the
@@ -661,7 +663,9 @@ module NewRelic
661
663
  end
662
664
  end
663
665
 
664
- # Add custom attributes to log events for the current agent instance.
666
+ # Add global custom attributes to log events for the current agent instance. As these attributes are global to the
667
+ # agent instance, they will be attached to all log events generated by the agent, and this methods usage isn't
668
+ # suitable for setting dynamic values.
665
669
  #
666
670
  # @param [Hash] params A Hash of attributes to attach to log
667
671
  # events. The agent accepts up to 240 custom
@@ -35,4 +35,7 @@ module NewRelic
35
35
 
36
36
  CONNECT_RETRY_PERIODS = [15, 15, 30, 60, 120, 300]
37
37
  MAX_RETRY_PERIOD = 300
38
+
39
+ SLASH = '/'
40
+ ROOT = SLASH
38
41
  end
@@ -10,6 +10,9 @@ module NewRelic
10
10
  # Rails specific configuration, instrumentation, environment values,
11
11
  # etc.
12
12
  class Rails < NewRelic::Control::Frameworks::Ruby
13
+ BROWSER_MONITORING_INSTALLED_SINGLETON = NewRelic::Agent.config
14
+ BROWSER_MONITORING_INSTALLED_VARIABLE = :@browser_monitoring_installed
15
+
13
16
  def env
14
17
  @env ||= (ENV['NEW_RELIC_ENV'] || RAILS_ENV.dup)
15
18
  end
@@ -97,9 +100,9 @@ module NewRelic
97
100
 
98
101
  def install_browser_monitoring(config)
99
102
  @install_lock.synchronize do
100
- return if defined?(@browser_monitoring_installed) && @browser_monitoring_installed
103
+ return if browser_agent_already_installed?
101
104
 
102
- @browser_monitoring_installed = true
105
+ mark_browser_agent_as_installed
103
106
  return if config.nil? || !config.respond_to?(:middleware) || !Agent.config[:'browser_monitoring.auto_instrument']
104
107
 
105
108
  begin
@@ -112,6 +115,15 @@ module NewRelic
112
115
  end
113
116
  end
114
117
 
118
+ def browser_agent_already_installed?
119
+ BROWSER_MONITORING_INSTALLED_SINGLETON.instance_variable_defined?(BROWSER_MONITORING_INSTALLED_VARIABLE) &&
120
+ BROWSER_MONITORING_INSTALLED_SINGLETON.instance_variable_get(BROWSER_MONITORING_INSTALLED_VARIABLE)
121
+ end
122
+
123
+ def mark_browser_agent_as_installed
124
+ BROWSER_MONITORING_INSTALLED_SINGLETON.instance_variable_set(BROWSER_MONITORING_INSTALLED_VARIABLE, true)
125
+ end
126
+
115
127
  def rails_version
116
128
  @rails_version ||= Gem::Version.new(::Rails::VERSION::STRING)
117
129
  end
@@ -83,6 +83,10 @@ module NewRelic
83
83
  camelized[0].downcase.concat(camelized[1..-1])
84
84
  end
85
85
 
86
+ def snakeize(string)
87
+ string.gsub(/(.)([A-Z])/, '\1_\2').downcase
88
+ end
89
+
86
90
  def bundled_gem?(gem_name)
87
91
  defined?(Bundler) && Bundler.rubygems.all_specs.map(&:name).include?(gem_name)
88
92
  rescue => e
@@ -6,7 +6,7 @@
6
6
  module NewRelic
7
7
  module VERSION # :nodoc:
8
8
  MAJOR = 9
9
- MINOR = 5
9
+ MINOR = 6
10
10
  TINY = 0
11
11
 
12
12
  STRING = "#{MAJOR}.#{MINOR}.#{TINY}"
@@ -82,7 +82,7 @@ class Instrumentation < Thor
82
82
  insert_into_file(
83
83
  DEFAULT_SOURCE_LOCATION,
84
84
  config_block(name.downcase),
85
- after: ":description => 'Controls auto-instrumentation of bunny at start up. May be one of [auto|prepend|chain|disabled].'
85
+ after: ":description => 'Controls auto-instrumentation of bunny at start-up. May be one of [auto|prepend|chain|disabled].'
86
86
  },\n"
87
87
  )
88
88
  end
@@ -103,7 +103,7 @@ class Instrumentation < Thor
103
103
  :type => String,
104
104
  :dynamic_name => true,
105
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].'
106
+ :description => 'Controls auto-instrumentation of the #{name} library at start-up. May be one of [auto|prepend|chain|disabled].'
107
107
  },
108
108
  CONFIG
109
109
  end
@@ -111,7 +111,7 @@ class Instrumentation < Thor
111
111
  def yaml_block(name)
112
112
  <<~HEREDOC
113
113
 
114
- # Controls auto-instrumentation of #{name} at start up.
114
+ # Controls auto-instrumentation of #{name} at start-up.
115
115
  # May be one of [auto|prepend|chain|disabled]
116
116
  # instrumentation.#{name.downcase}: auto
117
117
  HEREDOC
data/lib/tasks/tests.rake CHANGED
@@ -11,6 +11,75 @@ rescue LoadError
11
11
  end
12
12
 
13
13
  if defined? Rake::TestTask
14
+ def name_for_number(content, number)
15
+ (number - 1).downto(0).each do |i|
16
+ return Regexp.last_match(1) if content[i] =~ /^\s*def (test_.+)\s*$/
17
+ end
18
+ end
19
+
20
+ def info_from_test_var
21
+ return {} unless ENV['TEST'].to_s =~ /^(.+)((?::\d+)+)/
22
+
23
+ file = Regexp.last_match(1)
24
+ numbers = Regexp.last_match(2).split(':').reject(&:empty?).uniq.map(&:to_i)
25
+ abs = File.expand_path(File.join('../../..', file), __FILE__)
26
+ raise "File >>#{abs}<< does not exist!" unless File.exist?(abs)
27
+
28
+ content = File.read(abs).split("\n")
29
+ {file: file, numbers: numbers, content: content}
30
+ end
31
+
32
+ def test_names_from_test_file(info)
33
+ info[:numbers].each_with_object([]) do |number, names|
34
+ name = name_for_number(info[:content], number)
35
+ unless name
36
+ warn "Unable to determine a test name given line >>#{number}<< for file >>#{info[:file]}<<"
37
+ next
38
+ end
39
+ names << name
40
+ end
41
+ end
42
+
43
+ # Allow ENV['TEST'] to be set to a test file path with one or more
44
+ # `:<line number>` patterns on the end of it.
45
+ #
46
+ # For example:
47
+ # TEST=test/new_relic/agent/autostart_test.rb:57 bundle exec rake test
48
+ #
49
+ # The `autostart_test.rb` file will be read, and starting from line 57 and
50
+ # working upwards in the file (downwards by line number), a test definition
51
+ # will be searched for that matches `def test_<rest of the test name>`.
52
+ #
53
+ # Multiple line numbers can be specified like so:
54
+ # TEST=test/new_relic/agent/autostart_test.rb:57:26 bundle exec rake test
55
+ #
56
+ # For this multiple line number based example, both lines 57 and 26 will
57
+ # serve as separate starting points for the search for a test name.
58
+ #
59
+ # All test names that are discovered will be "ORed" into a regex pattern with
60
+ # pipes ('|') that is passed to Minitest via
61
+ # `TESTOPTS="--name='test_name1|test_name2'"`
62
+ #
63
+ # Once a line with one or more `:<line number>` values on the end of it has
64
+ # been found, replace the value of ENV['TEST'] with the path leading up to
65
+ # the first colon before invoking Minitest.
66
+ #
67
+ # Why refer to a test by line number instead of just supplying the name
68
+ # directly? The primary use case is text editor integration. A text editor
69
+ # can be taught to "run the single unit test containing the line the cursor is
70
+ # on" by building a string containing the path to the file, a colon, (':'),
71
+ # and the line number.
72
+ def process_line_numbers
73
+ info = info_from_test_var
74
+ return unless info.key?(:file)
75
+
76
+ test_names = test_names_from_test_file(info)
77
+ raise "Could not determine any test names for file >>#{abs}<< given numbers >>#{numbers}" if test_names.empty?
78
+
79
+ ENV['TESTOPTS'] = "#{ENV['TESTOPTS']} --name='#{test_names.map { |n| Regexp.escape(n) }.join('|')}'"
80
+ ENV['TEST'] = info[:file]
81
+ end
82
+
14
83
  namespace :test do
15
84
  tasks = Rake.application.top_level_tasks
16
85
  ENV['TESTOPTS'] ||= ''
@@ -21,6 +90,8 @@ if defined? Rake::TestTask
21
90
  ENV['TESTOPTS'] += ' --' + seed
22
91
  end
23
92
 
93
+ process_line_numbers
94
+
24
95
  agent_home = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
25
96
 
26
97
  Rake::TestTask.new(:newrelic) do |t|
data/newrelic.yml CHANGED
@@ -102,7 +102,7 @@ common: &default_settings
102
102
  # Specify a list of constants that should prevent the agent from starting
103
103
  # automatically. Separate individual constants with a comma ,. For example,
104
104
  # "Rails::Console,UninstrumentedBackgroundJob".
105
- # autostart.denylisted_constants: Rails::Console
105
+ # autostart.denylisted_constants: Rails::Command::ConsoleCommand,Rails::Command::CredentialsCommand,Rails::Command::Db::System::ChangeCommand,Rails::Command::DbConsoleCommand,Rails::Command::DestroyCommand,Rails::Command::DevCommand,Rails::Command::EncryptedCommand,Rails::Command::GenerateCommand,Rails::Command::InitializersCommand,Rails::Command::NotesCommand,Rails::Command::RoutesCommand,Rails::Command::SecretsCommand,Rails::Console,Rails::DBConsole
106
106
 
107
107
  # Defines a comma-delimited list of executables that the agent should not
108
108
  # instrument. For example, "rake,my_ruby_script.rb".
@@ -374,39 +374,51 @@ common: &default_settings
374
374
  # Configures the TCP/IP port for the trace observer Host
375
375
  # infinite_tracing.trace_observer.port: 443
376
376
 
377
+ # Controls auto-instrumentation of ActiveSupport::BroadcastLogger at start up. May
378
+ # be one of: auto, prepend, chain, disabled. Used in Rails versions >= 7.1.
379
+ # instrumentation.active_support_broadcast_logger: auto
380
+
377
381
  # Controls auto-instrumentation of ActiveSupport::Logger at start up. May be one
378
- # of: auto, prepend, chain, disabled.
382
+ # of: auto, prepend, chain, disabled. Used in Rails versions below 7.1.
379
383
  # instrumentation.active_support_logger: auto
380
384
 
381
- # Controls auto-instrumentation of bunny at start up. May be one of: auto,
385
+ # Controls auto-instrumentation of Async::HTTP at start up. May be one of: auto,
386
+ # prepend, chain, disabled.
387
+ # instrumentation.async_http: auto
388
+
389
+ # Controls auto-instrumentation of bunny at start-up. May be one of: auto,
382
390
  # prepend, chain, disabled.
383
391
  # instrumentation.bunny: auto
384
392
 
385
- # Controls auto-instrumentation of the concurrent-ruby library at start up. May be
393
+ # Controls auto-instrumentation of the concurrent-ruby library at start-up. May be
386
394
  # one of: auto, prepend, chain, disabled.
387
395
  # instrumentation.concurrent_ruby: auto
388
396
 
389
- # Controls auto-instrumentation of Curb at start up. May be one of: auto, prepend,
397
+ # Controls auto-instrumentation of Curb at start-up. May be one of: auto, prepend,
390
398
  # chain, disabled.
391
399
  # instrumentation.curb: auto
392
400
 
393
- # Controls auto-instrumentation of Delayed Job at start up. May be one of: auto,
401
+ # Controls auto-instrumentation of Delayed Job at start-up. May be one of: auto,
394
402
  # prepend, chain, disabled.
395
403
  # instrumentation.delayed_job: auto
396
404
 
397
- # Controls auto-instrumentation of the elasticsearch library at start up. May be
405
+ # Controls auto-instrumentation of the elasticsearch library at start-up. May be
398
406
  # one of: auto, prepend, chain, disabled.
399
407
  # instrumentation.elasticsearch: auto
400
408
 
401
- # Controls auto-instrumentation of Excon at start up. May be one of: enabled,
409
+ # Controls auto-instrumentation of ethon at start up. May be one of
410
+ # [auto|prepend|chain|disabled]
411
+ # instrumentation.ethon: auto
412
+
413
+ # Controls auto-instrumentation of Excon at start-up. May be one of: enabled,
402
414
  # disabled.
403
415
  # instrumentation.excon: enabled
404
416
 
405
- # Controls auto-instrumentation of the Fiber class at start up. May be one of:
417
+ # Controls auto-instrumentation of the Fiber class at start-up. May be one of:
406
418
  # auto, prepend, chain, disabled.
407
419
  # instrumentation.fiber: auto
408
420
 
409
- # Controls auto-instrumentation of Grape at start up. May be one of: auto,
421
+ # Controls auto-instrumentation of Grape at start-up. May be one of: auto,
410
422
  # prepend, chain, disabled.
411
423
  # instrumentation.grape: auto
412
424
 
@@ -419,43 +431,47 @@ common: &default_settings
419
431
  # example, "private.com$,exception.*"
420
432
  # instrumentation.grpc.host_denylist: []
421
433
 
422
- # Controls auto-instrumentation of gRPC clients at start up. May be one of: auto,
434
+ # Controls auto-instrumentation of gRPC clients at start-up. May be one of: auto,
423
435
  # prepend, chain, disabled.
424
436
  # instrumentation.grpc_client: auto
425
437
 
426
- # Controls auto-instrumentation of gRPC servers at start up. May be one of: auto,
438
+ # Controls auto-instrumentation of gRPC servers at start-up. May be one of: auto,
427
439
  # prepend, chain, disabled.
428
440
  # instrumentation.grpc_server: auto
429
441
 
430
- # Controls auto-instrumentation of HTTPClient at start up. May be one of: auto,
442
+ # Controls auto-instrumentation of HTTPClient at start-up. May be one of: auto,
431
443
  # prepend, chain, disabled.
432
444
  # instrumentation.httpclient: auto
433
445
 
434
- # Controls auto-instrumentation of http.rb gem at start up. May be one of: auto,
446
+ # Controls auto-instrumentation of http.rb gem at start-up. May be one of: auto,
435
447
  # prepend, chain, disabled.
436
448
  # instrumentation.httprb: auto
437
449
 
438
- # Controls auto-instrumentation of Ruby standard library Logger at start up. May
450
+ # Controls auto-instrumentation of httpx at start up. May be one of
451
+ # [auto|prepend|chain|disabled]
452
+ # instrumentation.httpx: auto
453
+
454
+ # Controls auto-instrumentation of Ruby standard library Logger at start-up. May
439
455
  # be one of: auto, prepend, chain, disabled.
440
456
  # instrumentation.logger: auto
441
457
 
442
- # Controls auto-instrumentation of dalli gem for Memcache at start up. May be one
458
+ # Controls auto-instrumentation of dalli gem for Memcache at start-up. May be one
443
459
  # of: auto, prepend, chain, disabled.
444
460
  # instrumentation.memcache: auto
445
461
 
446
- # Controls auto-instrumentation of memcache-client gem for Memcache at start up.
462
+ # Controls auto-instrumentation of memcache-client gem for Memcache at start-up.
447
463
  # May be one of: auto, prepend, chain, disabled.
448
464
  # instrumentation.memcache_client: auto
449
465
 
450
- # Controls auto-instrumentation of memcached gem for Memcache at start up. May be
466
+ # Controls auto-instrumentation of memcached gem for Memcache at start-up. May be
451
467
  # one of: auto, prepend, chain, disabled.
452
468
  # instrumentation.memcached: auto
453
469
 
454
- # Controls auto-instrumentation of Mongo at start up. May be one of: enabled,
470
+ # Controls auto-instrumentation of Mongo at start-up. May be one of: enabled,
455
471
  # disabled.
456
472
  # instrumentation.mongo: enabled
457
473
 
458
- # Controls auto-instrumentation of Net::HTTP at start up. May be one of: auto,
474
+ # Controls auto-instrumentation of Net::HTTP at start-up. May be one of: auto,
459
475
  # prepend, chain, disabled.
460
476
  # instrumentation.net_http: auto
461
477
 
@@ -464,7 +480,7 @@ common: &default_settings
464
480
  # application startup. May be one of: auto, prepend, chain, disabled.
465
481
  # instrumentation.puma_rack: auto
466
482
 
467
- # Controls auto-instrumentation of Puma::Rack::URLMap at start up. May be one of:
483
+ # Controls auto-instrumentation of Puma::Rack::URLMap at start-up. May be one of:
468
484
  # auto, prepend, chain, disabled.
469
485
  # instrumentation.puma_rack_urlmap: auto
470
486
 
@@ -473,27 +489,27 @@ common: &default_settings
473
489
  # startup. May be one of: auto, prepend, chain, disabled.
474
490
  # instrumentation.rack: auto
475
491
 
476
- # Controls auto-instrumentation of Rack::URLMap at start up. May be one of: auto,
492
+ # Controls auto-instrumentation of Rack::URLMap at start-up. May be one of: auto,
477
493
  # prepend, chain, disabled.
478
494
  # instrumentation.rack_urlmap: auto
479
495
 
480
- # Controls auto-instrumentation of rake at start up. May be one of: auto, prepend,
496
+ # Controls auto-instrumentation of rake at start-up. May be one of: auto, prepend,
481
497
  # chain, disabled.
482
498
  # instrumentation.rake: auto
483
499
 
484
- # Controls auto-instrumentation of Redis at start up. May be one of: auto,
500
+ # Controls auto-instrumentation of Redis at start-up. May be one of: auto,
485
501
  # prepend, chain, disabled.
486
502
  # instrumentation.redis: auto
487
503
 
488
- # Controls auto-instrumentation of resque at start up. May be one of: auto,
504
+ # Controls auto-instrumentation of resque at start-up. May be one of: auto,
489
505
  # prepend, chain, disabled.
490
506
  # instrumentation.resque: auto
491
507
 
492
- # Controls auto-instrumentation of Roda at start up. May be one of: auto, prepend,
508
+ # Controls auto-instrumentation of Roda at start-up. May be one of: auto, prepend,
493
509
  # chain, disabled.
494
510
  # instrumentation.roda: auto
495
511
 
496
- # Controls auto-instrumentation of Sinatra at start up. May be one of: auto,
512
+ # Controls auto-instrumentation of Sinatra at start-up. May be one of: auto,
497
513
  # prepend, chain, disabled.
498
514
  # instrumentation.sinatra: auto
499
515
 
@@ -501,21 +517,21 @@ common: &default_settings
501
517
  # disabled.
502
518
  # instrumentation.stripe: enabled
503
519
 
504
- # Controls auto-instrumentation of the Thread class at start up to allow the agent
520
+ # Controls auto-instrumentation of the Thread class at start-up to allow the agent
505
521
  # to correctly nest spans inside of an asynchronous transaction. This does not
506
522
  # enable the agent to automatically trace all threads created (see
507
523
  # instrumentation.thread.tracing). May be one of: auto, prepend, chain, disabled.
508
524
  # instrumentation.thread: auto
509
525
 
510
- # Controls auto-instrumentation of the Thread class at start up to automatically
526
+ # Controls auto-instrumentation of the Thread class at start-up to automatically
511
527
  # add tracing to all Threads created in the application.
512
528
  # instrumentation.thread.tracing: true
513
529
 
514
- # Controls auto-instrumentation of the Tilt template rendering library at start
515
- # up. May be one of: auto, prepend, chain, disabled.
530
+ # Controls auto-instrumentation of the Tilt template rendering library at
531
+ # start-up. May be one of: auto, prepend, chain, disabled.
516
532
  # instrumentation.tilt: auto
517
533
 
518
- # Controls auto-instrumentation of Typhoeus at start up. May be one of: auto,
534
+ # Controls auto-instrumentation of Typhoeus at start-up. May be one of: auto,
519
535
  # prepend, chain, disabled.
520
536
  # instrumentation.typhoeus: auto
521
537
 
@@ -668,7 +684,7 @@ common: &default_settings
668
684
  # Regexp.new to permit advanced matching. For each hash pair, if either the key or
669
685
  # value is matched the
670
686
  # pair will not be reported. By default, no user_data is reported, so this option
671
- # should only be used if
687
+ # should only be used if
672
688
  # the stripe.user_data.include option is being used.
673
689
  # stripe.user_data.exclude: []
674
690
 
data/newrelic_rpm.gemspec CHANGED
@@ -49,13 +49,16 @@ Gem::Specification.new do |s|
49
49
  s.homepage = 'https://github.com/newrelic/newrelic-ruby-agent'
50
50
  s.require_paths = ['lib']
51
51
  s.summary = 'New Relic Ruby Agent'
52
+
53
+ s.add_dependency 'base64'
54
+
52
55
  s.add_development_dependency 'bundler'
53
56
  s.add_development_dependency 'feedjira', '3.2.1' unless ENV['CI'] || RUBY_VERSION < '2.5' # for Gabby
54
57
  s.add_development_dependency 'httparty' unless ENV['CI'] # for perf tests and Gabby
55
58
  s.add_development_dependency 'minitest', "#{RUBY_VERSION >= '2.7.0' ? '5.3.3' : '4.7.5'}"
56
59
  s.add_development_dependency 'minitest-stub-const', '0.6'
57
60
  s.add_development_dependency 'mocha', '~> 1.16'
58
- s.add_development_dependency 'pry' unless ENV['CI']
61
+ s.add_development_dependency 'pry' if ENV['ENABLE_PRY']
59
62
  s.add_development_dependency 'rack'
60
63
  s.add_development_dependency 'rake', '12.3.3'
61
64
 
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.5.0
4
+ version: 9.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tanna McClure
@@ -11,8 +11,22 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2023-09-12 00:00:00.000000000 Z
14
+ date: 2023-10-30 00:00:00.000000000 Z
15
15
  dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: base64
18
+ requirement: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: '0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
16
30
  - !ruby/object:Gem::Dependency
17
31
  name: bundler
18
32
  requirement: !ruby/object:Gem::Requirement
@@ -317,10 +331,13 @@ files:
317
331
  - lib/new_relic/agent/heap.rb
318
332
  - lib/new_relic/agent/hostname.rb
319
333
  - lib/new_relic/agent/http_clients/abstract.rb
334
+ - lib/new_relic/agent/http_clients/async_http_wrappers.rb
320
335
  - lib/new_relic/agent/http_clients/curb_wrappers.rb
336
+ - lib/new_relic/agent/http_clients/ethon_wrappers.rb
321
337
  - lib/new_relic/agent/http_clients/excon_wrappers.rb
322
338
  - lib/new_relic/agent/http_clients/http_rb_wrappers.rb
323
339
  - lib/new_relic/agent/http_clients/httpclient_wrappers.rb
340
+ - lib/new_relic/agent/http_clients/httpx_wrappers.rb
324
341
  - lib/new_relic/agent/http_clients/net_http_wrappers.rb
325
342
  - lib/new_relic/agent/http_clients/typhoeus_wrappers.rb
326
343
  - lib/new_relic/agent/http_clients/uri_util.rb
@@ -346,11 +363,19 @@ files:
346
363
  - lib/new_relic/agent/instrumentation/active_storage.rb
347
364
  - lib/new_relic/agent/instrumentation/active_storage_subscriber.rb
348
365
  - lib/new_relic/agent/instrumentation/active_support.rb
366
+ - lib/new_relic/agent/instrumentation/active_support_broadcast_logger.rb
367
+ - lib/new_relic/agent/instrumentation/active_support_broadcast_logger/chain.rb
368
+ - lib/new_relic/agent/instrumentation/active_support_broadcast_logger/instrumentation.rb
369
+ - lib/new_relic/agent/instrumentation/active_support_broadcast_logger/prepend.rb
349
370
  - lib/new_relic/agent/instrumentation/active_support_logger.rb
350
371
  - lib/new_relic/agent/instrumentation/active_support_logger/chain.rb
351
372
  - lib/new_relic/agent/instrumentation/active_support_logger/instrumentation.rb
352
373
  - lib/new_relic/agent/instrumentation/active_support_logger/prepend.rb
353
374
  - lib/new_relic/agent/instrumentation/active_support_subscriber.rb
375
+ - lib/new_relic/agent/instrumentation/async_http.rb
376
+ - lib/new_relic/agent/instrumentation/async_http/chain.rb
377
+ - lib/new_relic/agent/instrumentation/async_http/instrumentation.rb
378
+ - lib/new_relic/agent/instrumentation/async_http/prepend.rb
354
379
  - lib/new_relic/agent/instrumentation/bunny.rb
355
380
  - lib/new_relic/agent/instrumentation/bunny/chain.rb
356
381
  - lib/new_relic/agent/instrumentation/bunny/instrumentation.rb
@@ -374,6 +399,10 @@ files:
374
399
  - lib/new_relic/agent/instrumentation/elasticsearch/chain.rb
375
400
  - lib/new_relic/agent/instrumentation/elasticsearch/instrumentation.rb
376
401
  - lib/new_relic/agent/instrumentation/elasticsearch/prepend.rb
402
+ - lib/new_relic/agent/instrumentation/ethon.rb
403
+ - lib/new_relic/agent/instrumentation/ethon/chain.rb
404
+ - lib/new_relic/agent/instrumentation/ethon/instrumentation.rb
405
+ - lib/new_relic/agent/instrumentation/ethon/prepend.rb
377
406
  - lib/new_relic/agent/instrumentation/excon.rb
378
407
  - lib/new_relic/agent/instrumentation/excon/middleware.rb
379
408
  - lib/new_relic/agent/instrumentation/fiber.rb
@@ -403,6 +432,10 @@ files:
403
432
  - lib/new_relic/agent/instrumentation/httprb/chain.rb
404
433
  - lib/new_relic/agent/instrumentation/httprb/instrumentation.rb
405
434
  - lib/new_relic/agent/instrumentation/httprb/prepend.rb
435
+ - lib/new_relic/agent/instrumentation/httpx.rb
436
+ - lib/new_relic/agent/instrumentation/httpx/chain.rb
437
+ - lib/new_relic/agent/instrumentation/httpx/instrumentation.rb
438
+ - lib/new_relic/agent/instrumentation/httpx/prepend.rb
406
439
  - lib/new_relic/agent/instrumentation/ignore_actions.rb
407
440
  - lib/new_relic/agent/instrumentation/logger.rb
408
441
  - lib/new_relic/agent/instrumentation/logger/chain.rb
@@ -457,6 +490,7 @@ files:
457
490
  - lib/new_relic/agent/instrumentation/resque/prepend.rb
458
491
  - lib/new_relic/agent/instrumentation/roda.rb
459
492
  - lib/new_relic/agent/instrumentation/roda/chain.rb
493
+ - lib/new_relic/agent/instrumentation/roda/ignorer.rb
460
494
  - lib/new_relic/agent/instrumentation/roda/instrumentation.rb
461
495
  - lib/new_relic/agent/instrumentation/roda/prepend.rb
462
496
  - lib/new_relic/agent/instrumentation/roda/roda_transaction_namer.rb