newrelic_rpm 8.2.0 → 8.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (266) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1936 -0
  3. data/CHANGELOG.md +17 -2
  4. data/CONTRIBUTING.md +14 -2
  5. data/Guardfile +8 -8
  6. data/Rakefile +5 -7
  7. data/bin/mongrel_rpm +8 -9
  8. data/bin/newrelic +1 -1
  9. data/bin/nrdebug +14 -14
  10. data/init.rb +0 -2
  11. data/lefthook.yml +9 -0
  12. data/lib/new_relic/agent/adaptive_sampler.rb +7 -3
  13. data/lib/new_relic/agent/agent.rb +38 -40
  14. data/lib/new_relic/agent/agent_logger.rb +8 -9
  15. data/lib/new_relic/agent/attribute_filter.rb +31 -31
  16. data/lib/new_relic/agent/attributes.rb +2 -2
  17. data/lib/new_relic/agent/autostart.rb +6 -7
  18. data/lib/new_relic/agent/commands/agent_command.rb +2 -2
  19. data/lib/new_relic/agent/commands/agent_command_router.rb +6 -5
  20. data/lib/new_relic/agent/commands/thread_profiler_session.rb +0 -3
  21. data/lib/new_relic/agent/configuration/default_source.rb +318 -324
  22. data/lib/new_relic/agent/configuration/dotted_hash.rb +3 -3
  23. data/lib/new_relic/agent/configuration/environment_source.rb +3 -4
  24. data/lib/new_relic/agent/configuration/event_harvest_config.rb +2 -4
  25. data/lib/new_relic/agent/configuration/high_security_source.rb +7 -7
  26. data/lib/new_relic/agent/configuration/manager.rb +57 -57
  27. data/lib/new_relic/agent/configuration/mask_defaults.rb +1 -1
  28. data/lib/new_relic/agent/configuration/security_policy_source.rb +73 -73
  29. data/lib/new_relic/agent/configuration/server_source.rb +10 -10
  30. data/lib/new_relic/agent/configuration/yaml_source.rb +9 -9
  31. data/lib/new_relic/agent/connect/request_builder.rb +13 -16
  32. data/lib/new_relic/agent/connect/response_handler.rb +0 -3
  33. data/lib/new_relic/agent/custom_event_aggregator.rb +9 -10
  34. data/lib/new_relic/agent/database/explain_plan_helpers.rb +3 -4
  35. data/lib/new_relic/agent/database/obfuscation_helpers.rb +12 -12
  36. data/lib/new_relic/agent/database/postgres_explain_obfuscator.rb +2 -2
  37. data/lib/new_relic/agent/database.rb +20 -24
  38. data/lib/new_relic/agent/datastores/metric_helper.rb +10 -10
  39. data/lib/new_relic/agent/datastores/mongo/event_formatter.rb +2 -3
  40. data/lib/new_relic/agent/datastores/mongo/metric_translator.rb +3 -5
  41. data/lib/new_relic/agent/datastores/mongo/obfuscator.rb +1 -2
  42. data/lib/new_relic/agent/datastores/redis.rb +2 -4
  43. data/lib/new_relic/agent/datastores.rb +1 -3
  44. data/lib/new_relic/agent/distributed_tracing/cross_app_payload.rb +5 -5
  45. data/lib/new_relic/agent/distributed_tracing/cross_app_tracing.rb +11 -10
  46. data/lib/new_relic/agent/distributed_tracing/distributed_trace_attributes.rb +10 -11
  47. data/lib/new_relic/agent/distributed_tracing/distributed_trace_payload.rb +41 -42
  48. data/lib/new_relic/agent/distributed_tracing/distributed_trace_transport_type.rb +3 -3
  49. data/lib/new_relic/agent/distributed_tracing/trace_context.rb +41 -43
  50. data/lib/new_relic/agent/distributed_tracing/trace_context_payload.rb +23 -23
  51. data/lib/new_relic/agent/distributed_tracing.rb +17 -18
  52. data/lib/new_relic/agent/encoding_normalizer.rb +1 -1
  53. data/lib/new_relic/agent/error_collector.rb +17 -17
  54. data/lib/new_relic/agent/error_event_aggregator.rb +1 -1
  55. data/lib/new_relic/agent/error_filter.rb +6 -8
  56. data/lib/new_relic/agent/error_trace_aggregator.rb +1 -1
  57. data/lib/new_relic/agent/event_aggregator.rb +1 -1
  58. data/lib/new_relic/agent/event_buffer.rb +6 -7
  59. data/lib/new_relic/agent/event_listener.rb +0 -1
  60. data/lib/new_relic/agent/event_loop.rb +10 -10
  61. data/lib/new_relic/agent/external.rb +1 -2
  62. data/lib/new_relic/agent/guid_generator.rb +1 -3
  63. data/lib/new_relic/agent/harvester.rb +3 -4
  64. data/lib/new_relic/agent/heap.rb +1 -3
  65. data/lib/new_relic/agent/hostname.rb +3 -3
  66. data/lib/new_relic/agent/http_clients/abstract.rb +5 -7
  67. data/lib/new_relic/agent/http_clients/curb_wrappers.rb +1 -5
  68. data/lib/new_relic/agent/http_clients/excon_wrappers.rb +4 -4
  69. data/lib/new_relic/agent/http_clients/http_rb_wrappers.rb +3 -3
  70. data/lib/new_relic/agent/http_clients/httpclient_wrappers.rb +1 -2
  71. data/lib/new_relic/agent/http_clients/net_http_wrappers.rb +2 -3
  72. data/lib/new_relic/agent/http_clients/typhoeus_wrappers.rb +2 -3
  73. data/lib/new_relic/agent/http_clients/uri_util.rb +0 -1
  74. data/lib/new_relic/agent/instrumentation/action_cable_subscriber.rb +2 -3
  75. data/lib/new_relic/agent/instrumentation/action_controller_subscriber.rb +9 -10
  76. data/lib/new_relic/agent/instrumentation/action_view_subscriber.rb +5 -7
  77. data/lib/new_relic/agent/instrumentation/active_job.rb +4 -3
  78. data/lib/new_relic/agent/instrumentation/active_merchant.rb +2 -2
  79. data/lib/new_relic/agent/instrumentation/active_record.rb +20 -18
  80. data/lib/new_relic/agent/instrumentation/active_record_helper.rb +36 -42
  81. data/lib/new_relic/agent/instrumentation/active_record_notifications.rb +28 -25
  82. data/lib/new_relic/agent/instrumentation/active_record_prepend.rb +3 -3
  83. data/lib/new_relic/agent/instrumentation/active_record_subscriber.rb +5 -6
  84. data/lib/new_relic/agent/instrumentation/acts_as_solr.rb +8 -9
  85. data/lib/new_relic/agent/instrumentation/bunny/chain.rb +1 -1
  86. data/lib/new_relic/agent/instrumentation/bunny/instrumentation.rb +7 -8
  87. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +41 -41
  88. data/lib/new_relic/agent/instrumentation/curb/chain.rb +19 -20
  89. data/lib/new_relic/agent/instrumentation/curb/instrumentation.rb +34 -38
  90. data/lib/new_relic/agent/instrumentation/curb/prepend.rb +9 -10
  91. data/lib/new_relic/agent/instrumentation/data_mapper.rb +10 -10
  92. data/lib/new_relic/agent/instrumentation/delayed_job/chain.rb +5 -7
  93. data/lib/new_relic/agent/instrumentation/delayed_job/instrumentation.rb +2 -6
  94. data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +4 -4
  95. data/lib/new_relic/agent/instrumentation/excon/middleware.rb +2 -2
  96. data/lib/new_relic/agent/instrumentation/excon.rb +0 -1
  97. data/lib/new_relic/agent/instrumentation/grape/chain.rb +1 -2
  98. data/lib/new_relic/agent/instrumentation/grape/instrumentation.rb +6 -7
  99. data/lib/new_relic/agent/instrumentation/grape.rb +2 -3
  100. data/lib/new_relic/agent/instrumentation/httpclient/chain.rb +2 -3
  101. data/lib/new_relic/agent/instrumentation/httpclient/instrumentation.rb +0 -1
  102. data/lib/new_relic/agent/instrumentation/httpclient/prepend.rb +0 -2
  103. data/lib/new_relic/agent/instrumentation/httprb/chain.rb +2 -2
  104. data/lib/new_relic/agent/instrumentation/httprb/instrumentation.rb +6 -6
  105. data/lib/new_relic/agent/instrumentation/httprb/prepend.rb +1 -1
  106. data/lib/new_relic/agent/instrumentation/ignore_actions.rb +2 -3
  107. data/lib/new_relic/agent/instrumentation/logger/instrumentation.rb +0 -1
  108. data/lib/new_relic/agent/instrumentation/logger.rb +1 -1
  109. data/lib/new_relic/agent/instrumentation/memcache/dalli.rb +2 -1
  110. data/lib/new_relic/agent/instrumentation/memcache/helper.rb +0 -1
  111. data/lib/new_relic/agent/instrumentation/memcache/prepend.rb +1 -0
  112. data/lib/new_relic/agent/instrumentation/middleware_proxy.rb +9 -10
  113. data/lib/new_relic/agent/instrumentation/middleware_tracing.rb +4 -5
  114. data/lib/new_relic/agent/instrumentation/mongodb_command_subscriber.rb +4 -4
  115. data/lib/new_relic/agent/instrumentation/net_http/chain.rb +3 -4
  116. data/lib/new_relic/agent/instrumentation/net_http/instrumentation.rb +5 -5
  117. data/lib/new_relic/agent/instrumentation/net_http/prepend.rb +4 -4
  118. data/lib/new_relic/agent/instrumentation/net_http.rb +1 -1
  119. data/lib/new_relic/agent/instrumentation/notifications_subscriber.rb +2 -3
  120. data/lib/new_relic/agent/instrumentation/padrino/instrumentation.rb +3 -2
  121. data/lib/new_relic/agent/instrumentation/padrino/prepend.rb +1 -1
  122. data/lib/new_relic/agent/instrumentation/padrino.rb +0 -5
  123. data/lib/new_relic/agent/instrumentation/queue_time.rb +5 -5
  124. data/lib/new_relic/agent/instrumentation/rack/chain.rb +5 -5
  125. data/lib/new_relic/agent/instrumentation/rack/helpers.rb +0 -1
  126. data/lib/new_relic/agent/instrumentation/rack/instrumentation.rb +4 -5
  127. data/lib/new_relic/agent/instrumentation/rack/prepend.rb +0 -1
  128. data/lib/new_relic/agent/instrumentation/rack.rb +1 -1
  129. data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +6 -6
  130. data/lib/new_relic/agent/instrumentation/rails_notifications/action_cable.rb +2 -2
  131. data/lib/new_relic/agent/instrumentation/rails_notifications/action_controller.rb +0 -1
  132. data/lib/new_relic/agent/instrumentation/rake/chain.rb +0 -5
  133. data/lib/new_relic/agent/instrumentation/rake/instrumentation.rb +6 -6
  134. data/lib/new_relic/agent/instrumentation/rake.rb +1 -1
  135. data/lib/new_relic/agent/instrumentation/redis/chain.rb +6 -6
  136. data/lib/new_relic/agent/instrumentation/redis/instrumentation.rb +2 -2
  137. data/lib/new_relic/agent/instrumentation/redis/prepend.rb +1 -1
  138. data/lib/new_relic/agent/instrumentation/redis.rb +1 -1
  139. data/lib/new_relic/agent/instrumentation/resque/chain.rb +2 -3
  140. data/lib/new_relic/agent/instrumentation/resque/helper.rb +1 -1
  141. data/lib/new_relic/agent/instrumentation/resque/instrumentation.rb +4 -4
  142. data/lib/new_relic/agent/instrumentation/resque/prepend.rb +1 -2
  143. data/lib/new_relic/agent/instrumentation/resque.rb +7 -7
  144. data/lib/new_relic/agent/instrumentation/sequel.rb +7 -9
  145. data/lib/new_relic/agent/instrumentation/sequel_helper.rb +1 -1
  146. data/lib/new_relic/agent/instrumentation/sidekiq.rb +5 -4
  147. data/lib/new_relic/agent/instrumentation/sinatra/ignorer.rb +0 -1
  148. data/lib/new_relic/agent/instrumentation/sinatra/instrumentation.rb +4 -3
  149. data/lib/new_relic/agent/instrumentation/sunspot.rb +1 -1
  150. data/lib/new_relic/agent/instrumentation/tilt/instrumentation.rb +0 -1
  151. data/lib/new_relic/agent/instrumentation/typhoeus/chain.rb +4 -4
  152. data/lib/new_relic/agent/instrumentation/typhoeus/instrumentation.rb +3 -5
  153. data/lib/new_relic/agent/instrumentation/typhoeus/prepend.rb +1 -1
  154. data/lib/new_relic/agent/internal_agent_error.rb +1 -1
  155. data/lib/new_relic/agent/javascript_instrumentor.rb +28 -28
  156. data/lib/new_relic/agent/logging.rb +8 -4
  157. data/lib/new_relic/agent/memory_logger.rb +1 -1
  158. data/lib/new_relic/agent/messaging.rb +42 -43
  159. data/lib/new_relic/agent/method_tracer.rb +9 -12
  160. data/lib/new_relic/agent/method_tracer_helpers.rb +2 -2
  161. data/lib/new_relic/agent/monitors/cross_app_monitor.rb +13 -12
  162. data/lib/new_relic/agent/monitors/distributed_tracing_monitor.rb +2 -2
  163. data/lib/new_relic/agent/monitors/inbound_request_monitor.rb +0 -1
  164. data/lib/new_relic/agent/monitors/synthetics_monitor.rb +4 -7
  165. data/lib/new_relic/agent/monitors.rb +1 -2
  166. data/lib/new_relic/agent/new_relic_service/encoders.rb +4 -4
  167. data/lib/new_relic/agent/new_relic_service/json_marshaller.rb +1 -1
  168. data/lib/new_relic/agent/new_relic_service/marshaller.rb +1 -1
  169. data/lib/new_relic/agent/new_relic_service/security_policy_settings.rb +4 -3
  170. data/lib/new_relic/agent/new_relic_service.rb +20 -20
  171. data/lib/new_relic/agent/noticible_error.rb +0 -2
  172. data/lib/new_relic/agent/null_logger.rb +6 -2
  173. data/lib/new_relic/agent/obfuscator.rb +6 -8
  174. data/lib/new_relic/agent/parameter_filtering.rb +3 -5
  175. data/lib/new_relic/agent/payload_metric_mapping.rb +8 -9
  176. data/lib/new_relic/agent/pipe_channel_manager.rb +5 -6
  177. data/lib/new_relic/agent/pipe_service.rb +1 -1
  178. data/lib/new_relic/agent/priority_sampled_buffer.rb +4 -7
  179. data/lib/new_relic/agent/rules_engine/replacement_rule.rb +9 -9
  180. data/lib/new_relic/agent/rules_engine/segment_terms_rule.rb +12 -12
  181. data/lib/new_relic/agent/rules_engine.rb +2 -2
  182. data/lib/new_relic/agent/sampler.rb +2 -3
  183. data/lib/new_relic/agent/sampler_collection.rb +2 -3
  184. data/lib/new_relic/agent/samplers/delayed_job_sampler.rb +3 -3
  185. data/lib/new_relic/agent/samplers/memory_sampler.rb +4 -3
  186. data/lib/new_relic/agent/samplers/vm_sampler.rb +18 -18
  187. data/lib/new_relic/agent/span_event_aggregator.rb +8 -8
  188. data/lib/new_relic/agent/span_event_primitive.rb +39 -39
  189. data/lib/new_relic/agent/sql_sampler.rb +9 -9
  190. data/lib/new_relic/agent/stats.rb +16 -16
  191. data/lib/new_relic/agent/stats_engine/gc_profiler.rb +7 -9
  192. data/lib/new_relic/agent/stats_engine/stats_hash.rb +8 -9
  193. data/lib/new_relic/agent/stats_engine.rb +6 -6
  194. data/lib/new_relic/agent/synthetics_event_aggregator.rb +0 -1
  195. data/lib/new_relic/agent/system_info.rb +22 -20
  196. data/lib/new_relic/agent/threading/agent_thread.rb +4 -5
  197. data/lib/new_relic/agent/threading/backtrace_node.rb +6 -9
  198. data/lib/new_relic/agent/threading/backtrace_service.rb +8 -8
  199. data/lib/new_relic/agent/threading/thread_profile.rb +15 -18
  200. data/lib/new_relic/agent/tracer.rb +37 -43
  201. data/lib/new_relic/agent/transaction/abstract_segment.rb +6 -6
  202. data/lib/new_relic/agent/transaction/datastore_segment.rb +5 -7
  203. data/lib/new_relic/agent/transaction/distributed_tracer.rb +7 -9
  204. data/lib/new_relic/agent/transaction/distributed_tracing.rb +21 -22
  205. data/lib/new_relic/agent/transaction/external_request_segment.rb +3 -5
  206. data/lib/new_relic/agent/transaction/message_broker_segment.rb +23 -23
  207. data/lib/new_relic/agent/transaction/request_attributes.rb +7 -7
  208. data/lib/new_relic/agent/transaction/segment.rb +3 -3
  209. data/lib/new_relic/agent/transaction/slowest_sample_buffer.rb +0 -2
  210. data/lib/new_relic/agent/transaction/trace.rb +8 -8
  211. data/lib/new_relic/agent/transaction/trace_context.rb +13 -15
  212. data/lib/new_relic/agent/transaction/trace_node.rb +16 -16
  213. data/lib/new_relic/agent/transaction/tracing.rb +1 -3
  214. data/lib/new_relic/agent/transaction/transaction_sample_buffer.rb +1 -2
  215. data/lib/new_relic/agent/transaction.rb +79 -81
  216. data/lib/new_relic/agent/transaction_error_primitive.rb +16 -16
  217. data/lib/new_relic/agent/transaction_event_aggregator.rb +5 -6
  218. data/lib/new_relic/agent/transaction_event_primitive.rb +29 -29
  219. data/lib/new_relic/agent/transaction_metrics.rb +3 -3
  220. data/lib/new_relic/agent/transaction_sampler.rb +0 -1
  221. data/lib/new_relic/agent/transaction_time_aggregator.rb +6 -6
  222. data/lib/new_relic/agent/utilization/azure.rb +1 -1
  223. data/lib/new_relic/agent/utilization_data.rb +3 -4
  224. data/lib/new_relic/agent/vm/monotonic_gc_profiler.rb +1 -1
  225. data/lib/new_relic/agent/vm/snapshot.rb +3 -3
  226. data/lib/new_relic/agent/worker_loop.rb +3 -5
  227. data/lib/new_relic/agent.rb +22 -22
  228. data/lib/new_relic/cli/command.rb +15 -17
  229. data/lib/new_relic/cli/commands/deployments.rb +20 -22
  230. data/lib/new_relic/cli/commands/install.rb +6 -10
  231. data/lib/new_relic/coerce.rb +5 -8
  232. data/lib/new_relic/collection_helper.rb +48 -47
  233. data/lib/new_relic/control/class_methods.rb +2 -2
  234. data/lib/new_relic/control/frameworks/external.rb +1 -1
  235. data/lib/new_relic/control/frameworks/rails.rb +5 -6
  236. data/lib/new_relic/control/frameworks/rails3.rb +2 -3
  237. data/lib/new_relic/control/frameworks/ruby.rb +2 -2
  238. data/lib/new_relic/control/instance_methods.rb +4 -5
  239. data/lib/new_relic/control/instrumentation.rb +4 -5
  240. data/lib/new_relic/control/server_methods.rb +2 -3
  241. data/lib/new_relic/control.rb +0 -1
  242. data/lib/new_relic/dependency_detection.rb +6 -8
  243. data/lib/new_relic/environment_report.rb +16 -18
  244. data/lib/new_relic/helper.rb +5 -5
  245. data/lib/new_relic/language_support.rb +1 -1
  246. data/lib/new_relic/latest_changes.rb +2 -2
  247. data/lib/new_relic/local_environment.rb +7 -7
  248. data/lib/new_relic/metric_data.rb +6 -7
  249. data/lib/new_relic/metric_spec.rb +3 -3
  250. data/lib/new_relic/noticed_error.rb +14 -15
  251. data/lib/new_relic/rack/agent_middleware.rb +2 -2
  252. data/lib/new_relic/rack/browser_monitoring.rb +9 -9
  253. data/lib/new_relic/recipes/capistrano3.rb +11 -13
  254. data/lib/new_relic/recipes/capistrano_legacy.rb +11 -14
  255. data/lib/new_relic/supportability_helper.rb +1 -2
  256. data/lib/new_relic/version.rb +3 -4
  257. data/lib/sequel/extensions/newrelic_instrumentation.rb +4 -7
  258. data/lib/sequel/plugins/newrelic_instrumentation.rb +3 -9
  259. data/lib/tasks/all.rb +1 -1
  260. data/lib/tasks/config.rake +21 -21
  261. data/lib/tasks/multiverse.rb +4 -6
  262. data/lib/tasks/tests.rake +3 -7
  263. data/newrelic_rpm.gemspec +13 -12
  264. data/recipes/newrelic.rb +1 -1
  265. data/test/agent_helper.rb +55 -55
  266. metadata +33 -4
