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
@@ -47,7 +47,6 @@ module NewRelic
47
47
  #
48
48
 
49
49
  module MethodTracer
50
-
51
50
  def self.included(klass)
52
51
  klass.extend(ClassMethods)
53
52
  end
@@ -68,7 +67,7 @@ module NewRelic
68
67
  #
69
68
  # @api public
70
69
  #
71
- def trace_execution_scoped(metric_names, options=NewRelic::EMPTY_HASH) #THREAD_LOCAL_ACCESS
70
+ def trace_execution_scoped(metric_names, options = NewRelic::EMPTY_HASH) # THREAD_LOCAL_ACCESS
72
71
  NewRelic::Agent.record_api_supportability_metric :trace_execution_scoped unless options[:internal]
73
72
  NewRelic::Agent::MethodTracerHelpers.trace_execution_scoped(metric_names, options) do
74
73
  # Using an implicit block avoids object allocation for a &block param
@@ -84,7 +83,7 @@ module NewRelic
84
83
  #
85
84
  # @api public
86
85
  #
87
- def trace_execution_unscoped(metric_names, options=NewRelic::EMPTY_HASH) #THREAD_LOCAL_ACCESS
86
+ def trace_execution_unscoped(metric_names, options = NewRelic::EMPTY_HASH) # THREAD_LOCAL_ACCESS
88
87
  NewRelic::Agent.record_api_supportability_metric :trace_execution_unscoped unless options[:internal]
89
88
  return yield unless NewRelic::Agent.tl_is_execution_traced?
90
89
  t0 = Process.clock_gettime(Process::CLOCK_MONOTONIC)
@@ -103,7 +102,7 @@ module NewRelic
103
102
  module AddMethodTracer
104
103
  ALLOWED_KEYS = [:metric, :push_scope, :code_header, :code_footer].freeze
105
104
 
106
- DEFAULT_SETTINGS = {:push_scope => true, :metric => true, :code_header => "", :code_footer => "" }.freeze
105
+ DEFAULT_SETTINGS = {:push_scope => true, :metric => true, :code_header => "", :code_footer => ""}.freeze
107
106
 
108
107
  # Checks the provided options to make sure that they make
109
108
  # sense. Raises an error if the options are incorrect to
@@ -117,7 +116,7 @@ module NewRelic
117
116
  unrecognized_keys = options.keys - ALLOWED_KEYS
118
117
  if unrecognized_keys.any?
119
118
  raise "Unrecognized options when adding method tracer to #{method_name}: " +
120
- unrecognized_keys.join(', ')
119
+ unrecognized_keys.join(', ')
121
120
  end
122
121
 
123
122
  options = DEFAULT_SETTINGS.merge(options)
@@ -279,8 +278,8 @@ module NewRelic
279
278
 
280
279
  prepend(_nr_traced_method_module)
281
280
 
282
- ::NewRelic::Agent.logger.debug("Traced method: class = #{_nr_derived_class_name},"+
283
- "method = #{method_name}, "+
281
+ ::NewRelic::Agent.logger.debug("Traced method: class = #{_nr_derived_class_name}," +
282
+ "method = #{method_name}, " +
284
283
  "metric = '#{metric_name}'")
285
284
  end
286
285
 
@@ -298,8 +297,8 @@ module NewRelic
298
297
  end
299
298
 
300
299
  def _nr_define_traced_method(method_name, scoped_metric: nil, unscoped_metrics: [],
301
- code_header: nil, code_footer: nil, record_metrics: true,
302
- visibility: :public)
300
+ code_header: nil, code_footer: nil, record_metrics: true,
301
+ visibility: :public)
303
302
  _nr_traced_method_module.module_eval do
304
303
  define_method(method_name) do |*args, &block|
305
304
  return super(*args, &block) unless NewRelic::Agent.tl_is_execution_traced?
@@ -310,9 +309,7 @@ module NewRelic
310
309
  instance_exec(*args, &scoped_metric)
311
310
  when String
312
311
  scoped_metric
313
- else
314
- nil
315
- end
312
+ end
316
313
 
317
314
  unscoped_metrics_eval = unscoped_metrics.map do |metric|
