newrelic_rpm 6.7.0.359 → 6.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (300) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +8 -0
  3. data/CHANGELOG.md +493 -4
  4. data/CONTRIBUTING.md +106 -19
  5. data/Gemfile +6 -2
  6. data/Guardfile +18 -1
  7. data/LICENSE +208 -38
  8. data/README.md +81 -85
  9. data/ROADMAP.md +24 -0
  10. data/Rakefile +2 -0
  11. data/THIRD_PARTY_NOTICES.md +213 -0
  12. data/bin/nrdebug +1 -1
  13. data/init.rb +1 -1
  14. data/install.rb +1 -1
  15. data/lib/new_relic/agent/adaptive_sampler.rb +1 -1
  16. data/lib/new_relic/agent/agent.rb +63 -44
  17. data/lib/new_relic/agent/agent_logger.rb +5 -1
  18. data/lib/new_relic/agent/attribute_filter.rb +8 -8
  19. data/lib/new_relic/agent/attribute_processing.rb +1 -1
  20. data/lib/new_relic/agent/attributes.rb +152 -0
  21. data/lib/new_relic/agent/audit_logger.rb +11 -1
  22. data/lib/new_relic/agent/autostart.rb +20 -15
  23. data/lib/new_relic/agent/chained_call.rb +1 -1
  24. data/lib/new_relic/agent/commands/agent_command.rb +1 -1
  25. data/lib/new_relic/agent/commands/agent_command_router.rb +1 -1
  26. data/lib/new_relic/agent/commands/thread_profiler_session.rb +1 -1
  27. data/lib/new_relic/agent/configuration/default_source.rb +138 -17
  28. data/lib/new_relic/agent/configuration/dotted_hash.rb +1 -1
  29. data/lib/new_relic/agent/configuration/environment_source.rb +1 -1
  30. data/lib/new_relic/agent/configuration/event_harvest_config.rb +1 -1
  31. data/lib/new_relic/agent/configuration/high_security_source.rb +1 -1
  32. data/lib/new_relic/agent/configuration/manager.rb +1 -1
  33. data/lib/new_relic/agent/configuration/manual_source.rb +1 -1
  34. data/lib/new_relic/agent/configuration/mask_defaults.rb +1 -1
  35. data/lib/new_relic/agent/configuration/security_policy_source.rb +1 -1
  36. data/lib/new_relic/agent/configuration/server_source.rb +2 -2
  37. data/lib/new_relic/agent/configuration/yaml_source.rb +12 -7
  38. data/lib/new_relic/agent/configuration.rb +1 -1
  39. data/lib/new_relic/agent/connect/request_builder.rb +4 -12
  40. data/lib/new_relic/agent/connect/response_handler.rb +1 -1
  41. data/lib/new_relic/agent/custom_event_aggregator.rb +1 -1
  42. data/lib/new_relic/agent/database/explain_plan_helpers.rb +1 -1
  43. data/lib/new_relic/agent/database/obfuscation_helpers.rb +2 -2
  44. data/lib/new_relic/agent/database/obfuscator.rb +1 -1
  45. data/lib/new_relic/agent/database/postgres_explain_obfuscator.rb +1 -1
  46. data/lib/new_relic/agent/database.rb +2 -3
  47. data/lib/new_relic/agent/database_adapter.rb +33 -0
  48. data/lib/new_relic/agent/datastores/metric_helper.rb +1 -1
  49. data/lib/new_relic/agent/datastores/mongo/event_formatter.rb +3 -3
  50. data/lib/new_relic/agent/datastores/mongo/metric_translator.rb +1 -1
  51. data/lib/new_relic/agent/datastores/mongo/obfuscator.rb +9 -9
  52. data/lib/new_relic/agent/datastores/mongo/statement_formatter.rb +1 -1
  53. data/lib/new_relic/agent/datastores/mongo.rb +2 -2
  54. data/lib/new_relic/agent/datastores/redis.rb +1 -1
  55. data/lib/new_relic/agent/datastores.rb +1 -1
  56. data/lib/new_relic/agent/deprecator.rb +1 -1
  57. data/lib/new_relic/agent/{cross_app_payload.rb → distributed_tracing/cross_app_payload.rb} +3 -2
  58. data/lib/new_relic/agent/{cross_app_tracing.rb → distributed_tracing/cross_app_tracing.rb} +61 -46
  59. data/lib/new_relic/agent/distributed_tracing/distributed_trace_attributes.rb +84 -0
  60. data/lib/new_relic/agent/distributed_tracing/distributed_trace_metrics.rb +75 -0
  61. data/lib/new_relic/agent/{distributed_trace_payload.rb → distributed_tracing/distributed_trace_payload.rb} +25 -102
  62. data/lib/new_relic/agent/distributed_tracing/distributed_trace_transport_type.rb +39 -0
  63. data/lib/new_relic/agent/distributed_tracing/trace_context.rb +246 -0
  64. data/lib/new_relic/agent/distributed_tracing/trace_context_payload.rb +126 -0
  65. data/lib/new_relic/agent/distributed_tracing.rb +156 -7
  66. data/lib/new_relic/agent/encoding_normalizer.rb +1 -1
  67. data/lib/new_relic/agent/error_collector.rb +34 -17
  68. data/lib/new_relic/agent/error_event_aggregator.rb +8 -6
  69. data/lib/new_relic/agent/error_trace_aggregator.rb +1 -1
  70. data/lib/new_relic/agent/event_aggregator.rb +1 -1
  71. data/lib/new_relic/agent/event_buffer.rb +1 -1
  72. data/lib/new_relic/agent/event_listener.rb +1 -1
  73. data/lib/new_relic/agent/event_loop.rb +1 -1
  74. data/lib/new_relic/agent/external.rb +8 -8
  75. data/lib/new_relic/agent/guid_generator.rb +28 -0
  76. data/lib/new_relic/agent/harvester.rb +1 -1
  77. data/lib/new_relic/agent/heap.rb +1 -1
  78. data/lib/new_relic/agent/hostname.rb +8 -2
  79. data/lib/new_relic/agent/http_clients/abstract.rb +82 -0
  80. data/lib/new_relic/agent/http_clients/curb_wrappers.rb +25 -20
  81. data/lib/new_relic/agent/http_clients/excon_wrappers.rb +29 -14
  82. data/lib/new_relic/agent/http_clients/http_rb_wrappers.rb +18 -22
  83. data/lib/new_relic/agent/http_clients/httpclient_wrappers.rb +11 -12
  84. data/lib/new_relic/agent/http_clients/net_http_wrappers.rb +17 -5
  85. data/lib/new_relic/agent/http_clients/typhoeus_wrappers.rb +5 -7
  86. data/lib/new_relic/agent/http_clients/uri_util.rb +12 -11
  87. data/lib/new_relic/agent/instrumentation/action_cable_subscriber.rb +6 -8
  88. data/lib/new_relic/agent/instrumentation/action_controller_subscriber.rb +5 -1
  89. data/lib/new_relic/agent/instrumentation/action_view_subscriber.rb +12 -4
  90. data/lib/new_relic/agent/instrumentation/active_job.rb +1 -1
  91. data/lib/new_relic/agent/instrumentation/active_merchant.rb +1 -1
  92. data/lib/new_relic/agent/instrumentation/active_record.rb +85 -38
  93. data/lib/new_relic/agent/instrumentation/active_record_helper.rb +17 -6
  94. data/lib/new_relic/agent/instrumentation/active_record_notifications.rb +1 -1
  95. data/lib/new_relic/agent/instrumentation/active_record_prepend.rb +35 -11
  96. data/lib/new_relic/agent/instrumentation/active_record_subscriber.rb +8 -3
  97. data/lib/new_relic/agent/instrumentation/active_storage.rb +1 -1
  98. data/lib/new_relic/agent/instrumentation/active_storage_subscriber.rb +9 -5
  99. data/lib/new_relic/agent/instrumentation/acts_as_solr.rb +10 -9
  100. data/lib/new_relic/agent/instrumentation/authlogic.rb +1 -1
  101. data/lib/new_relic/agent/instrumentation/bunny.rb +48 -29
  102. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +1 -1
  103. data/lib/new_relic/agent/instrumentation/curb.rb +66 -19
  104. data/lib/new_relic/agent/instrumentation/data_mapper.rb +4 -2
  105. data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +3 -1
  106. data/lib/new_relic/agent/instrumentation/excon/connection.rb +7 -4
  107. data/lib/new_relic/agent/instrumentation/excon/middleware.rb +3 -2
  108. data/lib/new_relic/agent/instrumentation/excon.rb +2 -2
  109. data/lib/new_relic/agent/instrumentation/grape.rb +6 -11
  110. data/lib/new_relic/agent/instrumentation/http.rb +7 -4
  111. data/lib/new_relic/agent/instrumentation/httpclient.rb +6 -4
  112. data/lib/new_relic/agent/instrumentation/ignore_actions.rb +1 -1
  113. data/lib/new_relic/agent/instrumentation/memcache/dalli.rb +7 -3
  114. data/lib/new_relic/agent/instrumentation/memcache.rb +4 -2
  115. data/lib/new_relic/agent/instrumentation/merb/controller.rb +1 -1
  116. data/lib/new_relic/agent/instrumentation/merb/errors.rb +1 -1
  117. data/lib/new_relic/agent/instrumentation/middleware_proxy.rb +1 -1
  118. data/lib/new_relic/agent/instrumentation/middleware_tracing.rb +9 -7
  119. data/lib/new_relic/agent/instrumentation/mongo.rb +10 -4
  120. data/lib/new_relic/agent/instrumentation/mongodb_command_subscriber.rb +36 -3
  121. data/lib/new_relic/agent/instrumentation/net.rb +48 -28
  122. data/lib/new_relic/agent/instrumentation/net_prepend.rb +40 -0
  123. data/lib/new_relic/agent/instrumentation/notifications_subscriber.rb +26 -2
  124. data/lib/new_relic/agent/instrumentation/padrino.rb +3 -1
  125. data/lib/new_relic/agent/instrumentation/passenger_instrumentation.rb +1 -1
  126. data/lib/new_relic/agent/instrumentation/queue_time.rb +1 -1
  127. data/lib/new_relic/agent/instrumentation/rack.rb +3 -1
  128. data/lib/new_relic/agent/instrumentation/rails/action_controller.rb +1 -1
  129. data/lib/new_relic/agent/instrumentation/rails/action_web_service.rb +1 -1
  130. data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +1 -1
  131. data/lib/new_relic/agent/instrumentation/rails_middleware.rb +1 -1
  132. data/lib/new_relic/agent/instrumentation/rails_notifications/action_cable.rb +1 -1
  133. data/lib/new_relic/agent/instrumentation/rails_notifications/action_controller.rb +1 -1
  134. data/lib/new_relic/agent/instrumentation/rails_notifications/action_view.rb +1 -1
  135. data/lib/new_relic/agent/instrumentation/rainbows_instrumentation.rb +1 -1
  136. data/lib/new_relic/agent/instrumentation/rake.rb +2 -1
  137. data/lib/new_relic/agent/instrumentation/redis.rb +12 -6
  138. data/lib/new_relic/agent/instrumentation/resque.rb +4 -1
  139. data/lib/new_relic/agent/instrumentation/sequel.rb +1 -1
  140. data/lib/new_relic/agent/instrumentation/sequel_helper.rb +1 -1
  141. data/lib/new_relic/agent/instrumentation/sidekiq.rb +48 -24
  142. data/lib/new_relic/agent/instrumentation/sinatra/ignorer.rb +1 -1
  143. data/lib/new_relic/agent/instrumentation/sinatra/transaction_namer.rb +1 -1
  144. data/lib/new_relic/agent/instrumentation/sinatra.rb +1 -2
  145. data/lib/new_relic/agent/instrumentation/sunspot.rb +1 -1
  146. data/lib/new_relic/agent/instrumentation/typhoeus.rb +24 -7
  147. data/lib/new_relic/agent/instrumentation.rb +1 -1
  148. data/lib/new_relic/agent/internal_agent_error.rb +1 -1
  149. data/lib/new_relic/agent/javascript_instrumentor.rb +1 -1
  150. data/lib/new_relic/agent/log_once.rb +1 -1
  151. data/lib/new_relic/agent/logging.rb +19 -5
  152. data/lib/new_relic/agent/memory_logger.rb +1 -1
  153. data/lib/new_relic/agent/messaging.rb +6 -74
  154. data/lib/new_relic/agent/method_tracer.rb +10 -8
  155. data/lib/new_relic/agent/method_tracer_helpers.rb +3 -3
  156. data/lib/new_relic/agent/monitors/cross_app_monitor.rb +110 -0
  157. data/lib/new_relic/agent/monitors/distributed_tracing_monitor.rb +27 -0
  158. data/lib/new_relic/agent/{inbound_request_monitor.rb → monitors/inbound_request_monitor.rb} +2 -2
  159. data/lib/new_relic/agent/{synthetics_monitor.rb → monitors/synthetics_monitor.rb} +3 -5
  160. data/lib/new_relic/agent/monitors.rb +27 -0
  161. data/lib/new_relic/agent/new_relic_service/encoders.rb +1 -1
  162. data/lib/new_relic/agent/new_relic_service/json_marshaller.rb +1 -1
  163. data/lib/new_relic/agent/new_relic_service/marshaller.rb +1 -1
  164. data/lib/new_relic/agent/new_relic_service/security_policy_settings.rb +1 -1
  165. data/lib/new_relic/agent/new_relic_service.rb +34 -10
  166. data/lib/new_relic/agent/noticible_error.rb +22 -0
  167. data/lib/new_relic/agent/null_logger.rb +1 -1
  168. data/lib/new_relic/agent/obfuscator.rb +1 -1
  169. data/lib/new_relic/agent/parameter_filtering.rb +1 -1
  170. data/lib/new_relic/agent/payload_metric_mapping.rb +1 -1
  171. data/lib/new_relic/agent/pipe_channel_manager.rb +1 -1
  172. data/lib/new_relic/agent/pipe_service.rb +1 -1
  173. data/lib/new_relic/agent/prepend_supportability.rb +1 -1
  174. data/lib/new_relic/agent/priority_sampled_buffer.rb +8 -5
  175. data/lib/new_relic/agent/range_extensions.rb +1 -1
  176. data/lib/new_relic/agent/rules_engine/replacement_rule.rb +1 -1
  177. data/lib/new_relic/agent/rules_engine/segment_terms_rule.rb +1 -1
  178. data/lib/new_relic/agent/rules_engine.rb +1 -1
  179. data/lib/new_relic/agent/sampler.rb +1 -1
  180. data/lib/new_relic/agent/sampler_collection.rb +1 -1
  181. data/lib/new_relic/agent/samplers/cpu_sampler.rb +1 -1
  182. data/lib/new_relic/agent/samplers/delayed_job_sampler.rb +1 -1
  183. data/lib/new_relic/agent/samplers/memory_sampler.rb +2 -2
  184. data/lib/new_relic/agent/samplers/object_sampler.rb +1 -1
  185. data/lib/new_relic/agent/samplers/vm_sampler.rb +1 -1
  186. data/lib/new_relic/agent/span_event_aggregator.rb +2 -1
  187. data/lib/new_relic/agent/span_event_primitive.rb +108 -54
  188. data/lib/new_relic/agent/sql_sampler.rb +6 -6
  189. data/lib/new_relic/agent/stats.rb +1 -1
  190. data/lib/new_relic/agent/stats_engine/gc_profiler.rb +2 -2
  191. data/lib/new_relic/agent/stats_engine/stats_hash.rb +1 -1
  192. data/lib/new_relic/agent/stats_engine.rb +1 -1
  193. data/lib/new_relic/agent/supported_versions.rb +3 -3
  194. data/lib/new_relic/agent/synthetics_event_aggregator.rb +1 -1
  195. data/lib/new_relic/agent/system_info.rb +13 -4
  196. data/lib/new_relic/agent/threading/agent_thread.rb +1 -1
  197. data/lib/new_relic/agent/threading/backtrace_node.rb +1 -1
  198. data/lib/new_relic/agent/threading/backtrace_service.rb +1 -1
  199. data/lib/new_relic/agent/threading/thread_profile.rb +1 -1
  200. data/lib/new_relic/agent/timestamp_sampled_buffer.rb +1 -1
  201. data/lib/new_relic/agent/tracer.rb +34 -19
  202. data/lib/new_relic/agent/transaction/abstract_segment.rb +32 -5
  203. data/lib/new_relic/agent/transaction/datastore_segment.rb +1 -1
  204. data/lib/new_relic/agent/transaction/distributed_tracer.rb +177 -0
  205. data/lib/new_relic/agent/transaction/distributed_tracing.rb +58 -147
  206. data/lib/new_relic/agent/transaction/external_request_segment.rb +32 -39
  207. data/lib/new_relic/agent/transaction/message_broker_segment.rb +5 -12
  208. data/lib/new_relic/agent/transaction/request_attributes.rb +1 -1
  209. data/lib/new_relic/agent/transaction/segment.rb +28 -2
  210. data/lib/new_relic/agent/transaction/slowest_sample_buffer.rb +1 -1
  211. data/lib/new_relic/agent/transaction/synthetics_sample_buffer.rb +1 -1
  212. data/lib/new_relic/agent/transaction/trace.rb +3 -5
  213. data/lib/new_relic/agent/transaction/trace_builder.rb +1 -1
  214. data/lib/new_relic/agent/transaction/trace_context.rb +168 -0
  215. data/lib/new_relic/agent/transaction/trace_node.rb +11 -9
  216. data/lib/new_relic/agent/transaction/tracing.rb +1 -1
  217. data/lib/new_relic/agent/transaction/transaction_sample_buffer.rb +1 -1
  218. data/lib/new_relic/agent/transaction.rb +104 -82
  219. data/lib/new_relic/agent/transaction_error_primitive.rb +11 -16
  220. data/lib/new_relic/agent/transaction_event_aggregator.rb +1 -1
  221. data/lib/new_relic/agent/transaction_event_primitive.rb +29 -40
  222. data/lib/new_relic/agent/transaction_event_recorder.rb +1 -1
  223. data/lib/new_relic/agent/transaction_metrics.rb +1 -1
  224. data/lib/new_relic/agent/transaction_sampler.rb +1 -1
  225. data/lib/new_relic/agent/transaction_time_aggregator.rb +1 -1
  226. data/lib/new_relic/agent/utilization/aws.rb +1 -1
  227. data/lib/new_relic/agent/utilization/azure.rb +1 -1
  228. data/lib/new_relic/agent/utilization/gcp.rb +1 -1
  229. data/lib/new_relic/agent/utilization/pcf.rb +1 -1
  230. data/lib/new_relic/agent/utilization/vendor.rb +1 -1
  231. data/lib/new_relic/agent/utilization_data.rb +1 -1
  232. data/lib/new_relic/agent/vm/jruby_vm.rb +1 -1
  233. data/lib/new_relic/agent/vm/monotonic_gc_profiler.rb +1 -1
  234. data/lib/new_relic/agent/vm/mri_vm.rb +7 -5
  235. data/lib/new_relic/agent/vm/snapshot.rb +1 -1
  236. data/lib/new_relic/agent/vm.rb +1 -1
  237. data/lib/new_relic/agent/worker_loop.rb +1 -1
  238. data/lib/new_relic/agent.rb +49 -8
  239. data/lib/new_relic/cli/command.rb +1 -1
  240. data/lib/new_relic/cli/commands/deployments.rb +1 -2
  241. data/lib/new_relic/cli/commands/install.rb +4 -3
  242. data/lib/new_relic/coerce.rb +32 -7
  243. data/lib/new_relic/collection_helper.rb +1 -1
  244. data/lib/new_relic/constants.rb +42 -0
  245. data/lib/new_relic/control/class_methods.rb +1 -1
  246. data/lib/new_relic/control/frameworks/external.rb +1 -1
  247. data/lib/new_relic/control/frameworks/merb.rb +1 -1
  248. data/lib/new_relic/control/frameworks/rails.rb +1 -1
  249. data/lib/new_relic/control/frameworks/rails3.rb +1 -1
  250. data/lib/new_relic/control/frameworks/rails4.rb +1 -1
  251. data/lib/new_relic/control/frameworks/rails_notifications.rb +1 -1
  252. data/lib/new_relic/control/frameworks/ruby.rb +1 -1
  253. data/lib/new_relic/control/frameworks/sinatra.rb +1 -1
  254. data/lib/new_relic/control/frameworks.rb +1 -1
  255. data/lib/new_relic/control/instance_methods.rb +11 -2
  256. data/lib/new_relic/control/instrumentation.rb +1 -1
  257. data/lib/new_relic/control/server_methods.rb +1 -1
  258. data/lib/new_relic/control.rb +1 -1
  259. data/lib/new_relic/delayed_job_injection.rb +1 -1
  260. data/lib/new_relic/dependency_detection.rb +9 -5
  261. data/lib/new_relic/environment_report.rb +2 -4
  262. data/lib/new_relic/helper.rb +1 -1
  263. data/lib/new_relic/language_support.rb +1 -1
  264. data/lib/new_relic/latest_changes.rb +2 -2
  265. data/lib/new_relic/local_environment.rb +1 -1
  266. data/lib/new_relic/metric_data.rb +1 -1
  267. data/lib/new_relic/metric_spec.rb +1 -1
  268. data/lib/new_relic/noticed_error.rb +39 -18
  269. data/lib/new_relic/rack/agent_hooks.rb +1 -1
  270. data/lib/new_relic/rack/agent_middleware.rb +1 -1
  271. data/lib/new_relic/rack/browser_monitoring.rb +6 -1
  272. data/lib/new_relic/rack.rb +1 -1
  273. data/lib/new_relic/recipes/capistrano3.rb +1 -1
  274. data/lib/new_relic/recipes/capistrano_legacy.rb +1 -1
  275. data/lib/new_relic/recipes.rb +1 -1
  276. data/lib/new_relic/supportability_helper.rb +17 -1
  277. data/lib/new_relic/version.rb +2 -2
  278. data/lib/newrelic_rpm.rb +1 -1
  279. data/lib/sequel/extensions/newrelic_instrumentation.rb +1 -1
  280. data/lib/sequel/plugins/newrelic_instrumentation.rb +1 -1
  281. data/lib/tasks/all.rb +1 -1
  282. data/lib/tasks/multiverse.rb +35 -1
  283. data/lib/tasks/newrelic.rb +1 -1
  284. data/lib/tasks/tests.rake +6 -1
  285. data/newrelic_rpm.gemspec +18 -13
  286. data/recipes/newrelic.rb +1 -1
  287. data/test/agent_helper.rb +339 -72
  288. metadata +104 -41
  289. data/.travis.yml +0 -175
  290. data/lib/new_relic/agent/cross_app_monitor.rb +0 -110
  291. data/lib/new_relic/agent/distributed_trace_monitor.rb +0 -40
  292. data/lib/new_relic/agent/http_clients/abstract_request.rb +0 -31
  293. data/lib/new_relic/agent/transaction/attributes.rb +0 -154
  294. data/lib/new_relic/build.rb +0 -2
  295. data/lib/new_relic/metrics.rb +0 -13
  296. data/lib/tasks/versions.html.erb +0 -28
  297. data/lib/tasks/versions.postface.html +0 -8
  298. data/lib/tasks/versions.preface.html +0 -9
  299. data/lib/tasks/versions.rake +0 -65
  300. data/lib/tasks/versions.txt.erb +0 -14
