newrelic_rpm 6.15.0 → 8.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/CHANGELOG.md +260 -22
  4. data/CONTRIBUTING.md +13 -2
  5. data/README.md +4 -2
  6. data/lib/new_relic/agent/adaptive_sampler.rb +2 -2
  7. data/lib/new_relic/agent/agent.rb +8 -7
  8. data/lib/new_relic/agent/autostart.rb +1 -2
  9. data/lib/new_relic/agent/commands/thread_profiler_session.rb +7 -3
  10. data/lib/new_relic/agent/configuration/default_source.rb +456 -233
  11. data/lib/new_relic/agent/configuration/event_harvest_config.rb +28 -12
  12. data/lib/new_relic/agent/configuration/manager.rb +3 -4
  13. data/lib/new_relic/agent/configuration/server_source.rb +3 -2
  14. data/lib/new_relic/agent/configuration/yaml_source.rb +22 -1
  15. data/lib/new_relic/agent/connect/request_builder.rb +4 -2
  16. data/lib/new_relic/agent/custom_event_aggregator.rb +2 -1
  17. data/lib/new_relic/agent/database.rb +5 -2
  18. data/lib/new_relic/agent/datastores/mongo.rb +5 -10
  19. data/lib/new_relic/agent/datastores/redis.rb +0 -4
  20. data/lib/new_relic/agent/datastores.rb +7 -7
  21. data/lib/new_relic/agent/distributed_tracing/cross_app_payload.rb +5 -5
  22. data/lib/new_relic/agent/distributed_tracing/cross_app_tracing.rb +10 -6
  23. data/lib/new_relic/agent/distributed_tracing/distributed_trace_attributes.rb +0 -1
  24. data/lib/new_relic/agent/distributed_tracing/distributed_trace_payload.rb +1 -1
  25. data/lib/new_relic/agent/distributed_tracing/trace_context_payload.rb +1 -1
  26. data/lib/new_relic/agent/distributed_tracing.rb +0 -66
  27. data/lib/new_relic/agent/error_collector.rb +52 -37
  28. data/lib/new_relic/agent/error_filter.rb +167 -0
  29. data/lib/new_relic/agent/event_loop.rb +6 -6
  30. data/lib/new_relic/agent/external.rb +0 -32
  31. data/lib/new_relic/agent/http_clients/abstract.rb +2 -2
  32. data/lib/new_relic/agent/instrumentation/action_controller_subscriber.rb +1 -1
  33. data/lib/new_relic/agent/instrumentation/active_merchant.rb +3 -3
  34. data/lib/new_relic/agent/instrumentation/active_record_notifications.rb +0 -16
  35. data/lib/new_relic/agent/instrumentation/active_record_subscriber.rb +1 -3
  36. data/lib/new_relic/agent/instrumentation/bunny/chain.rb +45 -0
  37. data/lib/new_relic/agent/instrumentation/bunny/instrumentation.rb +152 -0
  38. data/lib/new_relic/agent/instrumentation/bunny/prepend.rb +35 -0
  39. data/lib/new_relic/agent/instrumentation/bunny.rb +10 -152
  40. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +2 -1
  41. data/lib/new_relic/agent/instrumentation/curb/chain.rb +93 -0
  42. data/lib/new_relic/agent/instrumentation/curb/instrumentation.rb +222 -0
  43. data/lib/new_relic/agent/instrumentation/curb/prepend.rb +63 -0
  44. data/lib/new_relic/agent/instrumentation/curb.rb +9 -241
  45. data/lib/new_relic/agent/instrumentation/delayed_job/chain.rb +38 -0
  46. data/lib/new_relic/agent/instrumentation/delayed_job/instrumentation.rb +53 -0
  47. data/lib/new_relic/agent/instrumentation/delayed_job/prepend.rb +34 -0
  48. data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +8 -50
  49. data/lib/new_relic/agent/instrumentation/excon.rb +4 -22
  50. data/lib/new_relic/agent/instrumentation/grape/chain.rb +25 -0
  51. data/lib/new_relic/agent/instrumentation/grape/instrumentation.rb +100 -0
  52. data/lib/new_relic/agent/instrumentation/grape/prepend.rb +17 -0
  53. data/lib/new_relic/agent/instrumentation/grape.rb +13 -113
  54. data/lib/new_relic/agent/instrumentation/httpclient/chain.rb +25 -0
  55. data/lib/new_relic/agent/instrumentation/httpclient/instrumentation.rb +38 -0
  56. data/lib/new_relic/agent/instrumentation/httpclient/prepend.rb +17 -0
  57. data/lib/new_relic/agent/instrumentation/httpclient.rb +8 -30
  58. data/lib/new_relic/agent/instrumentation/httprb/chain.rb +22 -0
  59. data/lib/new_relic/agent/instrumentation/httprb/instrumentation.rb +30 -0
  60. data/lib/new_relic/agent/instrumentation/httprb/prepend.rb +15 -0
  61. data/lib/new_relic/agent/instrumentation/httprb.rb +29 -0
  62. data/lib/new_relic/agent/instrumentation/memcache/chain.rb +16 -0
  63. data/lib/new_relic/agent/instrumentation/memcache/dalli.rb +38 -121
  64. data/lib/new_relic/agent/instrumentation/memcache/helper.rb +56 -0
  65. data/lib/new_relic/agent/instrumentation/memcache/instrumentation.rb +88 -0
  66. data/lib/new_relic/agent/instrumentation/memcache/prepend.rb +88 -0
  67. data/lib/new_relic/agent/instrumentation/memcache.rb +54 -69
  68. data/lib/new_relic/agent/instrumentation/middleware_proxy.rb +2 -0
  69. data/lib/new_relic/agent/instrumentation/mongo.rb +3 -134
  70. data/lib/new_relic/agent/instrumentation/net_http/chain.rb +25 -0
  71. data/lib/new_relic/agent/instrumentation/{net_prepend.rb → net_http/instrumentation.rb} +3 -3
  72. data/lib/new_relic/agent/instrumentation/net_http/prepend.rb +21 -0
  73. data/lib/new_relic/agent/instrumentation/net_http.rb +44 -0
  74. data/lib/new_relic/agent/instrumentation/padrino/chain.rb +34 -0
  75. data/lib/new_relic/agent/instrumentation/padrino/instrumentation.rb +27 -0
  76. data/lib/new_relic/agent/instrumentation/padrino/prepend.rb +20 -0
  77. data/lib/new_relic/agent/instrumentation/padrino.rb +18 -53
  78. data/lib/new_relic/agent/instrumentation/queue_time.rb +4 -4
  79. data/lib/new_relic/agent/instrumentation/rack/chain.rb +58 -0
  80. data/lib/new_relic/agent/instrumentation/rack/helpers.rb +32 -0
  81. data/lib/new_relic/agent/instrumentation/rack/instrumentation.rb +73 -0
  82. data/lib/new_relic/agent/instrumentation/rack/prepend.rb +37 -0
  83. data/lib/new_relic/agent/instrumentation/rack.rb +29 -139
  84. data/lib/new_relic/agent/instrumentation/rails/action_controller.rb +5 -5
  85. data/lib/new_relic/agent/instrumentation/rails/action_web_service.rb +1 -1
  86. data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +5 -41
  87. data/lib/new_relic/agent/instrumentation/rake/chain.rb +25 -0
  88. data/lib/new_relic/agent/instrumentation/rake/instrumentation.rb +144 -0
  89. data/lib/new_relic/agent/instrumentation/rake/prepend.rb +14 -0
  90. data/lib/new_relic/agent/instrumentation/rake.rb +13 -154
  91. data/lib/new_relic/agent/instrumentation/redis/chain.rb +34 -0
  92. data/lib/new_relic/agent/instrumentation/redis/instrumentation.rb +65 -0
  93. data/lib/new_relic/agent/instrumentation/redis/prepend.rb +24 -0
  94. data/lib/new_relic/agent/instrumentation/redis.rb +12 -107
  95. data/lib/new_relic/agent/instrumentation/resque/chain.rb +22 -0
  96. data/lib/new_relic/agent/instrumentation/resque/helper.rb +19 -0
  97. data/lib/new_relic/agent/instrumentation/resque/instrumentation.rb +35 -0
  98. data/lib/new_relic/agent/instrumentation/resque/prepend.rb +16 -0
  99. data/lib/new_relic/agent/instrumentation/resque.rb +21 -32
  100. data/lib/new_relic/agent/instrumentation/sidekiq.rb +6 -1
  101. data/lib/new_relic/agent/instrumentation/sinatra/chain.rb +55 -0
  102. data/lib/new_relic/agent/instrumentation/sinatra/ignorer.rb +29 -34
  103. data/lib/new_relic/agent/instrumentation/sinatra/instrumentation.rb +124 -0
  104. data/lib/new_relic/agent/instrumentation/sinatra/prepend.rb +33 -0
  105. data/lib/new_relic/agent/instrumentation/sinatra.rb +20 -158
  106. data/lib/new_relic/agent/instrumentation/typhoeus/chain.rb +22 -0
  107. data/lib/new_relic/agent/instrumentation/typhoeus/instrumentation.rb +82 -0
  108. data/lib/new_relic/agent/instrumentation/typhoeus/prepend.rb +14 -0
  109. data/lib/new_relic/agent/instrumentation/typhoeus.rb +10 -89
  110. data/lib/new_relic/agent/javascript_instrumentor.rb +15 -10
  111. data/lib/new_relic/agent/messaging.rb +10 -24
  112. data/lib/new_relic/agent/method_tracer.rb +132 -138
  113. data/lib/new_relic/agent/monitors/cross_app_monitor.rb +6 -1
  114. data/lib/new_relic/agent/new_relic_service.rb +24 -22
  115. data/lib/new_relic/agent/pipe_channel_manager.rb +10 -6
  116. data/lib/new_relic/agent/pipe_service.rb +1 -1
  117. data/lib/new_relic/agent/samplers/cpu_sampler.rb +1 -1
  118. data/lib/new_relic/agent/span_event_aggregator.rb +2 -2
  119. data/lib/new_relic/agent/sql_sampler.rb +4 -4
  120. data/lib/new_relic/agent/stats_engine/stats_hash.rb +1 -1
  121. data/lib/new_relic/agent/stats_engine.rb +1 -1
  122. data/lib/new_relic/agent/supported_versions.rb +1 -1
  123. data/lib/new_relic/agent/threading/backtrace_service.rb +4 -5
  124. data/lib/new_relic/agent/threading/thread_profile.rb +1 -1
  125. data/lib/new_relic/agent/tracer.rb +15 -37
  126. data/lib/new_relic/agent/transaction/abstract_segment.rb +3 -3
  127. data/lib/new_relic/agent/transaction/message_broker_segment.rb +5 -11
  128. data/lib/new_relic/agent/transaction.rb +8 -32
  129. data/lib/new_relic/agent/transaction_time_aggregator.rb +5 -5
  130. data/lib/new_relic/agent/vm/snapshot.rb +1 -1
  131. data/lib/new_relic/agent/worker_loop.rb +5 -5
  132. data/lib/new_relic/agent.rb +10 -13
  133. data/lib/new_relic/cli/commands/deployments.rb +2 -2
  134. data/lib/new_relic/constants.rb +0 -4
  135. data/lib/new_relic/control/frameworks/rails.rb +11 -9
  136. data/lib/new_relic/control/instance_methods.rb +1 -0
  137. data/lib/new_relic/dependency_detection.rb +116 -10
  138. data/lib/new_relic/noticed_error.rb +5 -9
  139. data/lib/new_relic/supportability_helper.rb +1 -2
  140. data/lib/new_relic/version.rb +2 -2
  141. data/lib/newrelic_rpm.rb +10 -34
  142. data/lib/tasks/all.rb +1 -1
  143. data/lib/tasks/config.html.erb +14 -25
  144. data/lib/tasks/config.rake +8 -7
  145. data/newrelic.yml +593 -3
  146. data/newrelic_rpm.gemspec +1 -1
  147. data/test/agent_helper.rb +27 -2
  148. metadata +56 -14
  149. data/cert/cacert.pem +0 -1177
  150. data/lib/new_relic/agent/datastores/mongo/statement_formatter.rb +0 -53
  151. data/lib/new_relic/agent/instrumentation/excon/connection.rb +0 -49
  152. data/lib/new_relic/agent/instrumentation/http.rb +0 -49
  153. data/lib/new_relic/agent/instrumentation/merb/controller.rb +0 -44
  154. data/lib/new_relic/agent/instrumentation/merb/errors.rb +0 -33
  155. data/lib/new_relic/agent/instrumentation/net.rb +0 -70
  156. data/lib/new_relic/control/frameworks/merb.rb +0 -29