318
315
  metric.kind_of?(Proc) ? instance_exec(*args, &metric) : metric.to_s
@@ -9,12 +9,12 @@ module NewRelic
9
9
 
10
10
  extend self
11
11
 
12
- def trace_execution_scoped(metric_names, options=NewRelic::EMPTY_HASH) #THREAD_LOCAL_ACCESS
12
+ def trace_execution_scoped(metric_names, options = NewRelic::EMPTY_HASH) # THREAD_LOCAL_ACCESS
13
13
  state = NewRelic::Agent::Tracer.state
14
14
  return yield unless state.is_execution_traced?
15
15
 
16
16
  metric_names = Array(metric_names)
17
- first_name = metric_names.shift
17
+ first_name = metric_names.shift
18
18
  return yield unless first_name
19
19
 
20
20
  segment = NewRelic::Agent::Tracer.start_segment(
@@ -12,13 +12,12 @@ module NewRelic
12
12
  module Agent
13
13
  module DistributedTracing
14
14
  class CrossAppMonitor < InboundRequestMonitor
15
-
16
- NEWRELIC_ID_HEADER = 'X-NewRelic-ID'.freeze
17
- NEWRELIC_TXN_HEADER = 'X-NewRelic-Transaction'.freeze
15
+ NEWRELIC_ID_HEADER = 'X-NewRelic-ID'.freeze
16
+ NEWRELIC_TXN_HEADER = 'X-NewRelic-Transaction'.freeze
18
17
  NEWRELIC_APPDATA_HEADER = 'X-NewRelic-App-Data'.freeze
19
18
 
20
- NEWRELIC_ID_HEADER_KEY = 'HTTP_X_NEWRELIC_ID'.freeze
21
- NEWRELIC_TXN_HEADER_KEY = 'HTTP_X_NEWRELIC_TRANSACTION'.freeze
19
+ NEWRELIC_ID_HEADER_KEY = 'HTTP_X_NEWRELIC_ID'.freeze
20
+ NEWRELIC_TXN_HEADER_KEY = 'HTTP_X_NEWRELIC_TRANSACTION'.freeze
22
21
  CONTENT_LENGTH_HEADER_KEY = 'HTTP_CONTENT_LENGTH'.freeze
23
22
 
24
23
  def on_finished_configuring(events)
@@ -33,8 +32,8 @@ module NewRelic
33
32
  end
34
33
 
35
34
  def path_hash(txn_name, seed)
36
- rotated = ((seed << 1) | (seed >> 31)) & 0xffffffff
37
- app_name = NewRelic::Agent.config[:app_name].first
35
+ rotated = ((seed << 1) | (seed >> 31)) & 0xffffffff
36
+ app_name = NewRelic::Agent.config[:app_name].first
38
37
  identifier = "#{app_name};#{txn_name}"
39
38
  sprintf("%08x", rotated ^ hash_transaction_name(identifier))
40
39
  end
@@ -45,10 +44,10 @@ module NewRelic
45
44
  # :before_call will save our cross application request id to the thread
46
45
  # :after_call will write our response headers/metrics and clean up the thread
47
46
  def register_event_listeners(events)
48
- NewRelic::Agent.logger.
49
- debug("Wiring up Cross Application Tracing to events after finished configuring")
47
+ NewRelic::Agent.logger
48
+ .debug("Wiring up Cross Application Tracing to events after finished configuring")
50
49
 
51
- events.subscribe(:before_call) do |env| #THREAD_LOCAL_ACCESS
50
+ events.subscribe(:before_call) do |env| # THREAD_LOCAL_ACCESS
52
51
  if id = decoded_id(env) and should_process_request?(id)
53
52
  state = NewRelic::Agent::Tracer.state
54
53
 
@@ -63,7 +62,7 @@ module NewRelic
63
62
  end
64
63
  end
65
64
 
66
- events.subscribe(:after_call) do |env, (_status_code, headers, _body)| #THREAD_LOCAL_ACCESS
65
+ events.subscribe(:after_call) do |env, (_status_code, headers, _body)| # THREAD_LOCAL_ACCESS
67
66
  state = NewRelic::Agent::Tracer.state
68
67
 
69
68
  insert_response_header(state, env, headers)
@@ -92,7 +91,9 @@ module NewRelic
92
91
  def set_response_headers(transaction, response_headers, content_length)
93
92
  payload = obfuscator.obfuscate(
94
93
  ::JSON.dump(
95
- transaction.distributed_tracer.cross_app_payload.as_json_array(content_length)))
94
+ transaction.distributed_tracer.cross_app_payload.as_json_array(content_length)
95
+ )
96
+ )
96
97
 