metadata CHANGED
@@ -1,17 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newrelic_rpm
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.7.0.359
4
+ version: 6.15.0
5
5
  platform: ruby
6
6
  authors:
7
- - Matthew Wear
8
- - Chris Pine
9
7
  - Rachel Klein
10
- - Justin Foote
8
+ - Tanna McClure
9
+ - Michael Lang
11
10
  autorequire:
12
11
  bindir: bin
13
12
  cert_chain: []
14
- date: 2019-09-25 00:00:00.000000000 Z
13
+ date: 2021-01-19 00:00:00.000000000 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: rake
@@ -19,26 +18,54 @@ dependencies:
19
18
  requirements:
20
19
  - - '='
21
20
  - !ruby/object:Gem::Version
22
- version: 10.1.0
21
+ version: 12.3.3
23
22
  type: :development
24
23
  prerelease: false
25
24
  version_requirements: !ruby/object:Gem::Requirement
26
25
  requirements:
27
26
  - - '='
28
27
  - !ruby/object:Gem::Version
29
- version: 10.1.0
28
+ version: 12.3.3
29
+ - !ruby/object:Gem::Dependency
30
+ name: rb-inotify
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - '='
34
+ - !ruby/object:Gem::Version
35
+ version: 0.9.10
36
+ type: :development
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - '='
41
+ - !ruby/object:Gem::Version
42
+ version: 0.9.10
43
+ - !ruby/object:Gem::Dependency
44
+ name: listen
45
+ requirement: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - '='
48
+ - !ruby/object:Gem::Version
49
+ version: 3.0.8
50
+ type: :development
51
+ prerelease: false
52
+ version_requirements: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - '='
55
+ - !ruby/object:Gem::Version
56
+ version: 3.0.8
30
57
  - !ruby/object:Gem::Dependency