@@ -0,0 +1,82 @@
1
+ # encoding: utf-8
2
+ # This file is distributed under New Relic's license terms.
3
+ # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
4
+
5
+ module NewRelic
6
+ module Agent
7
+ module Instrumentation
8
+ module Typhoeus
9
+
10
+ HYDRA_SEGMENT_NAME = "External/Multiple/Typhoeus::Hydra/run"
11
+ NOTICIBLE_ERROR_CLASS = "Typhoeus::Errors::TyphoeusError"
12
+
13
+ EARLIEST_VERSION = Gem::Version.new("0.5.3")
14
+
15
+ def self.is_supported_version?
16
+ Gem::Version.new(::Typhoeus::VERSION) >= EARLIEST_VERSION
17
+ end
18
+
19
+ def self.request_is_hydra_enabled?(request)
20
+ request.respond_to?(:hydra) && request.hydra
21
+ end
22
+
23
+ def self.response_message(response)
24
+ if response.respond_to?(:response_message)
25
+ response.response_message
26
+ elsif response.respond_to?(:return_message)
27
+ response.return_message
28
+ else
29
+ # 0.5.4 seems to have lost xxxx_message methods altogether.
30
+ "timeout"
31
+ end
32
+ end
33
+
34
+ def with_tracing
35
+ segment = NewRelic::Agent::Tracer.start_segment name: HYDRA_SEGMENT_NAME
36
+ instance_variable_set :@__newrelic_hydra_segment, segment
37
+ begin
38
+ yield
39
+ ensure
40
+ segment.finish if segment
41
+ end
42
+ end
43
+
44
+ def self.trace(request)
45
+ state = NewRelic::Agent::Tracer.state
46
+ return unless state.is_execution_traced?
47
+
48
+ wrapped_request = ::NewRelic::Agent::HTTPClients::TyphoeusHTTPRequest.new(request)
49
+
50
+ parent = if request_is_hydra_enabled?(request)
51
+ request.hydra.instance_variable_get(:@__newrelic_hydra_segment)
52
+ end
53
+
54
+ segment = NewRelic::Agent::Tracer.start_external_request_segment(
55
+ library: wrapped_request.type,
56
+ uri: wrapped_request.uri,
57
+ procedure: wrapped_request.method,
58
+ parent: parent
59
+ )
60
+
61
+ segment.add_request_headers wrapped_request
62
+
63
+ callback = Proc.new do
64
+ wrapped_response = HTTPClients::TyphoeusHTTPResponse.new(request.response)
65
+
66
+ segment.process_response_headers wrapped_response
67
+
68
+ if request.response.code == 0
69
+ segment.notice_error NoticibleError.new NOTICIBLE_ERROR_CLASS, response_message(request.response)
70
+ end
71
+
72
+ segment.finish if segment
73
+ end
74
+ request.on_complete.unshift(callback)
75
+
76
+ rescue => e
77
+ NewRelic::Agent.logger.error("Exception during trace setup for Typhoeus request", e)
78
+ end
79
+ end
80
+ end
81
+ end
82
+ end
@@ -0,0 +1,14 @@
1
+ # encoding: utf-8
2
+ # This file is distributed under New Relic's license terms.
3
+ # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
4
+
5
+ module NewRelic::Agent::Instrumentation
6
+ module Typhoeus
7
+ module Prepend
8
+ include NewRelic::Agent::Instrumentation::Typhoeus
9
+ def run(*args)
10
+ with_tracing { super }
11
+ end
12
+ end
13
+ end
14
+ end
@@ -2,6 +2,10 @@
2
2
  # This file is distributed under New Relic's license terms.
