newrelic_rpm 7.0.0 → 8.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (320) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -1
  3. data/.rubocop.yml +1941 -0
  4. data/.yardopts +1 -0
  5. data/Brewfile +10 -0
  6. data/CHANGELOG.md +431 -1
  7. data/CONTRIBUTING.md +32 -5
  8. data/DOCKER.md +167 -0
  9. data/Dockerfile +10 -0
  10. data/Guardfile +8 -8
  11. data/LICENSE +0 -6
  12. data/README.md +20 -18
  13. data/Rakefile +39 -29
  14. data/THIRD_PARTY_NOTICES.md +14 -199
  15. data/bin/mongrel_rpm +8 -9
  16. data/bin/newrelic +1 -1
  17. data/bin/nrdebug +14 -14
  18. data/docker-compose.yml +85 -0
  19. data/init.rb +0 -2
  20. data/lefthook.yml +9 -0
  21. data/lib/new_relic/agent/adaptive_sampler.rb +9 -5
  22. data/lib/new_relic/agent/agent.rb +72 -49
  23. data/lib/new_relic/agent/agent_logger.rb +15 -9
  24. data/lib/new_relic/agent/attribute_filter.rb +31 -31
  25. data/lib/new_relic/agent/attributes.rb +2 -2
  26. data/lib/new_relic/agent/audit_logger.rb +4 -0
  27. data/lib/new_relic/agent/autostart.rb +19 -17
  28. data/lib/new_relic/agent/commands/agent_command.rb +2 -2
  29. data/lib/new_relic/agent/commands/agent_command_router.rb +6 -5
  30. data/lib/new_relic/agent/commands/thread_profiler_session.rb +7 -6
  31. data/lib/new_relic/agent/configuration/default_source.rb +731 -476
  32. data/lib/new_relic/agent/configuration/dotted_hash.rb +3 -3
  33. data/lib/new_relic/agent/configuration/environment_source.rb +5 -4
  34. data/lib/new_relic/agent/configuration/event_harvest_config.rb +39 -16
  35. data/lib/new_relic/agent/configuration/high_security_source.rb +7 -7
  36. data/lib/new_relic/agent/configuration/manager.rb +74 -64
  37. data/lib/new_relic/agent/configuration/mask_defaults.rb +1 -1
  38. data/lib/new_relic/agent/configuration/security_policy_source.rb +73 -73
  39. data/lib/new_relic/agent/configuration/server_source.rb +14 -12
  40. data/lib/new_relic/agent/configuration/yaml_source.rb +26 -5
  41. data/lib/new_relic/agent/connect/request_builder.rb +14 -15
  42. data/lib/new_relic/agent/connect/response_handler.rb +0 -3
  43. data/lib/new_relic/agent/custom_event_aggregator.rb +9 -9
  44. data/lib/new_relic/agent/database/explain_plan_helpers.rb +3 -4
  45. data/lib/new_relic/agent/database/obfuscation_helpers.rb +12 -12
  46. data/lib/new_relic/agent/database/postgres_explain_obfuscator.rb +2 -2
  47. data/lib/new_relic/agent/database.rb +30 -31
  48. data/lib/new_relic/agent/datastores/metric_helper.rb +13 -11
  49. data/lib/new_relic/agent/datastores/mongo/event_formatter.rb +2 -3
  50. data/lib/new_relic/agent/datastores/mongo/metric_translator.rb +3 -5
  51. data/lib/new_relic/agent/datastores/mongo/obfuscator.rb +1 -2
  52. data/lib/new_relic/agent/datastores/mongo.rb +5 -10
  53. data/lib/new_relic/agent/datastores/redis.rb +2 -4
  54. data/lib/new_relic/agent/datastores.rb +7 -9
  55. data/lib/new_relic/agent/distributed_tracing/cross_app_payload.rb +9 -9
  56. data/lib/new_relic/agent/distributed_tracing/cross_app_tracing.rb +21 -16
  57. data/lib/new_relic/agent/distributed_tracing/distributed_trace_attributes.rb +10 -12
  58. data/lib/new_relic/agent/distributed_tracing/distributed_trace_payload.rb +42 -43
  59. data/lib/new_relic/agent/distributed_tracing/distributed_trace_transport_type.rb +3 -3
  60. data/lib/new_relic/agent/distributed_tracing/trace_context.rb +41 -43
  61. data/lib/new_relic/agent/distributed_tracing/trace_context_payload.rb +25 -25
  62. data/lib/new_relic/agent/distributed_tracing.rb +17 -18
  63. data/lib/new_relic/agent/encoding_normalizer.rb +1 -1
  64. data/lib/new_relic/agent/error_collector.rb +65 -50
  65. data/lib/new_relic/agent/error_event_aggregator.rb +1 -1
  66. data/lib/new_relic/agent/error_filter.rb +173 -0
  67. data/lib/new_relic/agent/error_trace_aggregator.rb +1 -1
  68. data/lib/new_relic/agent/event_aggregator.rb +1 -1
  69. data/lib/new_relic/agent/event_buffer.rb +6 -7
  70. data/lib/new_relic/agent/event_listener.rb +0 -1
  71. data/lib/new_relic/agent/event_loop.rb +14 -14
  72. data/lib/new_relic/agent/external.rb +1 -34
  73. data/lib/new_relic/agent/guid_generator.rb +2 -9
  74. data/lib/new_relic/agent/harvester.rb +3 -4
  75. data/lib/new_relic/agent/heap.rb +1 -3
  76. data/lib/new_relic/agent/hostname.rb +16 -10
  77. data/lib/new_relic/agent/http_clients/abstract.rb +7 -9
  78. data/lib/new_relic/agent/http_clients/curb_wrappers.rb +1 -5
  79. data/lib/new_relic/agent/http_clients/excon_wrappers.rb +4 -4
  80. data/lib/new_relic/agent/http_clients/http_rb_wrappers.rb +3 -3
  81. data/lib/new_relic/agent/http_clients/httpclient_wrappers.rb +1 -2
  82. data/lib/new_relic/agent/http_clients/net_http_wrappers.rb +8 -3
  83. data/lib/new_relic/agent/http_clients/typhoeus_wrappers.rb +2 -3
  84. data/lib/new_relic/agent/http_clients/uri_util.rb +0 -1
  85. data/lib/new_relic/agent/instrumentation/action_cable_subscriber.rb +2 -3
  86. data/lib/new_relic/agent/instrumentation/action_controller_subscriber.rb +28 -26
  87. data/lib/new_relic/agent/instrumentation/action_view_subscriber.rb +5 -7
  88. data/lib/new_relic/agent/instrumentation/active_job.rb +12 -5
  89. data/lib/new_relic/agent/instrumentation/active_merchant.rb +17 -3
  90. data/lib/new_relic/agent/instrumentation/active_record.rb +20 -18
  91. data/lib/new_relic/agent/instrumentation/active_record_helper.rb +56 -46
  92. data/lib/new_relic/agent/instrumentation/active_record_notifications.rb +28 -25
  93. data/lib/new_relic/agent/instrumentation/active_record_prepend.rb +3 -3
  94. data/lib/new_relic/agent/instrumentation/active_record_subscriber.rb +22 -16
  95. data/lib/new_relic/agent/instrumentation/active_storage.rb +1 -1
  96. data/lib/new_relic/agent/instrumentation/active_support_logger/chain.rb +23 -0
  97. data/lib/new_relic/agent/instrumentation/active_support_logger/instrumentation.rb +20 -0
  98. data/lib/new_relic/agent/instrumentation/active_support_logger/prepend.rb +12 -0
  99. data/lib/new_relic/agent/instrumentation/active_support_logger.rb +24 -0
  100. data/lib/new_relic/agent/instrumentation/acts_as_solr.rb +18 -9
  101. data/lib/new_relic/agent/instrumentation/authlogic.rb +10 -0
  102. data/lib/new_relic/agent/instrumentation/bunny/chain.rb +1 -1
  103. data/lib/new_relic/agent/instrumentation/bunny/instrumentation.rb +8 -9
  104. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +52 -46
  105. data/lib/new_relic/agent/instrumentation/curb/chain.rb +20 -21
  106. data/lib/new_relic/agent/instrumentation/curb/instrumentation.rb +34 -38
  107. data/lib/new_relic/agent/instrumentation/curb/prepend.rb +10 -11
  108. data/lib/new_relic/agent/instrumentation/data_mapper.rb +22 -10
  109. data/lib/new_relic/agent/instrumentation/delayed_job/chain.rb +5 -7
  110. data/lib/new_relic/agent/instrumentation/delayed_job/instrumentation.rb +5 -9
  111. data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +23 -4
  112. data/lib/new_relic/agent/instrumentation/excon/middleware.rb +2 -2
  113. data/lib/new_relic/agent/instrumentation/excon.rb +3 -23
  114. data/lib/new_relic/agent/instrumentation/grape/chain.rb +1 -2
  115. data/lib/new_relic/agent/instrumentation/grape/instrumentation.rb +6 -7
  116. data/lib/new_relic/agent/instrumentation/grape.rb +2 -3
  117. data/lib/new_relic/agent/instrumentation/httpclient/chain.rb +2 -3
  118. data/lib/new_relic/agent/instrumentation/httpclient/instrumentation.rb +0 -1
  119. data/lib/new_relic/agent/instrumentation/httpclient/prepend.rb +0 -2
  120. data/lib/new_relic/agent/instrumentation/httprb/chain.rb +2 -2
  121. data/lib/new_relic/agent/instrumentation/httprb/instrumentation.rb +6 -6
  122. data/lib/new_relic/agent/instrumentation/httprb/prepend.rb +1 -1
  123. data/lib/new_relic/agent/instrumentation/ignore_actions.rb +2 -3
  124. data/lib/new_relic/agent/instrumentation/logger/chain.rb +21 -0
  125. data/lib/new_relic/agent/instrumentation/logger/instrumentation.rb +58 -0
  126. data/lib/new_relic/agent/instrumentation/logger/prepend.rb +13 -0
  127. data/lib/new_relic/agent/instrumentation/logger.rb +26 -0
  128. data/lib/new_relic/agent/instrumentation/memcache/dalli.rb +7 -2
  129. data/lib/new_relic/agent/instrumentation/memcache/helper.rb +5 -1
  130. data/lib/new_relic/agent/instrumentation/memcache/prepend.rb +9 -2
  131. data/lib/new_relic/agent/instrumentation/middleware_proxy.rb +9 -10
  132. data/lib/new_relic/agent/instrumentation/middleware_tracing.rb +5 -6
  133. data/lib/new_relic/agent/instrumentation/mongo.rb +3 -141
  134. data/lib/new_relic/agent/instrumentation/mongodb_command_subscriber.rb +4 -4
  135. data/lib/new_relic/agent/instrumentation/net_http/chain.rb +3 -4
  136. data/lib/new_relic/agent/instrumentation/net_http/instrumentation.rb +5 -5
  137. data/lib/new_relic/agent/instrumentation/net_http/prepend.rb +4 -4
  138. data/lib/new_relic/agent/instrumentation/net_http.rb +7 -2
  139. data/lib/new_relic/agent/instrumentation/notifications_subscriber.rb +2 -3
  140. data/lib/new_relic/agent/instrumentation/padrino/chain.rb +23 -19
  141. data/lib/new_relic/agent/instrumentation/padrino/instrumentation.rb +3 -2
  142. data/lib/new_relic/agent/instrumentation/padrino/prepend.rb +2 -2
  143. data/lib/new_relic/agent/instrumentation/padrino.rb +2 -5
  144. data/lib/new_relic/agent/instrumentation/queue_time.rb +8 -8
  145. data/lib/new_relic/agent/instrumentation/rack/chain.rb +8 -7
  146. data/lib/new_relic/agent/instrumentation/rack/helpers.rb +2 -1
  147. data/lib/new_relic/agent/instrumentation/rack/instrumentation.rb +4 -5
  148. data/lib/new_relic/agent/instrumentation/rack/prepend.rb +2 -2
  149. data/lib/new_relic/agent/instrumentation/rack.rb +1 -1
  150. data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +11 -47
  151. data/lib/new_relic/agent/instrumentation/rails_notifications/action_cable.rb +2 -2
  152. data/lib/new_relic/agent/instrumentation/rails_notifications/action_controller.rb +0 -1
  153. data/lib/new_relic/agent/instrumentation/rainbows_instrumentation.rb +11 -0
  154. data/lib/new_relic/agent/instrumentation/rake/chain.rb +0 -5
  155. data/lib/new_relic/agent/instrumentation/rake/instrumentation.rb +6 -6
  156. data/lib/new_relic/agent/instrumentation/rake.rb +1 -1
  157. data/lib/new_relic/agent/instrumentation/redis/chain.rb +6 -6
  158. data/lib/new_relic/agent/instrumentation/redis/instrumentation.rb +2 -2
  159. data/lib/new_relic/agent/instrumentation/redis/prepend.rb +1 -1
  160. data/lib/new_relic/agent/instrumentation/redis.rb +5 -1
  161. data/lib/new_relic/agent/instrumentation/resque/chain.rb +2 -3
  162. data/lib/new_relic/agent/instrumentation/resque/helper.rb +19 -0
  163. data/lib/new_relic/agent/instrumentation/resque/instrumentation.rb +9 -7
  164. data/lib/new_relic/agent/instrumentation/resque/prepend.rb +1 -2
  165. data/lib/new_relic/agent/instrumentation/resque.rb +17 -8
  166. data/lib/new_relic/agent/instrumentation/sequel.rb +7 -9
  167. data/lib/new_relic/agent/instrumentation/sequel_helper.rb +1 -1
  168. data/lib/new_relic/agent/instrumentation/sidekiq.rb +22 -1
  169. data/lib/new_relic/agent/instrumentation/sinatra/ignorer.rb +0 -1
  170. data/lib/new_relic/agent/instrumentation/sinatra/instrumentation.rb +12 -5
  171. data/lib/new_relic/agent/instrumentation/sinatra.rb +21 -11
  172. data/lib/new_relic/agent/instrumentation/sunspot.rb +11 -1
  173. data/lib/new_relic/agent/instrumentation/thread/chain.rb +24 -0
  174. data/lib/new_relic/agent/instrumentation/thread/instrumentation.rb +27 -0
  175. data/lib/new_relic/agent/instrumentation/thread/prepend.rb +22 -0
  176. data/lib/new_relic/agent/instrumentation/thread.rb +20 -0
  177. data/lib/new_relic/agent/instrumentation/tilt/chain.rb +24 -0
  178. data/lib/new_relic/agent/instrumentation/tilt/instrumentation.rb +40 -0
  179. data/lib/new_relic/agent/instrumentation/tilt/prepend.rb +13 -0
  180. data/lib/new_relic/agent/instrumentation/tilt.rb +25 -0
  181. data/lib/new_relic/agent/instrumentation/typhoeus/chain.rb +4 -4
  182. data/lib/new_relic/agent/instrumentation/typhoeus/instrumentation.rb +3 -5
  183. data/lib/new_relic/agent/instrumentation/typhoeus/prepend.rb +1 -1
  184. data/lib/new_relic/agent/internal_agent_error.rb +1 -1
  185. data/lib/new_relic/agent/javascript_instrumentor.rb +38 -33
  186. data/lib/new_relic/agent/linking_metadata.rb +45 -0
  187. data/lib/new_relic/agent/local_log_decorator.rb +37 -0
  188. data/lib/new_relic/agent/log_event_aggregator.rb +234 -0
  189. data/lib/new_relic/agent/log_priority.rb +20 -0
  190. data/lib/new_relic/agent/logging.rb +11 -8
  191. data/lib/new_relic/agent/memory_logger.rb +1 -1
  192. data/lib/new_relic/agent/messaging.rb +46 -62
  193. data/lib/new_relic/agent/method_tracer.rb +145 -144
  194. data/lib/new_relic/agent/method_tracer_helpers.rb +82 -2
  195. data/lib/new_relic/agent/monitors/cross_app_monitor.rb +21 -13
  196. data/lib/new_relic/agent/monitors/distributed_tracing_monitor.rb +2 -2
  197. data/lib/new_relic/agent/monitors/inbound_request_monitor.rb +0 -1
  198. data/lib/new_relic/agent/monitors/synthetics_monitor.rb +4 -7
  199. data/lib/new_relic/agent/monitors.rb +1 -2
  200. data/lib/new_relic/agent/new_relic_service/encoders.rb +4 -4
  201. data/lib/new_relic/agent/new_relic_service/json_marshaller.rb +1 -1
  202. data/lib/new_relic/agent/new_relic_service/marshaller.rb +1 -1
  203. data/lib/new_relic/agent/new_relic_service/security_policy_settings.rb +4 -3
  204. data/lib/new_relic/agent/new_relic_service.rb +61 -53
  205. data/lib/new_relic/agent/noticible_error.rb +0 -2
  206. data/lib/new_relic/agent/null_logger.rb +6 -2
  207. data/lib/new_relic/agent/obfuscator.rb +6 -8
  208. data/lib/new_relic/agent/parameter_filtering.rb +16 -8
  209. data/lib/new_relic/agent/payload_metric_mapping.rb +8 -9
  210. data/lib/new_relic/agent/pipe_channel_manager.rb +15 -12
  211. data/lib/new_relic/agent/pipe_service.rb +6 -3
  212. data/lib/new_relic/agent/priority_sampled_buffer.rb +4 -7
  213. data/lib/new_relic/agent/rules_engine/replacement_rule.rb +9 -9
  214. data/lib/new_relic/agent/rules_engine/segment_terms_rule.rb +12 -12
  215. data/lib/new_relic/agent/rules_engine.rb +2 -2
  216. data/lib/new_relic/agent/sampler.rb +2 -3
  217. data/lib/new_relic/agent/sampler_collection.rb +2 -3
  218. data/lib/new_relic/agent/samplers/cpu_sampler.rb +1 -1
  219. data/lib/new_relic/agent/samplers/delayed_job_sampler.rb +10 -7
  220. data/lib/new_relic/agent/samplers/memory_sampler.rb +9 -3
  221. data/lib/new_relic/agent/samplers/vm_sampler.rb +18 -18
  222. data/lib/new_relic/agent/span_event_aggregator.rb +10 -10
  223. data/lib/new_relic/agent/span_event_primitive.rb +48 -45
  224. data/lib/new_relic/agent/sql_sampler.rb +9 -9
  225. data/lib/new_relic/agent/stats.rb +62 -37
  226. data/lib/new_relic/agent/stats_engine/gc_profiler.rb +7 -9
  227. data/lib/new_relic/agent/stats_engine/stats_hash.rb +8 -9
  228. data/lib/new_relic/agent/stats_engine.rb +7 -7
  229. data/lib/new_relic/agent/synthetics_event_aggregator.rb +1 -2
  230. data/lib/new_relic/agent/system_info.rb +22 -20
  231. data/lib/new_relic/agent/threading/agent_thread.rb +4 -5
  232. data/lib/new_relic/agent/threading/backtrace_node.rb +6 -9
  233. data/lib/new_relic/agent/threading/backtrace_service.rb +12 -13
  234. data/lib/new_relic/agent/threading/thread_profile.rb +16 -19
  235. data/lib/new_relic/agent/tracer.rb +57 -72
  236. data/lib/new_relic/agent/transaction/abstract_segment.rb +38 -10
  237. data/lib/new_relic/agent/transaction/datastore_segment.rb +7 -6
  238. data/lib/new_relic/agent/transaction/distributed_tracer.rb +8 -9
  239. data/lib/new_relic/agent/transaction/distributed_tracing.rb +21 -22
  240. data/lib/new_relic/agent/transaction/external_request_segment.rb +6 -5
  241. data/lib/new_relic/agent/transaction/message_broker_segment.rb +24 -30
  242. data/lib/new_relic/agent/transaction/request_attributes.rb +7 -7
  243. data/lib/new_relic/agent/transaction/segment.rb +6 -3
  244. data/lib/new_relic/agent/transaction/slowest_sample_buffer.rb +0 -2
  245. data/lib/new_relic/agent/transaction/trace.rb +8 -8
  246. data/lib/new_relic/agent/transaction/trace_context.rb +14 -16
  247. data/lib/new_relic/agent/transaction/trace_node.rb +16 -16
  248. data/lib/new_relic/agent/transaction/tracing.rb +9 -6
  249. data/lib/new_relic/agent/transaction/transaction_sample_buffer.rb +1 -2
  250. data/lib/new_relic/agent/transaction.rb +132 -119
  251. data/lib/new_relic/agent/transaction_error_primitive.rb +18 -16
  252. data/lib/new_relic/agent/transaction_event_aggregator.rb +7 -8
  253. data/lib/new_relic/agent/transaction_event_primitive.rb +29 -29
  254. data/lib/new_relic/agent/transaction_event_recorder.rb +1 -1
  255. data/lib/new_relic/agent/transaction_metrics.rb +8 -7
  256. data/lib/new_relic/agent/transaction_sampler.rb +0 -1
  257. data/lib/new_relic/agent/transaction_time_aggregator.rb +11 -11
  258. data/lib/new_relic/agent/utilization/aws.rb +32 -2
  259. data/lib/new_relic/agent/utilization/azure.rb +1 -1
  260. data/lib/new_relic/agent/utilization/vendor.rb +15 -2
  261. data/lib/new_relic/agent/utilization_data.rb +3 -4
  262. data/lib/new_relic/agent/vm/monotonic_gc_profiler.rb +1 -1
  263. data/lib/new_relic/agent/vm/mri_vm.rb +13 -1
  264. data/lib/new_relic/agent/vm/snapshot.rb +4 -4
  265. data/lib/new_relic/agent/worker_loop.rb +8 -10
  266. data/lib/new_relic/agent.rb +36 -41
  267. data/lib/new_relic/cli/command.rb +15 -17
  268. data/lib/new_relic/cli/commands/deployments.rb +21 -23
  269. data/lib/new_relic/cli/commands/install.rb +6 -10
  270. data/lib/new_relic/coerce.rb +5 -8
  271. data/lib/new_relic/collection_helper.rb +48 -47
  272. data/lib/new_relic/constants.rb +0 -4
  273. data/lib/new_relic/control/class_methods.rb +2 -2
  274. data/lib/new_relic/control/frameworks/external.rb +1 -1
  275. data/lib/new_relic/control/frameworks/rails.rb +5 -6
  276. data/lib/new_relic/control/frameworks/rails3.rb +2 -3
  277. data/lib/new_relic/control/frameworks/ruby.rb +2 -2
  278. data/lib/new_relic/control/frameworks/sinatra.rb +6 -0
  279. data/lib/new_relic/control/instance_methods.rb +4 -5
  280. data/lib/new_relic/control/instrumentation.rb +35 -5
  281. data/lib/new_relic/control/server_methods.rb +2 -3
  282. data/lib/new_relic/control.rb +0 -1
  283. data/lib/new_relic/dependency_detection.rb +7 -9
  284. data/lib/new_relic/environment_report.rb +16 -18
  285. data/lib/new_relic/helper.rb +45 -5
  286. data/lib/new_relic/language_support.rb +20 -2
  287. data/lib/new_relic/latest_changes.rb +2 -2
  288. data/lib/new_relic/local_environment.rb +9 -7
  289. data/lib/new_relic/metric_data.rb +6 -7
  290. data/lib/new_relic/metric_spec.rb +3 -3
  291. data/lib/new_relic/noticed_error.rb +18 -19
  292. data/lib/new_relic/rack/agent_middleware.rb +2 -2
  293. data/lib/new_relic/rack/browser_monitoring.rb +9 -9
  294. data/lib/new_relic/recipes/capistrano3.rb +11 -13
  295. data/lib/new_relic/recipes/capistrano_legacy.rb +11 -14
  296. data/lib/new_relic/supportability_helper.rb +2 -2
  297. data/lib/new_relic/traced_thread.rb +35 -0
  298. data/lib/new_relic/version.rb +5 -16
  299. data/lib/newrelic_rpm.rb +10 -34
  300. data/lib/sequel/extensions/newrelic_instrumentation.rb +4 -7
  301. data/lib/sequel/plugins/newrelic_instrumentation.rb +3 -9
  302. data/lib/tasks/all.rb +2 -2
  303. data/lib/tasks/config.html.erb +14 -25
  304. data/lib/tasks/config.rake +36 -27
  305. data/lib/tasks/multiverse.rb +4 -6
  306. data/lib/tasks/tests.rake +3 -7
  307. data/newrelic.yml +610 -3
  308. data/newrelic_rpm.gemspec +14 -14
  309. data/recipes/newrelic.rb +1 -1
  310. data/test/agent_helper.rb +98 -59
  311. metadata +69 -20
  312. data/ROADMAP.md +0 -24
  313. data/lib/new_relic/agent/datastores/mongo/statement_formatter.rb +0 -53
  314. data/lib/new_relic/agent/instrumentation/excon/connection.rb +0 -49
  315. data/lib/new_relic/agent/instrumentation/merb/controller.rb +0 -44
  316. data/lib/new_relic/agent/instrumentation/merb/errors.rb +0 -33
  317. data/lib/new_relic/agent/instrumentation/rails/action_controller.rb +0 -125
  318. data/lib/new_relic/agent/instrumentation/rails/action_web_service.rb +0 -46
  319. data/lib/new_relic/agent/supported_versions.rb +0 -275
  320. data/lib/new_relic/control/frameworks/merb.rb +0 -29