31
58
  name: minitest
32
59
  requirement: !ruby/object:Gem::Requirement
33
60
  requirements:
34
- - - "~>"
61
+ - - '='
35
62
  - !ruby/object:Gem::Version
36
63
  version: 4.7.5
37
64
  type: :development
38
65
  prerelease: false
39
66
  version_requirements: !ruby/object:Gem::Requirement
40
67
  requirements:
41
- - - "~>"
68
+ - - '='
42
69
  - !ruby/object:Gem::Version
43
70
  version: 4.7.5
44
71
  - !ruby/object:Gem::Dependency
@@ -47,14 +74,14 @@ dependencies:
47
74
  requirements:
48
75
  - - "~>"
49
76
  - !ruby/object:Gem::Version
50
- version: 0.13.0
77
+ version: 1.9.0
51
78
  type: :development
52
79
  prerelease: false
53
80
  version_requirements: !ruby/object:Gem::Requirement
54
81
  requirements:
55
82
  - - "~>"
56
83
  - !ruby/object:Gem::Version
57
- version: 0.13.0
84
+ version: 1.9.0
58
85
  - !ruby/object:Gem::Dependency
59
86
  name: yard
60
87
  requirement: !ruby/object:Gem::Requirement
@@ -75,14 +102,14 @@ dependencies:
75
102
  requirements:
76
103
  - - "~>"
77
104
  - !ruby/object:Gem::Version
78
- version: 0.2.4
105
+ version: 0.3.0
79
106
  type: :development
80
107
  prerelease: false
81
108
  version_requirements: !ruby/object:Gem::Requirement
82
109
  requirements:
83
110
  - - "~>"
84
111
  - !ruby/object:Gem::Version
85
- version: 0.2.4
112
+ version: 0.3.0
86
113
  - !ruby/object:Gem::Dependency
87
114
  name: pry-stack_explorer
88
115
  requirement: !ruby/object:Gem::Requirement
@@ -97,6 +124,34 @@ dependencies:
97
124
  - - "~>"
98
125
  - !ruby/object:Gem::Version
99
126
  version: 0.4.9
127
+ - !ruby/object:Gem::Dependency
128
+ name: guard
129
+ requirement: !ruby/object:Gem::Requirement
130
+ requirements:
131
+ - - "~>"
132
+ - !ruby/object:Gem::Version
133
+ version: 2.16.0
134
+ type: :development
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ requirements:
138
+ - - "~>"
139
+ - !ruby/object:Gem::Version
140
+ version: 2.16.0
141
+ - !ruby/object:Gem::Dependency
142
+ name: guard-minitest
143
+ requirement: !ruby/object:Gem::Requirement
144
+ requirements:
145
+ - - "~>"
146
+ - !ruby/object:Gem::Version
147
+ version: 2.4.0
148
+ type: :development
149
+ prerelease: false
150
+ version_requirements: !ruby/object:Gem::Requirement
151
+ requirements:
152
+ - - "~>"
153
+ - !ruby/object:Gem::Version
154
+ version: 2.4.0
100
155
  - !ruby/object:Gem::Dependency