3
3
  # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
4
4
 
5
+ require_relative 'typhoeus/instrumentation'
6
+ require_relative 'typhoeus/chain'
7
+ require_relative 'typhoeus/prepend'
8
+
5
9
  DependencyDetection.defer do
6
10
  named :typhoeus
7
11
 
@@ -10,7 +14,7 @@ DependencyDetection.defer do
10
14
  end
11
15
 
12
16
  depends_on do
13
- NewRelic::Agent::Instrumentation::TyphoeusTracing.is_supported_version?
17
+ NewRelic::Agent::Instrumentation::Typhoeus.is_supported_version?
14
18
  end
15
19
 
16
20
  executes do
@@ -22,7 +26,7 @@ DependencyDetection.defer do
22
26
  # Basic request tracing
23
27
  executes do
24
28
  Typhoeus.before do |request|
25
- NewRelic::Agent::Instrumentation::TyphoeusTracing.trace(request)
29
+ NewRelic::Agent::Instrumentation::Typhoeus.trace(request)
26
30
 
27
31
  # Ensure that we always return a truthy value from the before block,
28
32
  # otherwise Typhoeus will bail out of the instrumentation.
@@ -32,93 +36,10 @@ DependencyDetection.defer do
32
36
 
33
37
  # Apply single TT node for Hydra requests until async support