@@ -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
@@ -131,15 +131,15 @@ module NewRelic
131
131
  'execute',
132
132
  'call'
133
133
  ]
134
-
134
+ OTHER_OPERATION = 'other'.freeze
135
135
  SQL_COMMENT_REGEX = Regexp.new('/\*.*?\*/', Regexp::MULTILINE).freeze
136
136
 
137
137
  def parse_operation_from_query(sql)
138
138
  sql = Helper.correctly_encoded(sql).gsub(SQL_COMMENT_REGEX, NewRelic::EMPTY_STR)
139
- if sql =~ /(\w+)/
140
- op = $1.downcase
141
- return op if KNOWN_OPERATIONS.include?(op)
142
- end
139
+ return unless sql =~ /(\w+)/
140
+
141
+ op = Regexp.last_match(1).downcase
142
+ KNOWN_OPERATIONS.include?(op) ? op : OTHER_OPERATION
143
143
  end
144
144
 
145
145
  class ConnectionManager
@@ -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,17 +218,18 @@ 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
 
228
224
  def explain
229
225
  return unless explainable?
230
226
  handle_exception_in_explain do
231
- start = Time.now
227
+ start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
232
228
  plan = @explainer.call(self)
233
- ::NewRelic::Agent.record_metric("Supportability/Database/execute_explain_plan", Time.now - start)
229
+ ::NewRelic::Agent.record_metric(
230
+ "Supportability/Database/execute_explain_plan",
231
+ Process.clock_gettime(Process::CLOCK_MONOTONIC) - start
232
+ )
234
233
  return process_resultset(plan, adapter) if plan