@@ -17,7 +17,7 @@ module NewRelic
17
17
 
18
18
  def initialize(path, env)
19
19
  @path = path
20
- config = {}
20
+ config = {}
21
21
  @failures = []
22
22
 
23
23
  # These are needed in process_erb for populating the newrelic.yml via
@@ -34,7 +34,7 @@ module NewRelic
34
34
  ::NewRelic::Agent.logger.info("Reading configuration from #{path} (#{Dir.pwd})")
35
35
  raw_file = File.read(@file_path)
36
36
  erb_file = process_erb(raw_file)
37
- config = process_yaml(erb_file, env, config, @file_path)
37
+ config = process_yaml(erb_file, env, config, @file_path)
38
38
  rescue ScriptError, StandardError => e
39
39
  log_failure("Failed to read or parse configuration file at #{path}", e)
40
40
  end
@@ -63,8 +63,8 @@ module NewRelic
63
63
  end
64
64
 
65
65
  def warn_missing_config_file(path)
66
- based_on = 'unknown'
67
- source = ::NewRelic::Agent.config.source(:config_path)
66
+ based_on = 'unknown'
67
+ source = ::NewRelic::Agent.config.source(:config_path)
68
68
  candidate_paths = [path]
69
69
 
70
70
  case source
@@ -104,10 +104,10 @@ module NewRelic
104
104
  def process_yaml(file, env, config, path)