34
38
  executes do
35
- class Typhoeus::Hydra
36
-
37
- def run_with_newrelic(*args)
38
- segment = NewRelic::Agent::Tracer.start_segment(
39
- name: NewRelic::Agent::Instrumentation::TyphoeusTracing::HYDRA_SEGMENT_NAME
40
- )
41
-
42
- instance_variable_set :@__newrelic_hydra_segment, segment
43
-
44
- begin
45
- run_without_newrelic(*args)
46
- ensure
47
- segment.finish if segment
48
- end
49
- end
50
-
51
- alias run_without_newrelic run
52
- alias run run_with_newrelic
53
- end
54
- end
55
- end
56
-
57
-
58
- module NewRelic
59
- module Agent
60
- module Instrumentation
61
- module TyphoeusTracing
62
-
63
- HYDRA_SEGMENT_NAME = "External/Multiple/Typhoeus::Hydra/run"
64
- NOTICIBLE_ERROR_CLASS = "Typhoeus::Errors::TyphoeusError"
65
-
66
- EARLIEST_VERSION = Gem::Version.new("0.5.3")
67
- def self.is_supported_version?
68
- Gem::Version.new(Typhoeus::VERSION) >= NewRelic::Agent::Instrumentation::TyphoeusTracing::EARLIEST_VERSION
69
- end
70
-
71
- def self.request_is_hydra_enabled?(request)
72
- request.respond_to?(:hydra) && request.hydra
73
- end
74
-
75
- def self.response_message(response)
76
- if response.respond_to?(:response_message)
77
- response.response_message
78
- elsif response.respond_to?(:return_message)
79
- response.return_message
80
- else
81
- # 0.5.4 seems to have lost xxxx_message methods altogether.
82
- "timeout"
83
- end
84
- end
85
-
86
- def self.trace(request)
87
- state = NewRelic::Agent::Tracer.state
88
- return unless state.is_execution_traced?
89
-
90
- wrapped_request = ::NewRelic::Agent::HTTPClients::TyphoeusHTTPRequest.new(request)
91
-
92
- parent = if request_is_hydra_enabled?(request)
93
- request.hydra.instance_variable_get(:@__newrelic_hydra_segment)
94
- end
95
-
96
- segment = NewRelic::Agent::Tracer.start_external_request_segment(
97
- library: wrapped_request.type,
98
- uri: wrapped_request.uri,
99
- procedure: wrapped_request.method,
100
- parent: parent
101
- )
102
-
103
- segment.add_request_headers wrapped_request
104
-
105
- callback = Proc.new do
106
- wrapped_response = HTTPClients::TyphoeusHTTPResponse.new(request.response)
107
-
108
- segment.process_response_headers wrapped_response
109
-
110
- if request.response.code == 0
111
- segment.notice_error NoticibleError.new NOTICIBLE_ERROR_CLASS, response_message(request.response)
112
- end
113
-
114
- segment.finish if segment
115
- end
116
- request.on_complete.unshift(callback)
117
-
118
- rescue => e
119
- NewRelic::Agent.logger.error("Exception during trace setup for Typhoeus request", e)
120
- end
121
- end
39
+ if use_prepend?
40
+ prepend_instrument Typhoeus::Hydra, NewRelic::Agent::Instrumentation::Typhoeus::Prepend
41
+ else
42
+ chain_instrument NewRelic::Agent::Instrumentation::Typhoeus::Chain
122
43
  end