235
234
  end
236
235
  end
@@ -244,11 +243,11 @@ module NewRelic
244
243
 
245
244
  private
246
245
 
247
- POSTGIS_PREFIX = 'postgis'.freeze
246
+ POSTGIS_PREFIX = 'postgis'.freeze
248
247
  POSTGRES_PREFIX = 'postgres'.freeze
249
- MYSQL_PREFIX = 'mysql'.freeze
250
- MYSQL2_PREFIX = 'mysql2'.freeze
251
- SQLITE_PREFIX = 'sqlite'.freeze
248
+ MYSQL_PREFIX = 'mysql'.freeze
249
+ MYSQL2_PREFIX = 'mysql2'.freeze
250
+ SQLITE_PREFIX = 'sqlite'.freeze
252
251
 
253
252
  def symbolized_adapter(adapter)
254
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
@@ -101,13 +101,15 @@ module NewRelic
101
101
  end
102
102
 
103
103
  def self.operation_from_sql(sql)
104
- NewRelic::Agent::Database.parse_operation_from_query(sql) || OTHER
104
+ operation = NewRelic::Agent::Database.parse_operation_from_query(sql)
105
+ operation = OTHER if operation.eql?(NewRelic::Agent::Database::OTHER_OPERATION)
106
+ operation
105
107
  end