105
105
  if file
106
106
  confighash = if YAML.respond_to?(:unsafe_load)
107
- YAML.unsafe_load(file)
108
- else
109
- YAML.load(file)
110
- end
107
+ YAML.unsafe_load(file)
108
+ else
109
+ YAML.load(file)
110
+ end
111
111
 
112
112
  unless confighash.key?(env)
113
113
  log_failure("Config file at #{path} doesn't include a '#{env}' section!")
@@ -151,7 +151,7 @@ module NewRelic
151
151
  messages.each { |message| @failures << message }
152
152
  end
153
153
 
154
- def dot_flattened(nested_hash, names=[], result={})
154
+ def dot_flattened(nested_hash, names = [], result = {})
155
155
  nested_hash.each do |key, val|
156
156
  next if val == nil
157
157
  if val.respond_to?(:has_key?) && !CONFIG_WITH_HASH_VALUE.include?(key)
@@ -8,9 +8,7 @@ require 'new_relic/agent/configuration/event_harvest_config'
8
8
  module NewRelic
9
9
  module Agent
10
10
  module Connect
11
-
12
11
  class RequestBuilder
13
-
14
12
  def initialize(new_relic_service, config, event_harvest_config, environment_report)
15
13
  @service = new_relic_service
16
14
  @config = config