123
44
  end
124
45
  end
@@ -83,39 +83,44 @@ module NewRelic
83
83
  value.nil? || value.empty?
84
84
  end
85
85
 
86
- def browser_timing_header #THREAD_LOCAL_ACCESS
86
+ def browser_timing_header(nonce=nil) #THREAD_LOCAL_ACCESS
87
87
  return '' unless js_enabled_and_ready? # fast exit
88
88
 
89
89
  state = NewRelic::Agent::Tracer.state
90
90
 
91
91
  return '' unless insert_js?(state) # slower exit
92
92
 
93
- bt_config = browser_timing_config(state)
93
+ bt_config = browser_timing_config(state, nonce)
94
94
  return '' if bt_config.empty?
95
95
 
96
- bt_config + browser_timing_loader
96
+ bt_config + browser_timing_loader(nonce)
97
97
  rescue => e
98
98
  ::NewRelic::Agent.logger.debug "Failure during RUM browser_timing_header construction", e
99
99
  ''
100
100
  end
101
101
 
102
- def browser_timing_loader
103
- html_safe_if_needed("\n<script>#{Agent.config[:js_agent_loader]}</script>")
102
+ def browser_timing_loader(nonce=nil)
103
+ html_safe_if_needed("\n<script type=\"text/javascript\"#{create_nonce(nonce)}>#{Agent.config[:js_agent_loader]}</script>")
104
104
  end