106
108
 
107
109
  # Allow Transaction#with_database_metric_name to override our
108
110
  # collection and operation
109
- def self.overridden_operation_and_collection #THREAD_LOCAL_ACCESS
110
- txn = Tracer.current_transaction
111
+ def self.overridden_operation_and_collection # THREAD_LOCAL_ACCESS
112
+ txn = Tracer.current_transaction
111
113
  txn ? txn.instrumentation_state[:datastore_override] : nil
112
114
  end
113
115
 
@@ -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
@@ -7,22 +7,17 @@ module NewRelic
7
7
  module Datastores
8
8
  module Mongo
9
9
  def self.is_supported_version?
10
- # No version constant in < 2.0 versions of Mongo :(
11
- defined?(::Mongo) && (defined?(::Mongo::MongoClient) || is_monitoring_enabled?)
12
- end
13
-
14
- def self.is_monitoring_enabled?
15
- defined?(::Mongo::Monitoring) # @since 2.1.0
10
+ defined?(::Mongo) && is_monitoring_enabled?
16
11
  end
17
12
 
18
13
  def self.is_unsupported_2x?
19
- defined?(::Mongo::VERSION) && Gem::Version.new(::Mongo::VERSION).segments[0] == 2 &&
14
+ defined?(::Mongo::VERSION) &&
15
+ Gem::Version.new(::Mongo::VERSION).segments[0] == 2 &&
20
16
  !self.is_monitoring_enabled?