@@ -18,24 +16,23 @@ module NewRelic
18
16
  @environment_report = sanitize_environment_report(environment_report)
19
17
  end
20
18
 
21
-
22
19
  # Initializes the hash of settings that we send to the
23
20
  # server. Returns a literal hash containing the options
24
21
  def connect_payload
25
22
  {
26
- :pid => $$,
27
- :host => local_host,
28
- :display_host => Agent.config[:'process_host.display_name'],
29
- :app_name => Agent.config[:app_name],
30
- :language => 'ruby',
31
- :labels => Agent.config.parsed_labels,
23
+ :pid => $$,
24
+ :host => local_host,
25
+ :display_host => Agent.config[:'process_host.display_name'],
26
+ :app_name => Agent.config[:app_name],
27
+ :language => 'ruby',
28
+ :labels => Agent.config.parsed_labels,
32
29
  :agent_version => NewRelic::VERSION::STRING,
33
- :environment => @environment_report,
34
- :metadata => environment_metadata,
35
- :settings => Agent.config.to_collector_hash,
30
+ :environment => @environment_report,
31
+ :metadata => environment_metadata,
32
+ :settings => Agent.config.to_collector_hash,
36
33
  :high_security => Agent.config[:high_security],
37
- :utilization => UtilizationData.new.to_collector_hash,
38
- :identifier => "ruby:#{local_host}:#{Agent.config[:app_name].sort.join(',')}",
34
+ :utilization => UtilizationData.new.to_collector_hash,
35
+ :identifier => "ruby:#{local_host}:#{Agent.config[:app_name].sort.join(',')}",
39
36
  :event_harvest_config => @event_harvest_config
40
37
  }