97
98
  response_headers[NEWRELIC_APPDATA_HEADER] = payload
98
99
  end
@@ -13,7 +13,7 @@ module NewRelic
13
13
 
14
14
  def on_before_call(request)
15
15
  unless NewRelic::Agent.config[:'distributed_tracing.enabled']
16
- NewRelic::Agent.logger.warn "Not configured to accept distributed trace headers"
16
+ NewRelic::Agent.logger.warn "Not configured to accept distributed trace headers"
17
17
  return
18
18
  end
19
19
 
@@ -24,4 +24,4 @@ module NewRelic
24
24
  end
25
25
  end
26
26
  end
27
- end
27
+ end
@@ -16,7 +16,6 @@ require 'json'
16
16
  module NewRelic
17
17
  module Agent
18
18
  class InboundRequestMonitor
19
-
20
19
  attr_reader :obfuscator
21
20
 
22
21
  def initialize(events)
@@ -5,7 +5,7 @@
5
5
  module NewRelic
6
6
  module Agent
7
7
  class SyntheticsMonitor < InboundRequestMonitor
8
- SYNTHETICS_HEADER_KEY = 'HTTP_X_NEWRELIC_SYNTHETICS'.freeze
8
+ SYNTHETICS_HEADER_KEY = 'HTTP_X_NEWRELIC_SYNTHETICS'.freeze
9
9
 
10
10
  SUPPORTED_VERSION = 1
11
11
  EXPECTED_PAYLOAD_LENGTH = 5
@@ -14,7 +14,7 @@ module NewRelic
14
14
  events.subscribe(:before_call, &method(:on_before_call))
15
15
  end
16
16
 
17
- def on_before_call(request) #THREAD_LOCAL_ACCESS
17
+ def on_before_call(request) # THREAD_LOCAL_ACCESS
18
18
  encoded_header = request[SYNTHETICS_HEADER_KEY]
19
19
  return unless encoded_header
20
20
 
@@ -27,11 +27,10 @@ module NewRelic
27
27
 
28
28
  txn = Tracer.current_transaction
29
29
  txn.raw_synthetics_header = encoded_header
30
- txn.synthetics_payload = incoming_payload
30
+ txn.synthetics_payload = incoming_payload
31
31
  end
32
32
 
33
33
  class << self
34
-
35
34
  def is_supported_version?(incoming_payload)
36
35
  incoming_payload.first == SUPPORTED_VERSION
37
36
  end
@@ -46,11 +45,9 @@ module NewRelic
46
45
  end
47
46
 
48
47
  def reject_messaging_synthetics_header headers
49
- headers.reject {|k,_| k == CrossAppTracing::NR_MESSAGE_BROKER_SYNTHETICS_HEADER}
48
+ headers.reject { |k, _| k == CrossAppTracing::NR_MESSAGE_BROKER_SYNTHETICS_HEADER }
50
49
  end
51
-
52
50
  end
53
-
54
51
  end
55
52
  end
56
53
  end
@@ -21,7 +21,6 @@ module NewRelic
21
21
  @cross_app_monitor = NewRelic::Agent::DistributedTracing::CrossAppMonitor.new events
22
22
  @distributed_tracing_monitor = NewRelic::Agent::DistributedTracing::Monitor.new events
23
23
  end
24
-
25
24
  end
26
25
  end
27
- end
26
+ end
@@ -12,14 +12,14 @@ module NewRelic
12
12
  class NewRelicService
13
13
  module Encoders
14
14
  module Identity
15
- def self.encode(data, opts=nil)
15
+ def self.encode(data, opts = nil)
16
16
  data
17
17
  end
18
18
  end
19
19
 
20
20
  module Compressed
21
21
  module Deflate