21
17
  end
22
18
 
23
- def self.is_version_1_10_or_later?
24
- # Again, no VERSION constant in 1.x, so we have to rely on constant checks
25
- defined?(::Mongo::CollectionOperationWriter)
19
+ def self.is_monitoring_enabled?
20
+ defined?(::Mongo::Monitoring) # @since 2.1.0
26
21
  end
27
22
  end
28
23
  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
@@ -21,7 +20,7 @@ module NewRelic
21
20
  # query content into Transaction Traces. Use wrap if you want to provide
22
21
  # that functionality.
23
22
  #
24
- # @param [Class] clazz the class to instrument
23
+ # @param [Class] klass the class to instrument
25
24
  #
26
25
  # @param [String, Symbol] method_name the name of instance method to
27
26
  # instrument
@@ -33,16 +32,16 @@ module NewRelic
33
32
  #
34
33
  # @api public
35
34
  #
36
- def self.trace(clazz, method_name, product, operation = method_name)
35
+ def self.trace(klass, method_name, product, operation = method_name)
37
36
  NewRelic::Agent.record_api_supportability_metric(:trace)
38
37
 
39
- clazz.class_eval do
38
+ klass.class_eval do
40
39
  method_name_without_newrelic = "#{method_name}_without_newrelic"
41
40
 