41
38
  end
@@ -48,9 +45,9 @@ module NewRelic
48
45
  environment_report
49
46
  end
50
47
 
51
- def environment_metadata
48
+ def environment_metadata
52
49
  env_copy = {}
53
- ENV.keys.each {|k| env_copy[k] = ENV[k] if k =~ /^NEW_RELIC_METADATA_/}
50
+ ENV.keys.each { |k| env_copy[k] = ENV[k] if k =~ /^NEW_RELIC_METADATA_/ }
54
51
  env_copy
55
52
  end
56
53
 
@@ -2,13 +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
-
6
5
  module NewRelic
7
6
  module Agent
8
7
  module Connect
9
-
10
8
  class ResponseHandler
11
-
12
9
  def initialize(agent, config)
13
10
  @agent = agent
14
11
  @config = config
@@ -10,9 +10,9 @@ module NewRelic
10
10
  class CustomEventAggregator < EventAggregator
11
11
  include NewRelic::Coerce
12
12
 
13
- TYPE = 'type'.freeze
14
- TIMESTAMP = 'timestamp'.freeze
15
- PRIORITY = 'priority'.freeze
13
+ TYPE = 'type'.freeze
14
+ TIMESTAMP = 'timestamp'.freeze
15
+ PRIORITY = 'priority'.freeze
16
16
  EVENT_TYPE_REGEX = /^[a-zA-Z0-9:_ ]+$/.freeze
17
17
 
18
18
  named :CustomEventAggregator
@@ -46,10 +46,9 @@ module NewRelic
46
46
 
47
47
  def create_event(type, priority, attributes)
48
48
  [
49
- { TYPE => type,
50
- TIMESTAMP => Process.clock_gettime(Process::CLOCK_REALTIME).to_i,
51
- PRIORITY => priority
52
- },
49
+ {TYPE => type,
50
+ TIMESTAMP => Process.clock_gettime(Process::CLOCK_REALTIME).to_i,
51
+ PRIORITY => priority},
53
52
  AttributeProcessing.flatten_and_coerce(attributes)
54
53
  ]
55
54
  end
@@ -72,9 +71,9 @@ module NewRelic
72
71
 
73
72
  def record_supportability_metrics total_count, captured_count, dropped_count
74
73
  engine = NewRelic::Agent.instance.stats_engine
75
- engine.tl_record_supportability_metric_count("Events/Customer/Seen" , total_count)
76
- engine.tl_record_supportability_metric_count("Events/Customer/Sent" , captured_count)
77
- engine.tl_record_supportability_metric_count("Events/Customer/Dropped", dropped_count)
74
+ engine.tl_record_supportability_metric_count("Events/Customer/Seen", total_count)
75
+ engine.tl_record_supportability_metric_count("Events/Customer/Sent", captured_count)
76
+ engine.tl_record_supportability_metric_count("Events/Customer/Dropped", dropped_count)
78
77
  end
79
78
 
80
79
  def note_dropped_event(type)
@@ -9,7 +9,6 @@ module NewRelic
9
9
  module Agent
10
10
  module Database
11
11
  module ExplainPlanHelpers
12
-
13
12
  SUPPORTED_ADAPTERS_FOR_EXPLAIN = [:postgres, :mysql2, :mysql, :sqlite]
14
13
  SELECT = 'select'.freeze
15
14
 
@@ -97,7 +96,7 @@ module NewRelic
97
96
 
98
97
  def process_explain_results_mysql(results)
99
98
  headers = []
100
- values = []
99
+ values = []
101
100
  if results.is_a?(Array)
102
101
  # We're probably using the jdbc-mysql gem for JRuby, which will give
103
102
  # us an array of hashes.
@@ -118,7 +117,7 @@ module NewRelic
118
117
 
119
118
  def process_explain_results_mysql2(results)
120
119
  headers = results.fields
121
- values = []
120
+ values = []
122
121
  results.each { |row| values << row }
123
122
  [headers, values]
124
123
  end
@@ -127,7 +126,7 @@ module NewRelic
127
126
 
128
127
  def process_explain_results_sqlite(results)
129
128
  headers = SQLITE_EXPLAIN_COLUMNS
130
- values = []
129
+ values = []
131
130
  results.each do |row|
132
131
  values << headers.map { |h| row[h] }
133
132
  end
@@ -20,17 +20,17 @@ module NewRelic
20
20
  }
21
21
 
22
22
  DIALECT_COMPONENTS = {
23
- :fallback => COMPONENTS_REGEX_MAP.keys,
24
- :mysql => [:single_quotes, :double_quotes, :numeric_literals, :boolean_literals,
25
- :hexadecimal_literals, :comments, :multi_line_comments],
26
- :postgres => [:single_quotes, :dollar_quotes, :uuids, :numeric_literals,
27
- :boolean_literals, :comments, :multi_line_comments],
28
- :sqlite => [:single_quotes, :numeric_literals, :boolean_literals, :hexadecimal_literals,
29
- :comments, :multi_line_comments],
30
- :oracle => [:single_quotes, :oracle_quoted_strings, :numeric_literals, :comments,
31
- :multi_line_comments],
32
- :cassandra => [:single_quotes, :uuids, :numeric_literals, :boolean_literals,
33
- :hexadecimal_literals, :comments, :multi_line_comments]
23
+ :fallback => COMPONENTS_REGEX_MAP.keys,
24
+ :mysql => [:single_quotes, :double_quotes, :numeric_literals, :boolean_literals,
25
+ :hexadecimal_literals, :comments, :multi_line_comments],
26
+ :postgres => [:single_quotes, :dollar_quotes, :uuids, :numeric_literals,
27
+ :boolean_literals, :comments, :multi_line_comments],
28
+ :sqlite => [:single_quotes, :numeric_literals, :boolean_literals, :hexadecimal_literals,
29
+ :comments, :multi_line_comments],
30
+ :oracle => [:single_quotes, :oracle_quoted_strings, :numeric_literals, :comments,
31
+ :multi_line_comments],
32
+ :cassandra => [:single_quotes, :uuids, :numeric_literals, :boolean_literals,
33
+ :hexadecimal_literals, :comments, :multi_line_comments]
34
34
  }