22
- def self.encode(data, opts=nil)
22
+ def self.encode(data, opts = nil)
23
23
  Zlib::Deflate.deflate(data, Zlib::DEFAULT_COMPRESSION)
24
24
  end
25
25
  end
@@ -27,7 +27,7 @@ module NewRelic
27
27
  module Gzip
28
28
  BINARY = "BINARY".freeze
29
29
 
30
- def self.encode(data, opts=nil)
30
+ def self.encode(data, opts = nil)
31
31
  output = StringIO.new
32
32
  output.set_encoding BINARY
33
33
  gz = Zlib::GzipWriter.new(output, Zlib::DEFAULT_COMPRESSION, Zlib::DEFAULT_STRATEGY)
@@ -40,7 +40,7 @@ module NewRelic
40
40
  end
41
41
 
42
42
  module Base64CompressedJSON
43
- def self.encode(data, opts={})
43
+ def self.encode(data, opts = {})
44
44
  if !opts[:skip_normalization] && Agent.config[:normalize_json_string_encodings]
45
45
  data = NewRelic::Agent::EncodingNormalizer.normalize_object(data)
46
46
  end
@@ -27,7 +27,7 @@ module NewRelic
27
27
  ::NewRelic::Agent.logger.warn "Failed trying to watch for problematic yajl-ruby version.", err
28
28
  end
29
29
 
30
- def dump(ruby, opts={})
30
+ def dump(ruby, opts = {})
31
31
  prepared = prepare(ruby, opts)
32
32
 
33
33
  if !opts[:skip_normalization] && Agent.config[:normalize_json_string_encodings]
@@ -6,7 +6,7 @@ module NewRelic
6
6
  module Agent
7
7
  class NewRelicService
8
8
  class Marshaller
9
- def prepare(data, options={})
9
+ def prepare(data, options = {})
10
10
  encoder = options[:encoder] || default_encoder
11
11
  if data.respond_to?(:to_collector_array)
12
12
  data.to_collector_array(encoder)
@@ -6,7 +6,7 @@ module NewRelic
6
6
  module Agent
7
7
  class NewRelicService
8
8
  module SecurityPolicySettings
9
- EXPECTED_SECURITY_POLICIES = %w(
9
+ EXPECTED_SECURITY_POLICIES = %w[
10
10
  record_sql
11
11
  attributes_include
12
12
  allow_raw_exception_messages
@@ -14,12 +14,13 @@ module NewRelic
14
14
  custom_parameters
15
15
  custom_instrumentation_editor
16
16
  message_parameters
17
- job_arguments).map(&:freeze)
17
+ job_arguments
18
+ ].map(&:freeze)
18
19
 
19
20
  def self.preliminary_settings(security_policies)
20
21
  enabled_key = 'enabled'.freeze
21
22
  settings = EXPECTED_SECURITY_POLICIES.inject({}) do |memo, policy_name|
22
- memo[policy_name] = {enabled_key => security_policies[policy_name][enabled_key]}
23
+ memo[policy_name] = {enabled_key => security_policies[policy_name][enabled_key]}
23
24
  memo
24
25
  end
25
26
  {'security_policies' => settings}
@@ -35,7 +35,7 @@ module NewRelic
35
35
  attr_accessor :request_timeout
36
36
  attr_reader :collector, :marshaller, :agent_id
37
37
 
38
- def initialize(license_key=nil, collector=control.server)
38
+ def initialize(license_key = nil, collector = control.server)
39
39
  @license_key = license_key
40
40
  @collector = collector
41
41
  @configured_collector = collector
@@ -69,7 +69,7 @@ module NewRelic
69
69
  @agent_id = id
70
70
  end
71
71
 
72
- def connect(settings={})
72
+ def connect(settings = {})
73
73
  @request_headers_map = nil
74
74
  security_policies = nil
75
75
  if response = preconnect
@@ -128,7 +128,7 @@ module NewRelic
128
128
 
129
129
  def metric_data(stats_hash)
130
130
  timeslice_start = stats_hash.started_at
131
- timeslice_end = stats_hash.harvested_at || Process.clock_gettime(Process::CLOCK_REALTIME)
131
+ timeslice_end = stats_hash.harvested_at || Process.clock_gettime(Process::CLOCK_REALTIME)
132
132
  metric_data_array = build_metric_data_array(stats_hash)