42
- if NewRelic::Helper.instance_methods_include?(clazz, method_name) &&
43
- !NewRelic::Helper.instance_methods_include?(clazz, method_name_without_newrelic)
41
+ if NewRelic::Helper.instance_methods_include?(klass, method_name) &&
42
+ !NewRelic::Helper.instance_methods_include?(klass, method_name_without_newrelic)
44
43
 
45
- visibility = NewRelic::Helper.instance_method_visibility(clazz, method_name)
44
+ visibility = NewRelic::Helper.instance_method_visibility(klass, method_name)
46
45
 
47
46
  alias_method method_name_without_newrelic, method_name
48
47
 
@@ -123,7 +122,7 @@ module NewRelic
123
122
  ensure
124
123
  begin
125
124
  if callback
126
- elapsed_time = (Time.now - segment.start_time).to_f
125
+ elapsed_time = Process.clock_gettime(Process::CLOCK_REALTIME) - segment.start_time
127
126
  callback.call(result, segment.name, elapsed_time)
128
127
  end
129
128
  ensure
@@ -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,26 +8,26 @@ 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
- queue_time_in_seconds = [transaction.queue_time.to_f, 0.0].max
23
- start_time_in_seconds = [transaction.start_time.to_f, 0.0].max
24
- app_time_in_seconds = Time.now.to_f - start_time_in_seconds
22
+ queue_time_in_seconds = [transaction.queue_time, 0.0].max
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
25
25
 