35
35
 
36
36
  # We use these to check whether the query contains any quote characters
@@ -58,7 +58,7 @@ module NewRelic
58
58
 
59
59
  def self.generate_regex(dialect)
60
60
  components = DIALECT_COMPONENTS[dialect]
61
- Regexp.union(components.map{|component| COMPONENTS_REGEX_MAP[component]})
61
+ Regexp.union(components.map { |component| COMPONENTS_REGEX_MAP[component] })
62
62
  end
63
63
 
64
64
  MYSQL_COMPONENTS_REGEX = self.generate_regex(:mysql)
@@ -12,7 +12,7 @@ module NewRelic
12
12
  # Database::Obfuscator class because here we don't look for
13
13
  # backslash-escaped strings.
14
14
  QUOTED_STRINGS_REGEX = /'(?:[^']|'')*'|"(?:[^"]|"")*"/
15
- LABEL_LINE_REGEX = /^([^:\n]*:\s+).*$/.freeze
15
+ LABEL_LINE_REGEX = /^([^:\n]*:\s+).*$/.freeze
16
16
 
17
17
  def obfuscate(explain)
18
18
  # First, we replace all single-quoted strings.
@@ -35,7 +35,7 @@ module NewRelic
35
35
  # All parts of the query that can appear in the explain output are
36
36
  # prefixed with "<label>: ", so we want to preserve the label, but
37
37
  # remove the rest of the line.
38
- explain.gsub!(LABEL_LINE_REGEX, '\1?')
38
+ explain.gsub!(LABEL_LINE_REGEX, '\1?')
39
39
  explain
40
40
  end
41
41
  end
@@ -9,17 +9,17 @@ require 'new_relic/agent/database/obfuscator'
9
9
  module NewRelic
10
10
  # columns for a mysql explain plan
11
11
  MYSQL_EXPLAIN_COLUMNS = [
12
- "Id",
13
- "Select Type",
14
- "Table",
15
- "Type",
16
- "Possible Keys",
17
- "Key",
18
- "Key Length",
19
- "Ref",
20
- "Rows",
21
- "Extra"
22
- ].freeze
12
+ "Id",
13
+ "Select Type",
14
+ "Table",
15
+ "Type",
16
+ "Possible Keys",
17
+ "Key",
18
+ "Key Length",
19
+ "Ref",
20
+ "Rows",
21
+ "Extra"
22
+ ].freeze
23
23
 
24
24
  module Agent
25
25
  module Database
@@ -57,7 +57,7 @@ module NewRelic
57
57
  Obfuscator.instance.set_sql_obfuscator(type, &block)
58
58
  end
59
59
 
60
- def record_sql_method(config_section=:transaction_tracer)
60
+ def record_sql_method(config_section = :transaction_tracer)
61
61
  key = record_sql_method_key(config_section)
62
62
 
63
63
  case Agent.config[key].to_s
@@ -87,11 +87,11 @@ module NewRelic
87
87
 
88
88
  RECORD_FOR = [:raw, :obfuscated].freeze
89
89
 
90
- def should_record_sql?(config_section=:transaction_tracer)
90
+ def should_record_sql?(config_section = :transaction_tracer)
91
91
  RECORD_FOR.include?(record_sql_method(config_section))
92
92
  end
93
93
 
94
- def should_collect_explain_plans?(config_section=:transaction_tracer)
94
+ def should_collect_explain_plans?(config_section = :transaction_tracer)
95
95
  should_record_sql?(config_section) &&
96
96
  Agent.config["#{config_section}.explain_enabled".to_sym]
97
97
  end
@@ -185,7 +185,7 @@ module NewRelic
185
185
 
186
186
  DEFAULT_QUERY_NAME = "SQL".freeze
187
187
 
188
- def initialize(sql, config={}, explainer=nil, binds=nil, name=DEFAULT_QUERY_NAME, host=nil, port_path_or_id=nil, database_name=nil)
188
+ def initialize(sql, config = {}, explainer = nil, binds = nil, name = DEFAULT_QUERY_NAME, host = nil, port_path_or_id = nil, database_name = nil)
189
189
  @sql = Database.capture_query(sql)
190
190
  @config = config
191
191
  @explainer = explainer
@@ -205,9 +205,7 @@ module NewRelic
205
205
  Database.obfuscate_sql(self)
206
206
  when :raw
207
207
  sql.to_s
208
- else
209
- nil
210
- end
208
+ end
211
209
  end
212
210
 
213
211
  # This takes a connection config hash from ActiveRecord or Sequel and
@@ -220,8 +218,6 @@ module NewRelic
220
218
  elsif @config[:uri] && @config[:uri].to_s =~ /^jdbc:([^:]+):/
221
219
  # This case is for Sequel with the jdbc-mysql, jdbc-postgres, or jdbc-sqlite3 gems.
222
220
  symbolized_adapter($1)
223
- else
224
- nil
225
221
  end
226
222
  end
227
223
 
@@ -247,11 +243,11 @@ module NewRelic
247
243
 
248
244
  private
249
245
 
250
- POSTGIS_PREFIX = 'postgis'.freeze
246
+ POSTGIS_PREFIX = 'postgis'.freeze
251
247
  POSTGRES_PREFIX = 'postgres'.freeze
252
- MYSQL_PREFIX = 'mysql'.freeze
253
- MYSQL2_PREFIX = 'mysql2'.freeze
254
- SQLITE_PREFIX = 'sqlite'.freeze
248
+ MYSQL_PREFIX = 'mysql'.freeze
249
+ MYSQL2_PREFIX = 'mysql2'.freeze
250
+ SQLITE_PREFIX = 'sqlite'.freeze
255
251
 
256
252
  def symbolized_adapter(adapter)
257
253
  if adapter.start_with?(POSTGRES_PREFIX) || adapter == POSTGIS_PREFIX
@@ -6,9 +6,9 @@ module NewRelic
6
6
  module Agent
7
7
  module Datastores
8
8
  module MetricHelper
9
- ROLLUP_METRIC = "Datastore/all".freeze
10
- WEB_ROLLUP_METRIC = "Datastore/allWeb".freeze
11
- OTHER_ROLLUP_METRIC = "Datastore/allOther".freeze
9
+ ROLLUP_METRIC = "Datastore/all".freeze
10
+ WEB_ROLLUP_METRIC = "Datastore/allWeb".freeze
11
+ OTHER_ROLLUP_METRIC = "Datastore/allOther".freeze
12
12
  DEFAULT_PRODUCT_NAME = "ActiveRecord".freeze