105
105
 
106
- def browser_timing_config(state)
106
+ def browser_timing_config(state, nonce=nil)
107
107
  txn = state.current_transaction
108
108
  return '' if txn.nil?
109
109
 
110
110
  txn.freeze_name_and_execute_if_not_ignored do
111
111
  data = data_for_js_agent(txn)
112
112
  json = ::JSON.dump(data)
113
- return html_safe_if_needed("\n<script>window.NREUM||(NREUM={});NREUM.info=#{json}</script>")
113
+ return html_safe_if_needed("\n<script type=\"text/javascript\"#{create_nonce(nonce)}>window.NREUM||(NREUM={});NREUM.info=#{json}</script>")
114
114
  end
115
115
 
116
116
  ''
117
117
  end
118
118
 
119
+ def create_nonce(nonce=nil)
120
+ return '' unless nonce
121
+ " nonce=\"#{nonce.to_s}\""
122
+ end
123
+
119
124
  BEACON_KEY = "beacon".freeze
120
125
  ERROR_BEACON_KEY = "errorBeacon".freeze
121
126
  LICENSE_KEY_KEY = "licenseKey".freeze
@@ -131,9 +136,9 @@ module NewRelic
131
136
 
132
137
  # NOTE: Internal prototyping may override this, so leave name stable!