101
156
  name: hometown
102
157
  requirement: !ruby/object:Gem::Requirement
@@ -115,23 +170,23 @@ dependencies:
115
170
  name: bundler
116
171
  requirement: !ruby/object:Gem::Requirement
117
172
  requirements:
118
- - - "<"
173
+ - - ">="
119
174
  - !ruby/object:Gem::Version
120
- version: '2.0'
175
+ version: '0'
121
176
  type: :development
122
177
  prerelease: false
123
178
  version_requirements: !ruby/object:Gem::Requirement
124
179
  requirements:
125
- - - "<"
180
+ - - ">="
126
181
  - !ruby/object:Gem::Version
127
- version: '2.0'
182
+ version: '0'
128
183
  description: |
129
184
  New Relic is a performance management system, developed by New Relic,
130
185
  Inc (http://www.newrelic.com). New Relic provides you with deep
131
186
  information about the performance of your web application as it runs
132
- in production. The New Relic Ruby Agent is dual-purposed as a either a
187
+ in production. The New Relic Ruby agent is dual-purposed as a either a
133
188
  Gem or plugin, hosted on
134
- https://github.com/newrelic/rpm/
189
+ https://github.com/newrelic/newrelic-ruby-agent/
135
190
  email: support@newrelic.com
136
191
  executables:
137
192
  - mongrel_rpm
@@ -148,7 +203,6 @@ extra_rdoc_files:
148
203
  files:
149
204
  - ".gitignore"
150
205
  - ".project"
151
- - ".travis.yml"
152
206
  - ".yardopts"
153
207
  - CHANGELOG.md
154
208
  - CONTRIBUTING.md
@@ -156,7 +210,9 @@ files:
156
210
  - Guardfile
157
211
  - LICENSE
158
212
  - README.md
213
+ - ROADMAP.md
159
214
  - Rakefile
215
+ - THIRD_PARTY_NOTICES.md
160
216
  - bin/mongrel_rpm
161
217
  - bin/newrelic
162
218
  - bin/newrelic_cmd
@@ -172,6 +228,7 @@ files:
172
228
  - lib/new_relic/agent/agent_logger.rb
173
229
  - lib/new_relic/agent/attribute_filter.rb
174
230
  - lib/new_relic/agent/attribute_processing.rb
231
+ - lib/new_relic/agent/attributes.rb
175
232
  - lib/new_relic/agent/audit_logger.rb
176
233
  - lib/new_relic/agent/autostart.rb
177
234
  - lib/new_relic/agent/chained_call.rb
@@ -192,15 +249,13 @@ files:
192
249
  - lib/new_relic/agent/configuration/yaml_source.rb
193
250
  - lib/new_relic/agent/connect/request_builder.rb
194
251
  - lib/new_relic/agent/connect/response_handler.rb
195
- - lib/new_relic/agent/cross_app_monitor.rb
196
- - lib/new_relic/agent/cross_app_payload.rb
197
- - lib/new_relic/agent/cross_app_tracing.rb
198
252
  - lib/new_relic/agent/custom_event_aggregator.rb
199
253
  - lib/new_relic/agent/database.rb
200
254
  - lib/new_relic/agent/database/explain_plan_helpers.rb
201
255
  - lib/new_relic/agent/database/obfuscation_helpers.rb
202
256
  - lib/new_relic/agent/database/obfuscator.rb
203
257
  - lib/new_relic/agent/database/postgres_explain_obfuscator.rb
258
+ - lib/new_relic/agent/database_adapter.rb
204
259
  - lib/new_relic/agent/datastores.rb
205
260
  - lib/new_relic/agent/datastores/metric_helper.rb
206
261
  - lib/new_relic/agent/datastores/mongo.rb
@@ -210,9 +265,15 @@ files:
210
265
  - lib/new_relic/agent/datastores/mongo/statement_formatter.rb
211
266
  - lib/new_relic/agent/datastores/redis.rb
212
267
  - lib/new_relic/agent/deprecator.rb
213
- - lib/new_relic/agent/distributed_trace_monitor.rb
214
- - lib/new_relic/agent/distributed_trace_payload.rb
215
268
  - lib/new_relic/agent/distributed_tracing.rb
269
+ - lib/new_relic/agent/distributed_tracing/cross_app_payload.rb
270
+ - lib/new_relic/agent/distributed_tracing/cross_app_tracing.rb
271
+ - lib/new_relic/agent/distributed_tracing/distributed_trace_attributes.rb
272
+ - lib/new_relic/agent/distributed_tracing/distributed_trace_metrics.rb
273
+ - lib/new_relic/agent/distributed_tracing/distributed_trace_payload.rb
274
+ - lib/new_relic/agent/distributed_tracing/distributed_trace_transport_type.rb
275
+ - lib/new_relic/agent/distributed_tracing/trace_context.rb
276
+ - lib/new_relic/agent/distributed_tracing/trace_context_payload.rb
216
277
  - lib/new_relic/agent/encoding_normalizer.rb
217
278
  - lib/new_relic/agent/error_collector.rb
218
279
  - lib/new_relic/agent/error_event_aggregator.rb
@@ -222,10 +283,11 @@ files:
222
283
  - lib/new_relic/agent/event_listener.rb
223
284
  - lib/new_relic/agent/event_loop.rb
224
285
  - lib/new_relic/agent/external.rb
286
+ - lib/new_relic/agent/guid_generator.rb
225
287
  - lib/new_relic/agent/harvester.rb
226
288
  - lib/new_relic/agent/heap.rb
227
289
  - lib/new_relic/agent/hostname.rb
228
- - lib/new_relic/agent/http_clients/abstract_request.rb
290
+ - lib/new_relic/agent/http_clients/abstract.rb
229
291
  - lib/new_relic/agent/http_clients/curb_wrappers.rb
230
292
  - lib/new_relic/agent/http_clients/excon_wrappers.rb
231
293
  - lib/new_relic/agent/http_clients/http_rb_wrappers.rb
@@ -233,7 +295,6 @@ files:
233
295
  - lib/new_relic/agent/http_clients/net_http_wrappers.rb
234
296
  - lib/new_relic/agent/http_clients/typhoeus_wrappers.rb
235
297
  - lib/new_relic/agent/http_clients/uri_util.rb
236
- - lib/new_relic/agent/inbound_request_monitor.rb
237
298
  - lib/new_relic/agent/instrumentation.rb
238
299
  - lib/new_relic/agent/instrumentation/action_cable_subscriber.rb
239
300
  - lib/new_relic/agent/instrumentation/action_controller_subscriber.rb
@@ -270,6 +331,7 @@ files:
270
331
  - lib/new_relic/agent/instrumentation/mongo.rb
271
332
  - lib/new_relic/agent/instrumentation/mongodb_command_subscriber.rb
272
333
  - lib/new_relic/agent/instrumentation/net.rb
334
+ - lib/new_relic/agent/instrumentation/net_prepend.rb
273
335
  - lib/new_relic/agent/instrumentation/notifications_subscriber.rb
274
336
  - lib/new_relic/agent/instrumentation/padrino.rb
275
337
  - lib/new_relic/agent/instrumentation/passenger_instrumentation.rb
@@ -302,11 +364,17 @@ files:
302
364
  - lib/new_relic/agent/messaging.rb
303
365
  - lib/new_relic/agent/method_tracer.rb
304
366
  - lib/new_relic/agent/method_tracer_helpers.rb
367
+ - lib/new_relic/agent/monitors.rb
368
+ - lib/new_relic/agent/monitors/cross_app_monitor.rb
369
+ - lib/new_relic/agent/monitors/distributed_tracing_monitor.rb
370
+ - lib/new_relic/agent/monitors/inbound_request_monitor.rb
371
+ - lib/new_relic/agent/monitors/synthetics_monitor.rb
305
372
  - lib/new_relic/agent/new_relic_service.rb
306
373
  - lib/new_relic/agent/new_relic_service/encoders.rb
307
374
  - lib/new_relic/agent/new_relic_service/json_marshaller.rb
308
375
  - lib/new_relic/agent/new_relic_service/marshaller.rb
309
376
  - lib/new_relic/agent/new_relic_service/security_policy_settings.rb
377
+ - lib/new_relic/agent/noticible_error.rb
310
378
  - lib/new_relic/agent/null_logger.rb
311
379
  - lib/new_relic/agent/obfuscator.rb
312
380
  - lib/new_relic/agent/parameter_filtering.rb
@@ -335,7 +403,6 @@ files:
335
403
  - lib/new_relic/agent/stats_engine/stats_hash.rb
336
404
  - lib/new_relic/agent/supported_versions.rb
337
405
  - lib/new_relic/agent/synthetics_event_aggregator.rb
338
- - lib/new_relic/agent/synthetics_monitor.rb
339
406
  - lib/new_relic/agent/system_info.rb
340
407
  - lib/new_relic/agent/threading/agent_thread.rb
341
408
  - lib/new_relic/agent/threading/backtrace_node.rb
@@ -345,8 +412,8 @@ files:
345
412
  - lib/new_relic/agent/tracer.rb
346
413
  - lib/new_relic/agent/transaction.rb
347
414
  - lib/new_relic/agent/transaction/abstract_segment.rb
348
- - lib/new_relic/agent/transaction/attributes.rb
349
415
  - lib/new_relic/agent/transaction/datastore_segment.rb
416
+ - lib/new_relic/agent/transaction/distributed_tracer.rb
350
417
  - lib/new_relic/agent/transaction/distributed_tracing.rb
351
418
  - lib/new_relic/agent/transaction/external_request_segment.rb
352
419
  - lib/new_relic/agent/transaction/message_broker_segment.rb
@@ -356,6 +423,7 @@ files:
356
423
  - lib/new_relic/agent/transaction/synthetics_sample_buffer.rb
357
424
  - lib/new_relic/agent/transaction/trace.rb
358
425
  - lib/new_relic/agent/transaction/trace_builder.rb
426
+ - lib/new_relic/agent/transaction/trace_context.rb
359
427
  - lib/new_relic/agent/transaction/trace_node.rb
360
428
  - lib/new_relic/agent/transaction/tracing.rb
361
429
  - lib/new_relic/agent/transaction/transaction_sample_buffer.rb
@@ -378,12 +446,12 @@ files:
378
446
  - lib/new_relic/agent/vm/mri_vm.rb
379
447
  - lib/new_relic/agent/vm/snapshot.rb
380
448
  - lib/new_relic/agent/worker_loop.rb
381
- - lib/new_relic/build.rb
382
449
  - lib/new_relic/cli/command.rb
383
450
  - lib/new_relic/cli/commands/deployments.rb
384
451
  - lib/new_relic/cli/commands/install.rb
385
452
  - lib/new_relic/coerce.rb
386
453
  - lib/new_relic/collection_helper.rb
454
+ - lib/new_relic/constants.rb
387
455
  - lib/new_relic/control.rb
388
456
  - lib/new_relic/control/class_methods.rb
389
457
  - lib/new_relic/control/frameworks.rb
@@ -407,7 +475,6 @@ files:
407
475
  - lib/new_relic/local_environment.rb
408
476
  - lib/new_relic/metric_data.rb
409
477
  - lib/new_relic/metric_spec.rb
410
- - lib/new_relic/metrics.rb
411
478
  - lib/new_relic/noticed_error.rb
412
479
  - lib/new_relic/rack.rb
413
480
  - lib/new_relic/rack/agent_hooks.rb
@@ -430,23 +497,19 @@ files:
430
497
  - lib/tasks/multiverse.rb
431
498
  - lib/tasks/newrelic.rb
432
499
  - lib/tasks/tests.rake
433
- - lib/tasks/versions.html.erb
434
- - lib/tasks/versions.postface.html
435
- - lib/tasks/versions.preface.html
436
- - lib/tasks/versions.rake
437
- - lib/tasks/versions.txt.erb
438
500
  - newrelic.yml
439
501
  - newrelic_rpm.gemspec
440
502
  - recipes/newrelic.rb
441
503
  - test/agent_helper.rb
442
504
  homepage: https://github.com/newrelic/rpm
443
505
  licenses:
444
- - New Relic
506
+ - Apache-2.0
445
507
  metadata:
446
- bug_tracker_uri: https://support.newrelic.com/
447
- changelog_uri: https://github.com/newrelic/rpm/blob/master/CHANGELOG.md
508
+ bug_tracker_uri: https://github.com/newrelic/newrelic-ruby-agent/issues
509
+ changelog_uri: https://github.com/newrelic/newrelic-ruby-agent/blob/main/CHANGELOG.md
448
510
  documentation_uri: https://docs.newrelic.com/docs/agents/ruby-agent
449
- source_code_uri: https://github.com/newrelic/rpm
511
+ source_code_uri: https://github.com/newrelic/newrelic-ruby-agent
512
+ homepage_uri: https://newrelic.com/ruby
450
513
  post_install_message:
451
514
  rdoc_options: []
452
515
  require_paths:
@@ -462,7 +525,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
462
525
  - !ruby/object:Gem::Version
463
526
  version: 1.3.1
464
527
  requirements: []
465
- rubygems_version: 3.0.3
528
+ rubygems_version: 3.1.4
466
529
  signing_key:
467
530
  specification_version: 4
468
531
  summary: New Relic Ruby Agent
data/.travis.yml DELETED
@@ -1,175 +0,0 @@
1
- services:
2
- - mysql
3
- - redis-server
4
- - memcached
5
- - rabbitmq
6
-
7
- language: ruby
8
-
9
- dist: precise
10
- sudo: required
11
- jdk:
12
- - oraclejdk8
13
-
14
- before_install:
15
- # RUBY-2072 Prevent Travis setup failure before our test even starts
16
- - jdk_switcher use oraclejdk8
17
- - sudo rm -f /etc/apt/sources.list.d/travis_ci_zeromq3.list
18
- - gem --version
19
- - ./test/script/before_install/update_rubygems.sh
20
- - rvm @global do gem uninstall bundler --all --executables || true
21
- - gem uninstall bundler --all --executables || true
22
- - gem install bundler -v=1.17.3
23
- - ./test/script/before_install/gemstash_mirror.sh
24
- - bundle --version
25
-
26
- install: bundle install
27
-
28
- addons:
29
- apt:
30
- update: true
31
- packages:
32
- - openssl
33
- - libssl-dev
34
- - build-essential
35
- - haveged
36
-
37
- before_script: ./test/script/before_script/install_mongodb.sh
38
-
39
- script: ./test/script/ci.sh
40
-
41
- branches:
42
- only:
43
- - master
44
- - dev
45
- - release
46
-
47
- rvm:
48
- # Run slowest builds first to try and optimize overall cycle time.
49
- - jruby-9.2.6.0
50
- - 2.6.1
51
- - 2.5.3
52
- - 2.4.2
53
- - 2.3.5
54
- - 2.2.8
55
- - 2.1.10
56
- - 2.0.0-p648
57
-
58
- jdk:
59
- - oraclejdk8
60
-
61
- env:
62
- global:
63
- - BUNDLE_PATH=/home/travis/bundle
64
- - MONGODB=2.6.11
65
- - JAVA_OPTS="-XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Xmx640m"
66
- - JRUBY_OPTS="-Xcompile.invokedynamic=false -J-Djruby.compile.mode=OFF"
67
- - RBXOPT="-Xcompiler.no_rbc -Xint"
68
- - SERIALIZE=1
69
- - TESTOPTS="-v"
70
- - VERBOSE = 1
71
- matrix:
72
- - TYPE=UNIT ENVIRONMENT=rails30
73
- - TYPE=UNIT ENVIRONMENT=rails31
74
- - TYPE=UNIT ENVIRONMENT=rails32
75
- - TYPE=UNIT ENVIRONMENT=rails40
76
- - TYPE=UNIT ENVIRONMENT=rails41
77
- - TYPE=UNIT ENVIRONMENT=rails42
78
- - TYPE=UNIT ENVIRONMENT=rails50
79
- - TYPE=UNIT ENVIRONMENT=rails51
80
- - TYPE=UNIT ENVIRONMENT=rails60
81
- - TYPE=UNIT ENVIRONMENT=norails
82
- - TYPE=FUNCTIONAL GROUP=agent
83
- - TYPE=FUNCTIONAL GROUP=api
84
- - TYPE=FUNCTIONAL GROUP=background
85
- - TYPE=FUNCTIONAL GROUP=database
86
- - TYPE=FUNCTIONAL GROUP=httpclients
87
- - TYPE=FUNCTIONAL GROUP=rails
88
- - TYPE=FUNCTIONAL GROUP=serialization
89
- - TYPE=FUNCTIONAL GROUP=sinatra
90
- - TYPE=FUNCTIONAL GROUP=rest
91
- - TYPE=FUNCTIONAL GROUP=background_2
92
- - TYPE=NULLVERSE
93
-
94
- matrix:
95
- allow_failures:
96
- - rvm: jruby-9.2.6.0
97
- env: TYPE=FUNCTIONAL GROUP=agent
98
- fast_finish: true
99
- exclude:
100
- # Unsupported Rails/Ruby combinations
101
- # 2.6
102
- - rvm: 2.6.1
103
- env: TYPE=UNIT ENVIRONMENT=rails30
104
- - rvm: 2.6.1
105
- env: TYPE=UNIT ENVIRONMENT=rails31
106
- - rvm: 2.6.1
107
- env: TYPE=UNIT ENVIRONMENT=rails32
108
- - rvm: 2.6.1
109
- env: TYPE=UNIT ENVIRONMENT=rails40
110
- - rvm: 2.6.1
111
- env: TYPE=UNIT ENVIRONMENT=rails41
112
-
113
- # 2.5
114
- - rvm: 2.5.3
115
- env: TYPE=UNIT ENVIRONMENT=rails30
116
- - rvm: 2.5.3
117
- env: TYPE=UNIT ENVIRONMENT=rails31
118
- - rvm: 2.5.3
119
- env: TYPE=UNIT ENVIRONMENT=rails32
120
- - rvm: 2.5.3
121
- env: TYPE=UNIT ENVIRONMENT=rails40
122
- - rvm: 2.5.3
123
- env: TYPE=UNIT ENVIRONMENT=rails41
124
-
125
- # 2.4
126
- - rvm: 2.4.2
127
- env: TYPE=UNIT ENVIRONMENT=rails30
128
- - rvm: 2.4.2
129
- env: TYPE=UNIT ENVIRONMENT=rails31
130
- - rvm: 2.4.2
131
- env: TYPE=UNIT ENVIRONMENT=rails32
132
- - rvm: 2.4.2
133
- env: TYPE=UNIT ENVIRONMENT=rails40
134
- - rvm: 2.4.2
135
- env: TYPE=UNIT ENVIRONMENT=rails41
136
- - rvm: 2.4.2
137
- env: TYPE=UNIT ENVIRONMENT=rails60
138
-
139
- # 2.3
140
- - rvm: 2.3.5
141
- env: TYPE=UNIT ENVIRONMENT=rails60
142
-
143
- # 2.2
144
- - rvm: 2.2.8
145
- env: TYPE=UNIT ENVIRONMENT=rails60
146
-
147
- # 2.1
148
- - rvm: 2.1.10
149
- env: TYPE=UNIT ENVIRONMENT=rails50
150
- - rvm: 2.1.10
151
- env: TYPE=UNIT ENVIRONMENT=rails51
152
- - rvm: 2.1.10
153
- env: TYPE=UNIT ENVIRONMENT=rails60
154
-
155
- # 2.0
156
- - rvm: 2.0.0-p648
157
- env: TYPE=UNIT ENVIRONMENT=rails50
158
- - rvm: 2.0.0-p648
159
- env: TYPE=UNIT ENVIRONMENT=rails51
160
- - rvm: 2.0.0-p648
161
- env: TYPE=UNIT ENVIRONMENT=rails60
162
-
163
- # jruby 9.2.6.0 (Compatible with MRI 2.5)
164
- - rvm: jruby-9.2.6.0
165
- env: TYPE=UNIT ENVIRONMENT=rails30
166
- - rvm: jruby-9.2.6.0
167
- env: TYPE=UNIT ENVIRONMENT=rails31
168
- - rvm: jruby-9.2.6.0
169
- env: TYPE=UNIT ENVIRONMENT=rails32
170
- - rvm: jruby-9.2.6.0
171
- env: TYPE=UNIT ENVIRONMENT=rails40
172
- - rvm: jruby-9.2.6.0
173
- env: TYPE=UNIT ENVIRONMENT=rails41
174
- - rvm: jruby-9.2.6.0
175
- env: TYPE=UNIT ENVIRONMENT=rails60
@@ -1,110 +0,0 @@
1
- # encoding: utf-8
2
- # This file is distributed under New Relic's license terms.
3
- # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
4
-
5
- require 'digest'
6
- require 'json'
7
-
8
- require 'new_relic/agent/inbound_request_monitor'
9
- require 'new_relic/agent/tracer'
10
- require 'new_relic/agent/threading/agent_thread'
11
- require 'new_relic/agent/cross_app_payload'
12
-
13
- module NewRelic
14
- module Agent
15
- class CrossAppMonitor < InboundRequestMonitor
16
-
17
- NEWRELIC_ID_HEADER = 'X-NewRelic-ID'.freeze
18
- NEWRELIC_TXN_HEADER = 'X-NewRelic-Transaction'.freeze
19
- NEWRELIC_APPDATA_HEADER = 'X-NewRelic-App-Data'.freeze
20
-
21
- NEWRELIC_ID_HEADER_KEY = 'HTTP_X_NEWRELIC_ID'.freeze
22
- NEWRELIC_TXN_HEADER_KEY = 'HTTP_X_NEWRELIC_TRANSACTION'.freeze
23
- CONTENT_LENGTH_HEADER_KEY = 'HTTP_CONTENT_LENGTH'.freeze
24
-
25
- def on_finished_configuring(events)
26
- register_event_listeners(events)
27
- end
28
-
29
- def path_hash(txn_name, seed)
30
- rotated = ((seed << 1) | (seed >> 31)) & 0xffffffff
31
- app_name = NewRelic::Agent.config[:app_name].first
32
- identifier = "#{app_name};#{txn_name}"
33
- sprintf("%08x", rotated ^ hash_transaction_name(identifier))
34
- end
35
-
36
- private
37
-
38
- # Expected sequence of events:
39
- # :before_call will save our cross application request id to the thread
40
- # :after_call will write our response headers/metrics and clean up the thread
41
- def register_event_listeners(events)
42
- NewRelic::Agent.logger.
43
- debug("Wiring up Cross Application Tracing to events after finished configuring")
44
-
45
- events.subscribe(:before_call) do |env| #THREAD_LOCAL_ACCESS
46
- if id = decoded_id(env) and should_process_request?(id)
47
- state = NewRelic::Agent::Tracer.state
48
-
49
- if (transaction = state.current_transaction)
50
- transaction_info = referring_transaction_info(state, env)
51
-
52
- payload = CrossAppPayload.new(id, transaction, transaction_info)
53
- transaction.cross_app_payload = payload
54
- end
55
-
56
- CrossAppTracing.assign_intrinsic_transaction_attributes state
57
- end
58
- end
59
-
60
- events.subscribe(:after_call) do |env, (_status_code, headers, _body)| #THREAD_LOCAL_ACCESS
61
- state = NewRelic::Agent::Tracer.state
62
-
63
- insert_response_header(state, env, headers)
64
- end
65
- end
66
-
67
- def referring_transaction_info(state, request_headers)
68
- txn_header = request_headers[NEWRELIC_TXN_HEADER_KEY] or return
69
- deserialize_header(txn_header, NEWRELIC_TXN_HEADER)
70
- end
71
-
72
- def insert_response_header(state, request_headers, response_headers)
73
- txn = state.current_transaction
74
- unless txn.nil? || txn.cross_app_payload.nil?
75
- txn.freeze_name_and_execute_if_not_ignored do
76
- content_length = content_length_from_request(request_headers)
77
- set_response_headers(txn, response_headers, content_length)
78
- end
79
- end
80
- end
81
-
82
- def should_process_request? id
83
- CrossAppTracing.cross_app_enabled? && CrossAppTracing.trusts?(id)
84
- end
85
-
86
- def set_response_headers(transaction, response_headers, content_length)
87
- payload = obfuscator.obfuscate(
88
- ::JSON.dump(
89
- transaction.cross_app_payload.as_json_array(content_length)))
90
-
91
- response_headers[NEWRELIC_APPDATA_HEADER] = payload
92
- end
93
-
94
- def decoded_id(request)
95
- encoded_id = request[NEWRELIC_ID_HEADER_KEY]
96
- return "" if encoded_id.nil? || encoded_id.empty?
97
-
98
- obfuscator.deobfuscate(encoded_id)
99
- end
100
-
101
- def content_length_from_request(request)
102
- request[CONTENT_LENGTH_HEADER_KEY] || -1
103
- end
104
-
105
- def hash_transaction_name(identifier)
106
- Digest::MD5.digest(identifier).unpack("@12N").first & 0xffffffff
107
- end
108
- end
109
- end
110
- end
@@ -1,40 +0,0 @@
1
- # encoding: utf-8
2
- # This file is distributed under New Relic's license terms.
3
- # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
4
-
5
- require 'new_relic/agent/inbound_request_monitor'
6
- require 'new_relic/agent/cross_app_tracing'
7
-
8
- module NewRelic
9
- module Agent
10
- class DistributedTraceMonitor < InboundRequestMonitor
11
- def on_finished_configuring(events)
12
- return unless NewRelic::Agent.config[:'distributed_tracing.enabled']
13
- events.subscribe(:before_call, &method(:on_before_call))
14
- end
15
-
16
- NEWRELIC_TRACE_KEY = 'HTTP_NEWRELIC'
17
-
18
- def on_before_call(request)
19
- return unless NewRelic::Agent.config[:'distributed_tracing.enabled']
20
- return unless payload = request[NEWRELIC_TRACE_KEY]
21
- return unless txn = Tracer.current_transaction
22
-
23
- if txn.accept_distributed_trace_payload payload
24
- txn.distributed_trace_payload.caller_transport_type = transport_type(request)
25
- end
26
- end
27
-
28
- URL_SCHEMES = {
29
- 'http' => 'HTTP'.freeze,
30
- 'https' => 'HTTPS'.freeze
31
- }
32
-
33
- RACK_URL_SCHEME = 'rack.url_scheme'.freeze
34
-
35
- def transport_type(request)
36
- URL_SCHEMES[request[RACK_URL_SCHEME]]
37
- end
38
- end
39
- end
40
- end