26
26
  [
27
27
  NewRelic::Agent.config[:cross_process_id],
28
28
  transaction.best_name,
29
- queue_time_in_seconds.to_f,
30
- app_time_in_seconds.to_f,
29
+ queue_time_in_seconds,
30
+ app_time_in_seconds,
31
31
  content_length,
32
32
  transaction.guid,
33
33
  false
@@ -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
 
@@ -54,9 +54,10 @@ module NewRelic
54
54
 
55
55
  def insert_cross_app_header headers
56
56
  return unless CrossAppTracing.cross_app_enabled?
57
+
57
58
  @is_cross_app_caller = true
58
- txn_guid = transaction.guid
59
- trip_id = cat_trip_id
59
+ txn_guid = transaction.guid
60
+ trip_id = cat_trip_id
60
61
  path_hash = cat_path_hash
61
62
 
62
63
  insert_request_headers headers, txn_guid, trip_id, path_hash
@@ -65,17 +66,20 @@ module NewRelic
65
66
  def add_message_cat_headers headers
66
67
  return unless CrossAppTracing.cross_app_enabled?
67
68
  @is_cross_app_caller = true
68
- insert_message_headers headers,
69
- transaction.guid,
70
- cat_trip_id,
71
- cat_path_hash,
69
+ insert_message_headers headers,
70
+ transaction.guid,
71
+ cat_trip_id,
72
+ cat_path_hash,
72
73
  transaction.raw_synthetics_header
73
74
  end
74
75
 
75
76
  def record_cross_app_metrics
76
77
  if (id = cross_app_payload && cross_app_payload.id)
77
- app_time_in_seconds = [Time.now.to_f - transaction.start_time.to_f, 0.0].max
78
- NewRelic::Agent.record_metric "ClientApplication/#{id}/all", app_time_in_seconds
78
+ app_time_in_seconds = [
79
+ Process.clock_gettime(Process::CLOCK_REALTIME) - transaction.start_time,
80
+ 0.0
81
+ ].max
82
+ NewRelic::Agent.record_metric("ClientApplication/#{id}/all", app_time_in_seconds)
79
83
  end
80
84
  end
81
85
 
@@ -87,7 +91,7 @@ module NewRelic
87
91
  private
88
92
 
89
93
  def insert_message_headers headers, txn_guid, trip_id, path_hash, synthetics_header
90
- 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])
91
95
  headers[NR_MESSAGE_BROKER_TXN_HEADER] = obfuscator.obfuscate(::JSON.dump([txn_guid, false, trip_id, path_hash]))