133
133
  result = invoke_remote(
134
134
  :metric_data,
@@ -289,7 +289,7 @@ module NewRelic
289
289
  # Jruby 1.6.8 requires a gem for full ssl support and will throw
290
290
  # an error when use_ssl=(true) is called and jruby-openssl isn't
291
291
  # installed
292
- conn.use_ssl = true
292
+ conn.use_ssl = true
293
293
  conn.verify_mode = OpenSSL::SSL::VERIFY_PEER
294
294
  set_cert_store(conn)
295
295
  rescue StandardError, LoadError
@@ -299,7 +299,7 @@ module NewRelic
299
299
 
300
300
  def set_cert_store(conn)
301
301
  if NewRelic::Agent.config[:ca_bundle_path]
302
- conn.cert_store = ssl_cert_store
302
+ conn.cert_store = ssl_cert_store
303
303
  else
304
304
  ::NewRelic::Agent.logger.debug("Using default security certificates")
305
305
  end
@@ -388,15 +388,15 @@ module NewRelic
388
388
  def generate_remote_method_uri(method)
389
389
  params = {
390
390
  'protocol_version' => PROTOCOL_VERSION,
391
- 'license_key' => license_key,
392
- 'run_id' => @agent_id,
393
- 'method' => method,
394
- 'marshal_format' => 'json', # Other formats are explicitly
395
- # ruled out; see the initializer
391
+ 'license_key' => license_key,
392
+ 'run_id' => @agent_id,
393
+ 'method' => method,
394
+ 'marshal_format' => 'json' # Other formats are explicitly
395
+ # ruled out; see the initializer
396
396
  }
397
397
 
398
398
  uri = "/agent_listener/invoke_raw_method?"
399
- uri << params.map do |k,v|
399
+ uri << params.map do |k, v|
400
400
  next unless v
401
401
  "#{k}=#{v}"
402
402
  end.compact.join('&')
@@ -437,11 +437,11 @@ module NewRelic
437
437
 
438
438
  @audit_logger.log_request(full_uri, payload, @marshaller)
439
439
  request_send_ts = Process.clock_gettime(Process::CLOCK_MONOTONIC)
440
- response = send_request(:data => data,
441
- :uri => uri,
442
- :encoding => encoding,
443
- :collector => @collector,
444
- :endpoint => method)
440
+ response = send_request(:data => data,
441
+ :uri => uri,
442
+ :encoding => encoding,
443
+ :collector => @collector,
444
+ :endpoint => method)
445
445
  response_check_ts = Process.clock_gettime(Process::CLOCK_MONOTONIC)
446
446
  @marshaller.load(decompress_response(response))
447
447
  ensure
@@ -512,7 +512,7 @@ module NewRelic
512
512
  def send_request(opts)
513
513
  headers = {
514
514
  'Content-Encoding' => opts[:encoding],
515
- 'Host' => opts[:collector].name
515
+ 'Host' => opts[:collector].name
516
516
  }
517
517
  headers.merge!(@request_headers_map) if @request_headers_map
518
518
 
@@ -526,10 +526,10 @@ module NewRelic
526
526
  request.content_type = "application/octet-stream"
527
527
  request.body = opts[:data]
528
528
 
529
- response = nil
530
- attempts = 0
529
+ response = nil
530
+ attempts = 0
531
531
  max_attempts = 2
532
- endpoint = opts[:endpoint]
532
+ endpoint = opts[:endpoint]
533
533
 
534
534
  begin
535
535
  attempts += 1
@@ -5,7 +5,6 @@
5
5
 
6
6
  module NewRelic
7
7
  module Agent
8
-
9
8
  # This class is used for instrumentations that have exceptions or error classes
10
9
  # not derived from Ruby's usual Exception or StandardError or in situations
11
10
  # where we do not have such Exception object to work with.
@@ -17,6 +16,5 @@ module NewRelic
17
16
  @message = message
18
17
  end
19
18
  end
20
-
21
19
  end
22
20
  end
@@ -8,9 +8,13 @@ module NewRelic
8
8
  module Agent
9
9
  class NullLogger
10
10
  def fatal(*args); end
11
+
11
12
  def error(*args); end
12
- def warn(*args); end
13
- def info(*args); end
13
+
14
+ def warn(*args); end
15
+
16
+ def info(*args); end
17
+
14
18
  def debug(*args); end
15
19
 
16
20
  def method_missing(method, *args, &blk)
@@ -2,19 +2,18 @@
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 'base64'
5
+ # require 'base64'
6
6
 
7
7
  module NewRelic
8
8
  module Agent
9
9
  class Obfuscator
10
-
11
10
  attr_reader :key_bytes
12
11
 
13
12
  EMPTY_KEY_BYTES = [0]
14
13
  PACK_FORMAT = 'm'
15
14
 
16
15
  # RUM uses a shortened key, so just trim it up front
17
- def initialize(key, length=nil)
16
+ def initialize(key, length = nil)
18
17
  if key.nil? || key.empty?
19
18
  @key_bytes = EMPTY_KEY_BYTES
20
19
  else
@@ -24,26 +23,25 @@ module NewRelic
24
23
  end
25
24
 
26
25
  def obfuscate(text)
27
- [ encode(text) ].pack(PACK_FORMAT).gsub(/\n/, '')
26
+ [encode(text)].pack(PACK_FORMAT).gsub(/\n/, '')
28
27
  end
29
28
 
30
29
  def deobfuscate(text)
31
- encode(text.unpack(PACK_FORMAT).first )
30
+ encode(text.unpack(PACK_FORMAT).first)
32
31
  end
33
32
 
34
33
  def encode(text)
35
34
  return text unless key_bytes
36
35
 
37
36
  encoded = ""
38
- encoded.force_encoding('binary') if encoded.respond_to?( :force_encoding )
37
+ encoded.force_encoding('binary') if encoded.respond_to?(:force_encoding)
39
38
  index = 0
40
39
  text.each_byte do |byte|
41
40
  encoded.concat((byte ^ key_bytes[index % key_bytes.length]))
42
- index+=1
41
+ index += 1
43
42
  end
44
43
  encoded
45
44
  end
46
-
47
45
  end
48
46
  end
49
47
  end
@@ -10,16 +10,14 @@ module NewRelic
10
10
  ACTION_DISPATCH_PARAMETER_FILTER = "action_dispatch.parameter_filter".freeze
11
11
 
12
12
  RAILS_FILTER_CLASS = if defined?(ActiveSupport::ParameterFilter)
13
- ActiveSupport::ParameterFilter
13
+ ActiveSupport::ParameterFilter
14
14
  elsif defined?(ActionDispatch::Http::ParameterFilter)
15
15
  ActionDispatch::Http::ParameterFilter
16
- else
17
- nil
18
16
  end
19
17
 
20
18
  def apply_filters(env, params)
21
19
  if filters = env[ACTION_DISPATCH_PARAMETER_FILTER]
22
- params = filter_using_rails(params, filters)
20
+ params = filter_using_rails(params, filters)
23
21
  end
24
22
  params = filter_rack_file_data(env, params)
25
23
  params
@@ -36,7 +34,7 @@ module NewRelic
36
34
  content_type = env["CONTENT_TYPE"]
37
35
  multipart = content_type && content_type.start_with?("multipart")
38
36
 
39
- params.inject({}) do |memo, (k,v)|
37
+ params.inject({}) do |memo, (k, v)|
40
38
  if multipart && v.is_a?(Hash) && v[:tempfile]
41
39
  memo[k] = "[FILE]"
42
40
  else
@@ -6,7 +6,6 @@
6
6
  module NewRelic
7
7
  module Agent
8
8
  module PayloadMetricMapping
9
-
10
9
  # this logic was extracted from TransactionEventAggregator for reuse by
11
10
  # the ErrorEventAggregator
12
11
 
@@ -28,7 +27,7 @@ module NewRelic
28
27
 
29
28
  private
30
29
 
31
- def map_metric(metric_name, to_add={})
30
+ def map_metric(metric_name, to_add = {})
32
31
  to_add.values.each(&:freeze)
33
32
 
34
33
  mappings = SPEC_MAPPINGS.fetch(metric_name, {})
@@ -41,18 +40,18 @@ module NewRelic
41
40
  # All Transactions
42
41
  # Don't need to use the transaction-type specific metrics since this is
43
42
  # scoped to just one transaction, so Datastore/all has what we want.
44
- map_metric('Datastore/all', :total_call_time => 'databaseDuration')
45
- map_metric('Datastore/all', :call_count => 'databaseCallCount')
46
- map_metric('GC/Transaction/all', :total_call_time => 'gcCumulative')
43
+ map_metric('Datastore/all', :total_call_time => 'databaseDuration')
44
+ map_metric('Datastore/all', :call_count => 'databaseCallCount')
45
+ map_metric('GC/Transaction/all', :total_call_time => 'gcCumulative')
47
46
 
48
47
  # Web Metrics
49
48
  map_metric('WebFrontend/QueueTime', :total_call_time => 'queueDuration')
50
- map_metric('External/allWeb', :total_call_time => 'externalDuration')
51
- map_metric('External/allWeb', :call_count => 'externalCallCount')
49
+ map_metric('External/allWeb', :total_call_time => 'externalDuration')
50
+ map_metric('External/allWeb', :call_count => 'externalCallCount')
52
51
 
53
52
  # Background Metrics
54
- map_metric('External/allOther', :total_call_time => 'externalDuration')
55
- map_metric('External/allOther', :call_count => 'externalCallCount')
53
+ map_metric('External/allOther', :total_call_time => 'externalDuration')
54
+ map_metric('External/allOther', :call_count => 'externalCallCount')
56
55
  end
57
56
  end
58
57
  end
@@ -6,7 +6,6 @@ require 'base64'
6
6
 
7
7
  module NewRelic
8
8
  module Agent
9
-
10
9
  #--
11
10
  # Manages the registering and servicing of pipes used by child
12
11
  # processes to report data to their parent, rather than directly
@@ -128,7 +127,7 @@ module NewRelic
128
127
  end
129
128
 
130
129
  class Listener
131
- attr_reader :thread
130
+ attr_reader :thread
132
131
 
133
132
  # This attr_accessor intentionally provides unsynchronized access to the
134
133
  # @pipes hash. It is used to look up the write end of the pipe from
@@ -168,7 +167,7 @@ module NewRelic
168
167
  clean_up_pipes
169
168
 
170
169
  pipes_to_listen_to = @pipes_lock.synchronize do
171
- @pipes.values.map{|pipe| pipe.out} + [wake.out]
170
+ @pipes.values.map { |pipe| pipe.out } + [wake.out]
172
171
  end
173
172
 
174
173
  if now
@@ -255,7 +254,7 @@ module NewRelic
255
254
  end
256
255
 
257
256
  def should_keep_listening?
258
- @started || @pipes_lock.synchronize { @pipes.values.find{|pipe| !pipe.in.closed?} }
257
+ @started || @pipes_lock.synchronize { @pipes.values.find { |pipe| !pipe.in.closed? } }
259
258
  end
260
259
 
261
260
  def clean_up_pipes
@@ -265,13 +264,13 @@ module NewRelic
265
264
  pipe.close unless pipe.closed?
266
265
  end
267
266
  end
268
- @pipes.reject! {|id, pipe| pipe.out.closed? }
267
+ @pipes.reject! { |id, pipe| pipe.out.closed? }
269
268
  end
270
269
  end
271
270
 
272
271
  def find_pipe_for_handle(out_handle)
273
272
  @pipes_lock.synchronize do
274
- @pipes.values.find{|pipe| pipe.out == out_handle }
273
+ @pipes.values.find { |pipe| pipe.out == out_handle }
275
274
  end
276
275
  end
277
276
  end
@@ -11,7 +11,7 @@ module NewRelic
11
11
  def initialize(channel_id)
12
12
  @channel_id = channel_id
13
13
  @collector = NewRelic::Control::Server.new(:name => 'parent',
14
- :port => 0)
14
+ :port => 0)
15
15
  @pipe = NewRelic::Agent::PipeChannelManager.channels[@channel_id]
16
16
  if @pipe && @pipe.parent_pid != $$
17
17
  @pipe.after_fork_in_child