13
13
  OTHER = "Other".freeze
14
14
 
@@ -48,7 +48,7 @@ module NewRelic
48
48
  end
49
49
  end
50
50
 
51
- def self.scoped_metric_for product, operation, collection=nil
51
+ def self.scoped_metric_for product, operation, collection = nil
52
52
  if collection
53
53
  statement_metric_for product, collection, operation
54
54
  else
@@ -56,7 +56,7 @@ module NewRelic
56
56
  end
57
57
  end
58
58
 
59
- def self.unscoped_metrics_for product, operation, collection=nil, host=nil, port_path_or_id=nil
59
+ def self.unscoped_metrics_for product, operation, collection = nil, host = nil, port_path_or_id = nil
60
60
  suffix = all_suffix
61
61
 
62
62
  metrics = [
@@ -74,17 +74,17 @@ module NewRelic
74
74
  metrics
75
75
  end
76
76
 
77
- def self.product_operation_collection_for product, operation, collection=nil, generic_product = nil
77
+ def self.product_operation_collection_for product, operation, collection = nil, generic_product = nil
78
78
  if overrides = overridden_operation_and_collection
79
79
  if should_override?(overrides, product, generic_product)
80
- operation = overrides[0] || operation
80
+ operation = overrides[0] || operation
81
81
  collection = overrides[1] || collection
82
82
  end
83
83
  end
84
84
  [product, operation, collection]
85
85
  end
86
86
 
87
- def self.metrics_for(product, operation, collection = nil, generic_product = nil, host=nil, port_path_or_id=nil)
87
+ def self.metrics_for(product, operation, collection = nil, generic_product = nil, host = nil, port_path_or_id = nil)
88
88
  product, operation, collection = product_operation_collection_for(product, operation, collection, generic_product)
89
89
 
90
90
  # Order of these metrics matters--the first metric in the list will
@@ -106,8 +106,8 @@ module NewRelic
106
106
 
107
107
  # Allow Transaction#with_database_metric_name to override our
108
108
  # collection and operation
109
- def self.overridden_operation_and_collection #THREAD_LOCAL_ACCESS
110
- txn = Tracer.current_transaction
109
+ def self.overridden_operation_and_collection # THREAD_LOCAL_ACCESS
110
+ txn = Tracer.current_transaction
111
111
  txn ? txn.instrumentation_state[:datastore_override] : nil
112
112
  end
113
113
 
@@ -8,12 +8,11 @@ module NewRelic
8
8
  module Datastores
9
9
  module Mongo
10
10
  module EventFormatter
11
-
12
11
  # Keys that will get their values replaced with '?'.
13
- OBFUSCATE_KEYS = [ 'filter', 'query', 'pipeline' ].freeze
12
+ OBFUSCATE_KEYS = ['filter', 'query', 'pipeline'].freeze
14
13
 
15
14
  # Keys that will get completely removed from the statement.
16
- DENYLISTED_KEYS = [ 'deletes', 'documents', 'updates' ].freeze
15
+ DENYLISTED_KEYS = ['deletes', 'documents', 'updates'].freeze
17
16
 
18
17
  def self.format(command_name, database_name, command)
19
18
  return nil unless NewRelic::Agent.config[:'mongo.capture_queries']
@@ -15,8 +15,8 @@ module NewRelic
15
15
 
16
16
  if collection_in_selector?(payload)
17
17
  command_key = command_key_from_selector(payload)
18
- name = get_name_from_selector(command_key, payload)
19
- collection = get_collection_from_selector(command_key, payload)
18
+ name = get_name_from_selector(command_key, payload)
19
+ collection = get_collection_from_selector(command_key, payload)
20
20
  else
21
21
  collection = payload[:collection]
22
22
  end
@@ -79,7 +79,7 @@ module NewRelic
79
79
 
80
80
  :collstats,
81
81
  :renameCollection,
82
- :drop,
82
+ :drop
83
83
  ]
84
84
 
85
85
  def self.command_key_from_selector(payload)
@@ -176,9 +176,7 @@ module NewRelic
176
176
  parts.shift
177
177
  parts.join('.')
178
178
  end
179
-
180
179
  end
181
-
182
180
  end
183
181
  end
184
182
  end
@@ -7,7 +7,6 @@ module NewRelic
7
7
  module Datastores
8
8
  module Mongo
9
9
  module Obfuscator
10
-
11
10
  ALLOWLIST = [:operation].freeze
12
11
 
13
12
  def self.obfuscate_statement(source, allowlist = ALLOWLIST)
@@ -32,7 +31,7 @@ module NewRelic
32
31
  if value.is_a?(Hash)
33
32
  obfuscate_statement(value, allowlist)
34
33
  elsif value.is_a?(Array)
35
- value.map {|v| obfuscate_value(v, allowlist)}
34
+ value.map { |v| obfuscate_value(v, allowlist) }
36
35
  else
37
36
  QUESTION_MARK
38
37
  end
@@ -10,7 +10,7 @@ module NewRelic
10
10
 
11
11
  MAXIMUM_COMMAND_LENGTH = 1000
12
12
  MAXIMUM_ARGUMENT_LENGTH = 64
13
- CHUNK_SIZE = (MAXIMUM_ARGUMENT_LENGTH - 5) / 2
13
+ CHUNK_SIZE = (MAXIMUM_ARGUMENT_LENGTH - 5) / 2
14
14
  PREFIX_RANGE = (0...CHUNK_SIZE)
15
15
  SUFFIX_RANGE = (-CHUNK_SIZE..-1)
16
16
 
@@ -32,8 +32,6 @@ module NewRelic
32
32
  trim_result(result) if result.length >= MAXIMUM_COMMAND_LENGTH
33
33
  result.strip!
34
34
  result
35
- else
36
- nil
37
35
  end
38
36
  end
39
37
 
@@ -117,7 +115,7 @@ module NewRelic
117
115
  end
118
116
 
119
117
  def self.trim_result(result)
120
- result.slice!((MAXIMUM_COMMAND_LENGTH-ELLIPSES.length)..-1)
118
+ result.slice!((MAXIMUM_COMMAND_LENGTH - ELLIPSES.length)..-1)
121
119
  result.strip!
122
120
  result << ELLIPSES
123
121
  end