133
138
  def data_for_js_agent(transaction)
134
- queue_time_in_seconds = [transaction.queue_time.to_f, 0.0].max
135
- start_time_in_seconds = [transaction.start_time.to_f, 0.0].max
136
- app_time_in_seconds = Time.now.to_f - start_time_in_seconds
139
+ queue_time_in_seconds = [transaction.queue_time, 0.0].max
140
+ start_time_in_seconds = [transaction.start_time, 0.0].max
141
+ app_time_in_seconds = Process.clock_gettime(Process::CLOCK_REALTIME) - start_time_in_seconds
137
142
 
138
143
  queue_time_in_millis = (1000.0 * queue_time_in_seconds).round
139
144
  app_time_in_millis = (1000.0 * app_time_in_seconds).round
@@ -110,20 +110,15 @@ module NewRelic
110
110
  #
111
111
  # @api public
112
112
  #
113
- def wrap_message_broker_consume_transaction library: nil,
114
- destination_type: nil,
115
- destination_name: nil,
113
+ def wrap_message_broker_consume_transaction(library:,
114
+ destination_type:,
115
+ destination_name:,
116
116
  headers: nil,
117
117
  routing_key: nil,
118
118
  queue_name: nil,
119
119
  exchange_type: nil,
120
120
  reply_to: nil,
121
- correlation_id: nil
122
-
123
- # ruby 2.0.0 does not support required kwargs
124
- raise ArgumentError, 'missing required argument: library' if library.nil?
125
- raise ArgumentError, 'missing required argument: destination_type' if destination_type.nil?
126
- raise ArgumentError, 'missing required argument: destination_name' if destination_name.nil?
121
+ correlation_id: nil)
127
122
 
128
123
  state = Tracer.state
129
124
  return yield if state.current_transaction
@@ -185,17 +180,14 @@ module NewRelic
185
180
  #
186
181
  # @api public
187
182
  #
188
- def start_amqp_publish_segment(library: nil,
189
- destination_name: nil,
183
+ def start_amqp_publish_segment(library:,
184
+ destination_name:,
190
185
  headers: nil,
191
186
  routing_key: nil,
192
187
  reply_to: nil,
193
188
  correlation_id: nil,
194
189
  exchange_type: nil)
195
190
 
196
- # ruby 2.0.0 does not support required kwargs
197
- raise ArgumentError, 'missing required argument: library' if library.nil?
198
- raise ArgumentError, 'missing required argument: destination_name' if destination_name.nil?
199
191
  raise ArgumentError, 'missing required argument: headers' if headers.nil? && CrossAppTracing.cross_app_enabled?
200
192
 
201
193
  original_headers = headers.nil? ? nil : headers.dup
@@ -247,20 +239,14 @@ module NewRelic
247
239
  #
248
240
  # @api public
249
241
  #
250
- def start_amqp_consume_segment(library: nil,
251
- destination_name: nil,
252
- delivery_info: nil,
253
- message_properties: nil,
242
+ def start_amqp_consume_segment(library:,
243
+ destination_name:,
244
+ delivery_info:,
245
+ message_properties:,
254
246
  exchange_type: nil,
255
247
  queue_name: nil,
256
248
  start_time: nil)
257
249
 
258
- # ruby 2.0.0 does not support required kwargs
259
- raise ArgumentError, 'missing required argument: library' if library.nil?
260
- raise ArgumentError, 'missing required argument: destination_name' if destination_name.nil?
261
- raise ArgumentError, 'missing required argument: delivery_info' if delivery_info.nil?
262
- raise ArgumentError, 'missing required argument: message_properties' if message_properties.nil?
263
-
264
250
  segment = Tracer.start_message_broker_segment(
265
251
  action: :consume,
266
252
  library: library,