92
96
  headers[NR_MESSAGE_BROKER_SYNTHETICS_HEADER] = synthetics_header if synthetics_header
93
97
  end
@@ -112,11 +116,11 @@ module NewRelic
112
116
  payload[:guid] = transaction.guid
113
117
 
114
118
  return unless is_cross_app?
115
- trip_id = cat_trip_id
116
- path_hash = cat_path_hash
119
+ trip_id = cat_trip_id
120
+ path_hash = cat_path_hash
117
121
  referring_path_hash = cat_referring_path_hash
118
122
 
119
- payload[:cat_trip_id] = trip_id if trip_id
123
+ payload[:cat_trip_id] = trip_id if trip_id
120
124
  payload[:cat_referring_path_hash] = referring_path_hash if referring_path_hash
121
125
 
122
126
  if path_hash
@@ -131,6 +135,7 @@ module NewRelic
131
135
 
132
136
  ###############
133
137
  module_function
138
+
134
139
  ###############
135
140
 
136
141
  def cross_app_enabled?
@@ -169,9 +174,9 @@ module NewRelic
169
174
 
170
175
  def insert_request_headers request, txn_guid, trip_id, path_hash
171
176
  cross_app_id = NewRelic::Agent.config[:cross_process_id]
172
- txn_data = ::JSON.dump([txn_guid, false, trip_id, path_hash])
177
+ txn_data = ::JSON.dump([txn_guid, false, trip_id, path_hash])
173
178
 
174
- request[NR_ID_HEADER] = obfuscator.obfuscate(cross_app_id)
179
+ request[NR_ID_HEADER] = obfuscator.obfuscate(cross_app_id)
175
180
  request[NR_TXN_HEADER] = obfuscator.obfuscate(txn_data)
176
181
  end
177
182
 
@@ -214,7 +219,7 @@ module NewRelic
214
219
  end
215
220
 
216
221
  def reject_messaging_cat_headers headers
217
- 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 }
218
223
  end
219
224
 
220
225
  def trusts? id
@@ -10,16 +10,16 @@ module NewRelic
10
10
 
11
11
  # Intrinsic Keys
12
12
  INTRINSIC_KEYS = [
13
- PARENT_TYPE_KEY = "parent.type",
14
- PARENT_APP_KEY = "parent.app",
15
- PARENT_ACCOUNT_ID_KEY = "parent.account",
16
- PARENT_TRANSPORT_TYPE_KEY = "parent.transportType",
17
- PARENT_TRANSPORT_DURATION_KEY = "parent.transportDuration",
18
- GUID_KEY = "guid",
19
- TRACE_ID_KEY = "traceId",
20
- PARENT_TRANSACTION_ID_KEY = "parentId",
21
- PARENT_SPAN_ID_KEY = "parentSpanId",
22
- SAMPLED_KEY = "sampled",
13
+ PARENT_TYPE_KEY = "parent.type",
14
+ PARENT_APP_KEY = "parent.app",
15
+ PARENT_ACCOUNT_ID_KEY = "parent.account",
16
+ PARENT_TRANSPORT_TYPE_KEY = "parent.transportType",
17
+ PARENT_TRANSPORT_DURATION_KEY = "parent.transportDuration",
18
+ GUID_KEY = "guid",
19
+ TRACE_ID_KEY = "traceId",
20
+ PARENT_TRANSACTION_ID_KEY = "parentId",
21
+ PARENT_SPAN_ID_KEY = "parentSpanId",
22
+ SAMPLED_KEY = "sampled"
23
23
  ].freeze
24
24
 
25
25
  # This method extracts intrinsics from the transaction_payload and
@@ -64,7 +64,6 @@ module NewRelic
64
64
  destination[PARENT_TYPE_KEY] = trace_payload.parent_type
65
65
  destination[PARENT_APP_KEY] = trace_payload.parent_app_id
66
66
  destination[PARENT_ACCOUNT_ID_KEY] = trace_payload.parent_account_id
67
-
68
67
  destination[PARENT_TRANSPORT_DURATION_KEY] = transaction.calculate_transport_duration trace_payload
69
68
 
70
69
  if parent_transaction_id = transaction.distributed_tracer.parent_transaction_id
@@ -78,7 +77,6 @@ module NewRelic
78
77
  def enabled?
79
78
  return Agent.config[:'distributed_tracing.enabled']
80
79
  end
81
-
82
80
  end
83
81
  end
84
82
  end