@@ -13,7 +13,6 @@ module NewRelic
13
13
  #
14
14
  # @api public
15
15
  module Datastores
16
-
17
16
  # @!group Tracing query methods
18
17
 
19
18
  # Add Datastore tracing to a method. This properly generates the metrics
@@ -40,7 +39,7 @@ module NewRelic
40
39
  method_name_without_newrelic = "#{method_name}_without_newrelic"
41
40
 
42
41
  if NewRelic::Helper.instance_methods_include?(klass, method_name) &&
43
- !NewRelic::Helper.instance_methods_include?(klass, method_name_without_newrelic)
42
+ !NewRelic::Helper.instance_methods_include?(klass, method_name_without_newrelic)
44
43
 
45
44
  visibility = NewRelic::Helper.instance_method_visibility(klass, method_name)
46
45
 
@@ -202,7 +201,6 @@ module NewRelic
202
201
  end
203
202
  nil
204
203
  end
205
-
206
204
  end
207
205
  end
208
206
  end
@@ -8,20 +8,20 @@ module NewRelic
8
8
  attr_reader :id, :transaction, :referring_guid, :referring_trip_id, :referring_path_hash
9
9
 
10
10
  def initialize(id, transaction, transaction_info)
11
- @id = id
12
- @transaction = transaction
11
+ @id = id
12
+ @transaction = transaction
13
13
 
14
14
  transaction_info ||= []
15
- @referring_guid = transaction_info[0]
15
+ @referring_guid = transaction_info[0]
16
16
  # unused_flag = transaction_info[1]
17
- @referring_trip_id = string_or_false_for(transaction_info[2])
17
+ @referring_trip_id = string_or_false_for(transaction_info[2])
18
18
  @referring_path_hash = string_or_false_for(transaction_info[3])
19
19
  end
20
20
 
21
21
  def as_json_array(content_length)
22
22
  queue_time_in_seconds = [transaction.queue_time, 0.0].max
23
23
  start_time_in_seconds = [transaction.start_time, 0.0].max
24
- app_time_in_seconds = Process.clock_gettime(Process::CLOCK_REALTIME) - start_time_in_seconds
24
+ app_time_in_seconds = Process.clock_gettime(Process::CLOCK_REALTIME) - start_time_in_seconds
25
25
 
26
26
  [
27
27
  NewRelic::Agent.config[:cross_process_id],
@@ -18,7 +18,7 @@ module NewRelic
18
18
  # The cross app transaction header for "outgoing" calls
19
19
  NR_TXN_HEADER = 'X-NewRelic-Transaction'
20
20
 
21
- NR_MESSAGE_BROKER_ID_HEADER = 'NewRelicID'
21
+ NR_MESSAGE_BROKER_ID_HEADER = 'NewRelicID'
22
22
  NR_MESSAGE_BROKER_TXN_HEADER = 'NewRelicTransaction'
23
23
  NR_MESSAGE_BROKER_SYNTHETICS_HEADER = 'NewRelicSynthetics'
24
24
 
@@ -56,8 +56,8 @@ module NewRelic
56
56
  return unless CrossAppTracing.cross_app_enabled?
57
57
 
58
58
  @is_cross_app_caller = true
59
- txn_guid = transaction.guid
60
- trip_id = cat_trip_id
59
+ txn_guid = transaction.guid
60
+ trip_id = cat_trip_id
61
61
  path_hash = cat_path_hash
62
62
 
63
63
  insert_request_headers headers, txn_guid, trip_id, path_hash
@@ -91,7 +91,7 @@ module NewRelic
91
91
  private
92
92
 
93
93
  def insert_message_headers headers, txn_guid, trip_id, path_hash, synthetics_header
94
- headers[NR_MESSAGE_BROKER_ID_HEADER] = obfuscator.obfuscate(Agent.config[:cross_process_id])
94
+ headers[NR_MESSAGE_BROKER_ID_HEADER] = obfuscator.obfuscate(Agent.config[:cross_process_id])
95
95
  headers[NR_MESSAGE_BROKER_TXN_HEADER] = obfuscator.obfuscate(::JSON.dump([txn_guid, false, trip_id, path_hash]))
96
96
  headers[NR_MESSAGE_BROKER_SYNTHETICS_HEADER] = synthetics_header if synthetics_header
97
97
  end
@@ -116,11 +116,11 @@ module NewRelic
116
116
  payload[:guid] = transaction.guid
117
117
 
118
118
  return unless is_cross_app?
119
- trip_id = cat_trip_id
120
- path_hash = cat_path_hash
119
+ trip_id = cat_trip_id
120
+ path_hash = cat_path_hash
121
121
  referring_path_hash = cat_referring_path_hash
122
122
 
123
- payload[:cat_trip_id] = trip_id if trip_id
123
+ payload[:cat_trip_id] = trip_id if trip_id
124
124
  payload[:cat_referring_path_hash] = referring_path_hash if referring_path_hash
125
125
 
126
126
  if path_hash
@@ -135,6 +135,7 @@ module NewRelic
135
135
 
136
136
  ###############
137
137
  module_function
138
+
138
139
  ###############
139
140
 
140
141
  def cross_app_enabled?
@@ -173,9 +174,9 @@ module NewRelic
173
174
 
174
175
  def insert_request_headers request, txn_guid, trip_id, path_hash
175
176
  cross_app_id = NewRelic::Agent.config[:cross_process_id]
176
- txn_data = ::JSON.dump([txn_guid, false, trip_id, path_hash])
177
+ txn_data = ::JSON.dump([txn_guid, false, trip_id, path_hash])
177
178
 
178
- request[NR_ID_HEADER] = obfuscator.obfuscate(cross_app_id)
179
+ request[NR_ID_HEADER] = obfuscator.obfuscate(cross_app_id)
179
180
  request[NR_TXN_HEADER] = obfuscator.obfuscate(txn_data)
180
181
  end
181
182
 
@@ -218,7 +219,7 @@ module NewRelic
218
219
  end
219
220
 
220
221
  def reject_messaging_cat_headers headers
221
- headers.reject {|k,_| k == NR_MESSAGE_BROKER_ID_HEADER || k == NR_MESSAGE_BROKER_TXN_HEADER}
222
+ headers.reject { |k, _| k == NR_MESSAGE_BROKER_ID_HEADER || k == NR_MESSAGE_BROKER_TXN_HEADER }
222
223
  end
223
224
 
224
225
  def trusts? id