newrelic_rpm 7.2.0 → 8.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (288) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/.rubocop.yml +1936 -0
  4. data/CHANGELOG.md +182 -9
  5. data/CONTRIBUTING.md +14 -2
  6. data/Guardfile +8 -8
  7. data/README.md +5 -1
  8. data/Rakefile +5 -7
  9. data/bin/mongrel_rpm +8 -9
  10. data/bin/newrelic +1 -1
  11. data/bin/nrdebug +14 -14
  12. data/init.rb +0 -2
  13. data/lefthook.yml +9 -0
  14. data/lib/new_relic/agent/adaptive_sampler.rb +9 -5
  15. data/lib/new_relic/agent/agent.rb +44 -46
  16. data/lib/new_relic/agent/agent_logger.rb +8 -9
  17. data/lib/new_relic/agent/attribute_filter.rb +31 -31
  18. data/lib/new_relic/agent/attributes.rb +2 -2
  19. data/lib/new_relic/agent/autostart.rb +6 -7
  20. data/lib/new_relic/agent/commands/agent_command.rb +2 -2
  21. data/lib/new_relic/agent/commands/agent_command_router.rb +6 -5
  22. data/lib/new_relic/agent/commands/thread_profiler_session.rb +7 -6
  23. data/lib/new_relic/agent/configuration/default_source.rb +352 -336
  24. data/lib/new_relic/agent/configuration/dotted_hash.rb +3 -3
  25. data/lib/new_relic/agent/configuration/environment_source.rb +3 -4
  26. data/lib/new_relic/agent/configuration/event_harvest_config.rb +30 -16
  27. data/lib/new_relic/agent/configuration/high_security_source.rb +7 -7
  28. data/lib/new_relic/agent/configuration/manager.rb +57 -58
  29. data/lib/new_relic/agent/configuration/mask_defaults.rb +1 -1
  30. data/lib/new_relic/agent/configuration/security_policy_source.rb +73 -73
  31. data/lib/new_relic/agent/configuration/server_source.rb +12 -11
  32. data/lib/new_relic/agent/configuration/yaml_source.rb +26 -5
  33. data/lib/new_relic/agent/connect/request_builder.rb +13 -16
  34. data/lib/new_relic/agent/connect/response_handler.rb +0 -3
  35. data/lib/new_relic/agent/custom_event_aggregator.rb +9 -9
  36. data/lib/new_relic/agent/database/explain_plan_helpers.rb +3 -4
  37. data/lib/new_relic/agent/database/obfuscation_helpers.rb +12 -12
  38. data/lib/new_relic/agent/database/postgres_explain_obfuscator.rb +2 -2
  39. data/lib/new_relic/agent/database.rb +25 -26
  40. data/lib/new_relic/agent/datastores/metric_helper.rb +10 -10
  41. data/lib/new_relic/agent/datastores/mongo/event_formatter.rb +2 -3
  42. data/lib/new_relic/agent/datastores/mongo/metric_translator.rb +3 -5
  43. data/lib/new_relic/agent/datastores/mongo/obfuscator.rb +1 -2
  44. data/lib/new_relic/agent/datastores/mongo.rb +5 -10
  45. data/lib/new_relic/agent/datastores/redis.rb +2 -4
  46. data/lib/new_relic/agent/datastores.rb +7 -9
  47. data/lib/new_relic/agent/distributed_tracing/cross_app_payload.rb +9 -9
  48. data/lib/new_relic/agent/distributed_tracing/cross_app_tracing.rb +21 -16
  49. data/lib/new_relic/agent/distributed_tracing/distributed_trace_attributes.rb +10 -12
  50. data/lib/new_relic/agent/distributed_tracing/distributed_trace_payload.rb +42 -43
  51. data/lib/new_relic/agent/distributed_tracing/distributed_trace_transport_type.rb +3 -3
  52. data/lib/new_relic/agent/distributed_tracing/trace_context.rb +41 -43
  53. data/lib/new_relic/agent/distributed_tracing/trace_context_payload.rb +25 -25
  54. data/lib/new_relic/agent/distributed_tracing.rb +17 -18
  55. data/lib/new_relic/agent/encoding_normalizer.rb +1 -1
  56. data/lib/new_relic/agent/error_collector.rb +17 -17
  57. data/lib/new_relic/agent/error_event_aggregator.rb +1 -1
  58. data/lib/new_relic/agent/error_filter.rb +16 -10
  59. data/lib/new_relic/agent/error_trace_aggregator.rb +1 -1
  60. data/lib/new_relic/agent/event_aggregator.rb +1 -1
  61. data/lib/new_relic/agent/event_buffer.rb +6 -7
  62. data/lib/new_relic/agent/event_listener.rb +0 -1
  63. data/lib/new_relic/agent/event_loop.rb +14 -14
  64. data/lib/new_relic/agent/external.rb +1 -34
  65. data/lib/new_relic/agent/guid_generator.rb +1 -3
  66. data/lib/new_relic/agent/harvester.rb +3 -4
  67. data/lib/new_relic/agent/heap.rb +1 -3
  68. data/lib/new_relic/agent/hostname.rb +3 -3
  69. data/lib/new_relic/agent/http_clients/abstract.rb +7 -9
  70. data/lib/new_relic/agent/http_clients/curb_wrappers.rb +1 -5
  71. data/lib/new_relic/agent/http_clients/excon_wrappers.rb +4 -4
  72. data/lib/new_relic/agent/http_clients/http_rb_wrappers.rb +3 -3
  73. data/lib/new_relic/agent/http_clients/httpclient_wrappers.rb +1 -2
  74. data/lib/new_relic/agent/http_clients/net_http_wrappers.rb +8 -3
  75. data/lib/new_relic/agent/http_clients/typhoeus_wrappers.rb +2 -3
  76. data/lib/new_relic/agent/http_clients/uri_util.rb +0 -1
  77. data/lib/new_relic/agent/instrumentation/action_cable_subscriber.rb +2 -3
  78. data/lib/new_relic/agent/instrumentation/action_controller_subscriber.rb +10 -11
  79. data/lib/new_relic/agent/instrumentation/action_view_subscriber.rb +5 -7
  80. data/lib/new_relic/agent/instrumentation/active_job.rb +4 -3
  81. data/lib/new_relic/agent/instrumentation/active_merchant.rb +3 -3
  82. data/lib/new_relic/agent/instrumentation/active_record.rb +20 -18
  83. data/lib/new_relic/agent/instrumentation/active_record_helper.rb +36 -42
  84. data/lib/new_relic/agent/instrumentation/active_record_notifications.rb +28 -25
  85. data/lib/new_relic/agent/instrumentation/active_record_prepend.rb +3 -3
  86. data/lib/new_relic/agent/instrumentation/active_record_subscriber.rb +5 -6
  87. data/lib/new_relic/agent/instrumentation/acts_as_solr.rb +8 -9
  88. data/lib/new_relic/agent/instrumentation/bunny/chain.rb +1 -1
  89. data/lib/new_relic/agent/instrumentation/bunny/instrumentation.rb +8 -9
  90. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +42 -42
  91. data/lib/new_relic/agent/instrumentation/curb/chain.rb +19 -20
  92. data/lib/new_relic/agent/instrumentation/curb/instrumentation.rb +34 -38
  93. data/lib/new_relic/agent/instrumentation/curb/prepend.rb +9 -10
  94. data/lib/new_relic/agent/instrumentation/data_mapper.rb +10 -10
  95. data/lib/new_relic/agent/instrumentation/delayed_job/chain.rb +5 -7
  96. data/lib/new_relic/agent/instrumentation/delayed_job/instrumentation.rb +5 -9
  97. data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +4 -4
  98. data/lib/new_relic/agent/instrumentation/excon/middleware.rb +2 -2
  99. data/lib/new_relic/agent/instrumentation/excon.rb +3 -23
  100. data/lib/new_relic/agent/instrumentation/grape/chain.rb +1 -2
  101. data/lib/new_relic/agent/instrumentation/grape/instrumentation.rb +6 -7
  102. data/lib/new_relic/agent/instrumentation/grape.rb +2 -3
  103. data/lib/new_relic/agent/instrumentation/httpclient/chain.rb +2 -3
  104. data/lib/new_relic/agent/instrumentation/httpclient/instrumentation.rb +0 -1
  105. data/lib/new_relic/agent/instrumentation/httpclient/prepend.rb +0 -2
  106. data/lib/new_relic/agent/instrumentation/httprb/chain.rb +2 -2
  107. data/lib/new_relic/agent/instrumentation/httprb/instrumentation.rb +6 -6
  108. data/lib/new_relic/agent/instrumentation/httprb/prepend.rb +1 -1
  109. data/lib/new_relic/agent/instrumentation/ignore_actions.rb +2 -3
  110. data/lib/new_relic/agent/instrumentation/logger/chain.rb +21 -0
  111. data/lib/new_relic/agent/instrumentation/logger/instrumentation.rb +58 -0
  112. data/lib/new_relic/agent/instrumentation/logger/prepend.rb +13 -0
  113. data/lib/new_relic/agent/instrumentation/logger.rb +25 -0
  114. data/lib/new_relic/agent/instrumentation/memcache/dalli.rb +7 -2
  115. data/lib/new_relic/agent/instrumentation/memcache/helper.rb +5 -1
  116. data/lib/new_relic/agent/instrumentation/memcache/prepend.rb +9 -2
  117. data/lib/new_relic/agent/instrumentation/middleware_proxy.rb +9 -10
  118. data/lib/new_relic/agent/instrumentation/middleware_tracing.rb +4 -5
  119. data/lib/new_relic/agent/instrumentation/mongo.rb +3 -141
  120. data/lib/new_relic/agent/instrumentation/mongodb_command_subscriber.rb +4 -4
  121. data/lib/new_relic/agent/instrumentation/net_http/chain.rb +3 -4
  122. data/lib/new_relic/agent/instrumentation/net_http/instrumentation.rb +5 -5
  123. data/lib/new_relic/agent/instrumentation/net_http/prepend.rb +4 -4
  124. data/lib/new_relic/agent/instrumentation/net_http.rb +1 -1
  125. data/lib/new_relic/agent/instrumentation/notifications_subscriber.rb +2 -3
  126. data/lib/new_relic/agent/instrumentation/padrino/chain.rb +23 -19
  127. data/lib/new_relic/agent/instrumentation/padrino/instrumentation.rb +3 -2
  128. data/lib/new_relic/agent/instrumentation/padrino/prepend.rb +2 -2
  129. data/lib/new_relic/agent/instrumentation/padrino.rb +2 -5
  130. data/lib/new_relic/agent/instrumentation/queue_time.rb +8 -8
  131. data/lib/new_relic/agent/instrumentation/rack/chain.rb +5 -5
  132. data/lib/new_relic/agent/instrumentation/rack/helpers.rb +0 -1
  133. data/lib/new_relic/agent/instrumentation/rack/instrumentation.rb +4 -5
  134. data/lib/new_relic/agent/instrumentation/rack/prepend.rb +0 -1
  135. data/lib/new_relic/agent/instrumentation/rack.rb +1 -1
  136. data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +11 -47
  137. data/lib/new_relic/agent/instrumentation/rails_notifications/action_cable.rb +2 -2
  138. data/lib/new_relic/agent/instrumentation/rails_notifications/action_controller.rb +0 -1
  139. data/lib/new_relic/agent/instrumentation/rake/chain.rb +0 -5
  140. data/lib/new_relic/agent/instrumentation/rake/instrumentation.rb +6 -6
  141. data/lib/new_relic/agent/instrumentation/rake.rb +1 -1
  142. data/lib/new_relic/agent/instrumentation/redis/chain.rb +6 -6
  143. data/lib/new_relic/agent/instrumentation/redis/instrumentation.rb +2 -2
  144. data/lib/new_relic/agent/instrumentation/redis/prepend.rb +1 -1
  145. data/lib/new_relic/agent/instrumentation/redis.rb +1 -1
  146. data/lib/new_relic/agent/instrumentation/resque/chain.rb +2 -3
  147. data/lib/new_relic/agent/instrumentation/resque/helper.rb +1 -1
  148. data/lib/new_relic/agent/instrumentation/resque/instrumentation.rb +4 -4
  149. data/lib/new_relic/agent/instrumentation/resque/prepend.rb +1 -2
  150. data/lib/new_relic/agent/instrumentation/resque.rb +7 -7
  151. data/lib/new_relic/agent/instrumentation/sequel.rb +7 -9
  152. data/lib/new_relic/agent/instrumentation/sequel_helper.rb +1 -1
  153. data/lib/new_relic/agent/instrumentation/sidekiq.rb +7 -1
  154. data/lib/new_relic/agent/instrumentation/sinatra/ignorer.rb +0 -1
  155. data/lib/new_relic/agent/instrumentation/sinatra/instrumentation.rb +4 -3
  156. data/lib/new_relic/agent/instrumentation/sunspot.rb +1 -1
  157. data/lib/new_relic/agent/instrumentation/tilt/chain.rb +24 -0
  158. data/lib/new_relic/agent/instrumentation/tilt/instrumentation.rb +40 -0
  159. data/lib/new_relic/agent/instrumentation/tilt/prepend.rb +13 -0
  160. data/lib/new_relic/agent/instrumentation/tilt.rb +25 -0
  161. data/lib/new_relic/agent/instrumentation/typhoeus/chain.rb +4 -4
  162. data/lib/new_relic/agent/instrumentation/typhoeus/instrumentation.rb +3 -5
  163. data/lib/new_relic/agent/instrumentation/typhoeus/prepend.rb +1 -1
  164. data/lib/new_relic/agent/internal_agent_error.rb +1 -1
  165. data/lib/new_relic/agent/javascript_instrumentor.rb +30 -30
  166. data/lib/new_relic/agent/logging.rb +11 -8
  167. data/lib/new_relic/agent/memory_logger.rb +1 -1
  168. data/lib/new_relic/agent/messaging.rb +46 -61
  169. data/lib/new_relic/agent/method_tracer.rb +139 -143
  170. data/lib/new_relic/agent/method_tracer_helpers.rb +2 -2
  171. data/lib/new_relic/agent/monitors/cross_app_monitor.rb +21 -13
  172. data/lib/new_relic/agent/monitors/distributed_tracing_monitor.rb +2 -2
  173. data/lib/new_relic/agent/monitors/inbound_request_monitor.rb +0 -1
  174. data/lib/new_relic/agent/monitors/synthetics_monitor.rb +4 -7
  175. data/lib/new_relic/agent/monitors.rb +1 -2
  176. data/lib/new_relic/agent/new_relic_service/encoders.rb +4 -4
  177. data/lib/new_relic/agent/new_relic_service/json_marshaller.rb +1 -1
  178. data/lib/new_relic/agent/new_relic_service/marshaller.rb +1 -1
  179. data/lib/new_relic/agent/new_relic_service/security_policy_settings.rb +4 -3
  180. data/lib/new_relic/agent/new_relic_service.rb +34 -41
  181. data/lib/new_relic/agent/noticible_error.rb +0 -2
  182. data/lib/new_relic/agent/null_logger.rb +6 -2
  183. data/lib/new_relic/agent/obfuscator.rb +6 -8
  184. data/lib/new_relic/agent/parameter_filtering.rb +3 -5
  185. data/lib/new_relic/agent/payload_metric_mapping.rb +8 -9
  186. data/lib/new_relic/agent/pipe_channel_manager.rb +15 -12
  187. data/lib/new_relic/agent/pipe_service.rb +2 -2
  188. data/lib/new_relic/agent/priority_sampled_buffer.rb +4 -7
  189. data/lib/new_relic/agent/rules_engine/replacement_rule.rb +9 -9
  190. data/lib/new_relic/agent/rules_engine/segment_terms_rule.rb +12 -12
  191. data/lib/new_relic/agent/rules_engine.rb +2 -2
  192. data/lib/new_relic/agent/sampler.rb +2 -3
  193. data/lib/new_relic/agent/sampler_collection.rb +2 -3
  194. data/lib/new_relic/agent/samplers/cpu_sampler.rb +1 -1
  195. data/lib/new_relic/agent/samplers/delayed_job_sampler.rb +10 -7
  196. data/lib/new_relic/agent/samplers/memory_sampler.rb +4 -3
  197. data/lib/new_relic/agent/samplers/vm_sampler.rb +18 -18
  198. data/lib/new_relic/agent/span_event_aggregator.rb +10 -10
  199. data/lib/new_relic/agent/span_event_primitive.rb +39 -39
  200. data/lib/new_relic/agent/sql_sampler.rb +9 -9
  201. data/lib/new_relic/agent/stats.rb +16 -16
  202. data/lib/new_relic/agent/stats_engine/gc_profiler.rb +7 -9
  203. data/lib/new_relic/agent/stats_engine/stats_hash.rb +8 -9
  204. data/lib/new_relic/agent/stats_engine.rb +7 -7
  205. data/lib/new_relic/agent/synthetics_event_aggregator.rb +0 -1
  206. data/lib/new_relic/agent/system_info.rb +22 -20
  207. data/lib/new_relic/agent/threading/agent_thread.rb +4 -5
  208. data/lib/new_relic/agent/threading/backtrace_node.rb +6 -9
  209. data/lib/new_relic/agent/threading/backtrace_service.rb +12 -13
  210. data/lib/new_relic/agent/threading/thread_profile.rb +16 -19
  211. data/lib/new_relic/agent/tracer.rb +43 -71
  212. data/lib/new_relic/agent/transaction/abstract_segment.rb +9 -9
  213. data/lib/new_relic/agent/transaction/datastore_segment.rb +7 -6
  214. data/lib/new_relic/agent/transaction/distributed_tracer.rb +8 -9
  215. data/lib/new_relic/agent/transaction/distributed_tracing.rb +21 -22
  216. data/lib/new_relic/agent/transaction/external_request_segment.rb +6 -5
  217. data/lib/new_relic/agent/transaction/message_broker_segment.rb +24 -30
  218. data/lib/new_relic/agent/transaction/request_attributes.rb +7 -7
  219. data/lib/new_relic/agent/transaction/segment.rb +6 -3
  220. data/lib/new_relic/agent/transaction/slowest_sample_buffer.rb +0 -2
  221. data/lib/new_relic/agent/transaction/trace.rb +8 -8
  222. data/lib/new_relic/agent/transaction/trace_context.rb +13 -15
  223. data/lib/new_relic/agent/transaction/trace_node.rb +16 -16
  224. data/lib/new_relic/agent/transaction/tracing.rb +1 -3
  225. data/lib/new_relic/agent/transaction/transaction_sample_buffer.rb +1 -2
  226. data/lib/new_relic/agent/transaction.rb +85 -108
  227. data/lib/new_relic/agent/transaction_error_primitive.rb +16 -16
  228. data/lib/new_relic/agent/transaction_event_aggregator.rb +5 -6
  229. data/lib/new_relic/agent/transaction_event_primitive.rb +29 -29
  230. data/lib/new_relic/agent/transaction_metrics.rb +3 -3
  231. data/lib/new_relic/agent/transaction_sampler.rb +0 -1
  232. data/lib/new_relic/agent/transaction_time_aggregator.rb +11 -11
  233. data/lib/new_relic/agent/utilization/azure.rb +1 -1
  234. data/lib/new_relic/agent/utilization_data.rb +3 -4
  235. data/lib/new_relic/agent/vm/monotonic_gc_profiler.rb +1 -1
  236. data/lib/new_relic/agent/vm/snapshot.rb +4 -4
  237. data/lib/new_relic/agent/worker_loop.rb +8 -10
  238. data/lib/new_relic/agent.rb +27 -27
  239. data/lib/new_relic/cli/command.rb +15 -17
  240. data/lib/new_relic/cli/commands/deployments.rb +21 -23
  241. data/lib/new_relic/cli/commands/install.rb +6 -10
  242. data/lib/new_relic/coerce.rb +5 -8
  243. data/lib/new_relic/collection_helper.rb +48 -47
  244. data/lib/new_relic/constants.rb +0 -4
  245. data/lib/new_relic/control/class_methods.rb +2 -2
  246. data/lib/new_relic/control/frameworks/external.rb +1 -1
  247. data/lib/new_relic/control/frameworks/rails.rb +5 -6
  248. data/lib/new_relic/control/frameworks/rails3.rb +2 -3
  249. data/lib/new_relic/control/frameworks/ruby.rb +2 -2
  250. data/lib/new_relic/control/instance_methods.rb +4 -5
  251. data/lib/new_relic/control/instrumentation.rb +4 -5
  252. data/lib/new_relic/control/server_methods.rb +2 -3
  253. data/lib/new_relic/control.rb +0 -1
  254. data/lib/new_relic/dependency_detection.rb +6 -8
  255. data/lib/new_relic/environment_report.rb +16 -18
  256. data/lib/new_relic/helper.rb +5 -5
  257. data/lib/new_relic/language_support.rb +1 -1
  258. data/lib/new_relic/latest_changes.rb +2 -2
  259. data/lib/new_relic/local_environment.rb +7 -7
  260. data/lib/new_relic/metric_data.rb +6 -7
  261. data/lib/new_relic/metric_spec.rb +3 -3
  262. data/lib/new_relic/noticed_error.rb +16 -17
  263. data/lib/new_relic/rack/agent_middleware.rb +2 -2
  264. data/lib/new_relic/rack/browser_monitoring.rb +9 -9
  265. data/lib/new_relic/recipes/capistrano3.rb +11 -13
  266. data/lib/new_relic/recipes/capistrano_legacy.rb +11 -14
  267. data/lib/new_relic/supportability_helper.rb +1 -2
  268. data/lib/new_relic/version.rb +4 -5
  269. data/lib/newrelic_rpm.rb +10 -34
  270. data/lib/sequel/extensions/newrelic_instrumentation.rb +4 -7
  271. data/lib/sequel/plugins/newrelic_instrumentation.rb +3 -9
  272. data/lib/tasks/all.rb +2 -2
  273. data/lib/tasks/config.rake +21 -21
  274. data/lib/tasks/multiverse.rb +4 -6
  275. data/lib/tasks/tests.rake +3 -7
  276. data/newrelic.yml +580 -3
  277. data/newrelic_rpm.gemspec +13 -12
  278. data/recipes/newrelic.rb +1 -1
  279. data/test/agent_helper.rb +80 -55
  280. metadata +42 -13
  281. data/lib/new_relic/agent/datastores/mongo/statement_formatter.rb +0 -53
  282. data/lib/new_relic/agent/instrumentation/excon/connection.rb +0 -49
  283. data/lib/new_relic/agent/instrumentation/merb/controller.rb +0 -44
  284. data/lib/new_relic/agent/instrumentation/merb/errors.rb +0 -33
  285. data/lib/new_relic/agent/instrumentation/rails/action_controller.rb +0 -125
  286. data/lib/new_relic/agent/instrumentation/rails/action_web_service.rb +0 -46
  287. data/lib/new_relic/agent/supported_versions.rb +0 -275
  288. data/lib/new_relic/control/frameworks/merb.rb +0 -29
@@ -1,44 +0,0 @@
1
- # encoding: utf-8
2
- # This file is distributed under New Relic's license terms.
3
- # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
4
-
5
- require 'set'
6
-
7
- DependencyDetection.defer do
8
- @name = :merb_controller
9
-
10
- depends_on do
11
- defined?(Merb) && defined?(Merb::Controller)
12
- end
13
-
14
- executes do
15
- ::NewRelic::Agent.logger.info 'Installing Merb Controller instrumentation'
16
- end
17
-
18
- executes do
19
- require 'merb-core/controller/merb_controller'
20
-
21
- Merb::Controller.class_eval do
22
- include NewRelic::Agent::Instrumentation::ControllerInstrumentation
23
-
24
- # determine the path that is used in the metric name for
25
- # the called controller action
26
- def newrelic_metric_path
27
- "#{controller_name}/#{action_name}"
28
- end
29
-
30
- protected
31
-
32
- def _dispatch_with_newrelic_trace(*args)
33
- options = {}
34
- options[:params] = params
35
- perform_action_with_newrelic_trace(options) do
36
- _dispatch_without_newrelic_trace(*args)
37
- end
38
- end
39
-
40
- alias_method :_dispatch_without_newrelic_trace, :_dispatch
41
- alias_method :_dispatch, :_dispatch_with_newrelic_trace
42
- end
43
- end
44
- end
@@ -1,33 +0,0 @@
1
- # encoding: utf-8
2
- # This file is distributed under New Relic's license terms.
3
- # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
4
-
5
- DependencyDetection.defer do
6
- @name = :merb_error
7
-
8
- depends_on do
9
- defined?(Merb) && defined?(Merb::Dispatcher) && defined?(Merb::Dispatcher::DefaultException)
10
- end
11
-
12
- depends_on do
13
- Merb::Dispatcher::DefaultException.respond_to?(:before)
14
- end
15
-
16
- executes do
17
- ::NewRelic::Agent.logger.info 'Installing Merb Errors instrumentation'
18
- end
19
-
20
- executes do
21
-
22
- # Hook in the notification to merb
23
- error_notifier = Proc.new {
24
- if request.exceptions #check that there's actually an exception
25
- # Note, this assumes we have already captured the other information such as uri and params in the Transaction.
26
- NewRelic::Agent::Transaction.notice_error(request.exceptions.first)
27
- end
28
- }
29
- Merb::Dispatcher::DefaultException.before error_notifier
30
- Exceptions.before error_notifier
31
-
32
- end
33
- end
@@ -1,125 +0,0 @@
1
- # encoding: utf-8
2
- # This file is distributed under New Relic's license terms.
3
- # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
4
-
5
- require 'new_relic/agent/parameter_filtering'
6
-
7
- DependencyDetection.defer do
8
- @name = :rails21_view
9
-
10
- depends_on do
11
- !NewRelic::Agent.config[:disable_view_instrumentation] &&
12
- defined?(ActionController) && defined?(ActionController::Base) && defined?(ActionView::PartialTemplate) && defined?(ActionView::Template) &&
13
- defined?(Rails::VERSION::STRING) && Rails::VERSION::STRING =~ /^2\.1\./ # Rails 2.1 &&
14
- end
15
-
16
- executes do
17
- ::NewRelic::Agent.logger.info 'Installing Rails 2.1 View instrumentation'
18
- end
19
-
20
- executes do
21
- ActionView::PartialTemplate.class_eval do
22
- include NewRelic::Agent::MethodTracer
23
- add_method_tracer :render, 'View/#{path_without_extension[%r{^(/.*/)?(.*)$},2]}.#{@view.template_format}.#{extension}/Partial'
24
- end
25
-
26
- # this is for template rendering, as opposed to partial rendering.
27
- ActionView::Template.class_eval do
28
- include NewRelic::Agent::MethodTracer
29
- add_method_tracer :render, 'View/#{(path_without_extension || @view.controller.newrelic_metric_path)[%r{^(/.*/)?(.*)$},2]}.#{@view.template_format}.#{extension}/Rendering'
30
- end
31
- end
32
- end
33
-
34
- DependencyDetection.defer do
35
- @name = :old_rails_view
36
-
37
- depends_on do
38
- !NewRelic::Agent.config[:disable_view_instrumentation] &&
39
- defined?(ActionController) && defined?(ActionController::Base) &&
40
- defined?(Rails::VERSION::STRING) && Rails::VERSION::STRING =~ /^(1\.|2\.0)/ # Rails 1.* - 2.0
41
- end
42
-
43
- executes do
44
- ::NewRelic::Agent.logger.info 'Installing Rails 1.* - 2.0 View instrumentation'
45
- end
46
-
47
- executes do
48
- ActionController::Base.class_eval do
49
- include NewRelic::Agent::MethodTracer
50
- add_method_tracer :render, 'View/#{newrelic_metric_path}/Rendering'
51
- end
52
- end
53
- end
54
-
55
- DependencyDetection.defer do
56
- @name = :rails23_view
57
-
58
- depends_on do
59
- !NewRelic::Agent.config[:disable_view_instrumentation] &&
60
- defined?(ActionView) && defined?(ActionView::Template) && defined?(ActionView::RenderablePartial) &&
61
- defined?(Rails::VERSION::STRING) && Rails::VERSION::STRING =~ /^2\.[23]/
62
- end
63
-
64
- executes do
65
- ::NewRelic::Agent.logger.info 'Installing Rails 2.2 - 2.3 View instrumentation'
66
- end
67
-
68
- executes do
69
- ActionView::RenderablePartial.module_eval do
70
- include NewRelic::Agent::MethodTracer
71
- add_method_tracer :render_partial, 'View/#{path[%r{^(/.*/)?(.*)$},2]}/Partial'
72
- end
73
-
74
- ActionView::Template.class_eval do
75
- include NewRelic::Agent::MethodTracer
76
- add_method_tracer :render, 'View/#{path[%r{^(/.*/)?(.*)$},2]}/Rendering'
77
- end
78
- end
79
- end
80
-
81
- DependencyDetection.defer do
82
- @name = :rails2_controller
83
-
84
- depends_on do
85
- defined?(ActionController) && defined?(ActionController::Base)
86
- end
87
-
88
- depends_on do
89
- defined?(Rails::VERSION::MAJOR) && Rails::VERSION::MAJOR.to_i == 2
90
- end
91
-
92
- executes do
93
- ::NewRelic::Agent.logger.info 'Installing Rails 2 Controller instrumentation'
94
- end
95
-
96
- executes do
97
- ActionController::Base.class_eval do
98
- include NewRelic::Agent::Instrumentation::ControllerInstrumentation
99
-
100
- def perform_action_with_newrelic_trace_wrapper
101
- munged_params = (respond_to?(:filter_parameters)) ? filter_parameters(params) : params
102
- munged_params = NewRelic::Agent::ParameterFiltering.filter_rails_request_parameters(munged_params)
103
-
104
- perform_action_with_newrelic_trace(:params => munged_params) do
105
- perform_action_without_newrelic_trace
106
- end
107
- end
108
-
109
- alias_method :perform_action_without_newrelic_trace, :perform_action
110
- alias_method :perform_action, :perform_action_with_newrelic_trace_wrapper
111
- private :perform_action
112
-
113
- # determine the path that is used in the metric name for
114
- # the called controller action
115
- def newrelic_metric_path(action_name_override = nil)
116
- action_part = action_name_override || action_name
117
- if action_name_override || self.class.action_methods.include?(action_part)
118
- "#{self.class.controller_path}/#{action_part}"
119
- else
120
- "#{self.class.controller_path}/(other)"
121
- end
122
- end
123
- end
124
- end
125
- end
@@ -1,46 +0,0 @@
1
- # encoding: utf-8
2
- # This file is distributed under New Relic's license terms.
3
- # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
4
-
5
- DependencyDetection.defer do
6
- @name = :rails_action_web_service
7
-
8
- depends_on do
9
- defined?(ActionWebService)
10
- end
11
-
12
- executes do
13
- ::NewRelic::Agent.logger.info 'Installing Rails ActionWebService instrumentation'
14
- end
15
-
16
- executes do
17
- # NewRelic Agent instrumentation for WebServices
18
-
19
- # Note Action Web Service is removed from default package in rails
20
- # 2.0, this is purely here as a service to our legacy customers.
21
-
22
- # instrumentation for Web Service martialing - XML RPC
23
- ActionWebService::Protocol::XmlRpc::XmlRpcProtocol.class_eval do
24
- add_method_tracer :decode_request, "WebService/Xml Rpc/XML Decode"
25
- add_method_tracer :encode_request, "WebService/Xml Rpc/XML Encode"
26
- add_method_tracer :decode_response, "WebService/Xml Rpc/XML Decode"
27
- add_method_tracer :encode_response, "WebService/Xml Rpc/XML Encode"
28
- end
29
-
30
- # instrumentation for Web Service martialing - Soap
31
- ActionWebService::Protocol::Soap::SoapProtocol.class_eval do
32
- add_method_tracer :decode_request, "WebService/Soap/XML Decode"
33
- add_method_tracer :encode_request, "WebService/Soap/XML Encode"
34
- add_method_tracer :decode_response, "WebService/Soap/XML Decode"
35
- add_method_tracer :encode_response, "WebService/Soap/XML Encode"
36
- end
37
-
38
- if defined?(ActionController) && defined?(ActionController::Base)
39
- ActionController::Base.class_eval do
40
- if method_defined? :perform_invocation
41
- add_method_tracer :perform_invocation, 'WebService/#{controller_name}/#{args.first}'
42
- end
43
- end
44
- end
45
- end
46
- end
@@ -1,275 +0,0 @@
1
- # encoding: utf-8
2
- # This file is distributed under New Relic's license terms.
3
- # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
4
-
5
- module NewRelic
6
- module Agent
7
- SUPPORTED_VERSIONS =
8
- {
9
- # Rubies
10
- :mri =>
11
- {
12
- :type => :ruby,
13
- :name => "MRI",
14
- :supported => ["2.0.0", "~>2.1.0", "~>2.2.0", "~>2.3.0", "~>2.4.0", "~>2.5.0", "~>2.6.0", "~>2.7.0"],
15
- :deprecated => ["1.8.6", "1.8.7", "1.9.2", "1.9.3"],
16
- :url => "https://www.ruby-lang.org",
17
- :feed => "https://www.ruby-lang.org/en/feeds/news.rss",
18
- :notes => ["Last supported agent for 1.8.7, 1.9.2, and 1.9.3 was 3.18.1.330.",
19
- "Last supported agent on 1.8.6 was 3.6.8.168."]
20
- },
21
- :jruby =>
22
- {
23
- :type => :ruby,
24
- :name => "JRuby",
25
- :supported => ["~>9.0", "~>9.1"],
26
- :deprecated => ["~>1.7.0"],
27
- :url => "http://jruby.org",
28
- :feed => "http://jruby.org/atom.xml",
29
- :notes => ["Last supported agent for ~>1.7.0 was 3.18.1.330."]
30
- },
31
-
32
- # App servers
33
- :passenger =>
34
- {
35
- :type => :app_server,
36
- :supported => ["~>2.2", "~>3.0", "~>4.0"],
37
- :url => "http://www.phusionpassenger.com/",
38
- :feed => "http://rubygems.org/gems/passenger/versions.atom"
39
- },
40
- :thin =>
41
- {
42
- :type => :app_server,
43
- :supported => ["~>1.0"],
44
- :url => "http://code.macournoyer.com/thin/",
45
- :feed => "http://rubygems.org/gems/thin/versions.atom"
46
- },
47
- :unicorn =>
48
- {
49
- :type => :app_server,
50
- :supported => ["~>4.0"],
51
- :deprecated => ["~>1.0", "~>2.0", "~>3.0"],
52
- :url => "http://unicorn.bogomips.org/",
53
- :feed => "http://rubygems.org/gems/unicorn/versions.atom"
54
- },
55
- :puma =>
56
- {
57
- :type => :app_server,
58
- :supported => ["~>2.0"],
59
- :deprecated => ["~>1.0"],
60
- :url => "http://puma.io/",
61
- :feed => "http://rubygems.org/gems/puma/versions.atom"
62
- },
63
- :rainbows =>
64
- {
65
- :type => :app_server,
66
- :name => "rainbows!",
67
- :experimental=> ["4.5.0"],
68
- :url => "http://rainbows.rubyforge.org/",
69
- :feed => "http://rubygems.org/gems/rainbows/versions.atom"
70
- },
71
- :webrick =>
72
- {
73
- :type => :app_server,
74
- :notes => [ "Supported for all agent-supported versions of Ruby" ]
75
- },
76
-
77
- # Web frameworks
78
- :rails =>
79
- {
80
- :type => :web,
81
- :supported => ["~3.0.0", "~>3.1.0", "~>3.2.0", "~>4.0.0", "~>4.1.0", "~>4.2.0", "~>5.0.0", "~>5.1.0"],
82
- :deprecated => ["~>2.0.0", "~>2.1.0", "~>2.2.0", "~>2.3.0"],
83
- :url => "https://rubygems.org/gems/rails",
84
- :feed => "https://rubygems.org/gems/rails/versions.atom",
85
- :notes => ["Last supported agent for ~>2.1.0, ~>2.2.0, and ~>2.3.0 was 3.18.1.330.",
86
- "Last supported agent for 2.0.x was 3.6.8.168."]
87
- },
88
- :sinatra =>
89
- {
90
- :type => :web,
91
- :supported => ["~>1.2.0", "~>1.3.0", "~>1.4.0", "~>2.0.0"],
92
- :url => "https://rubygems.org/gems/sinatra",
93
- :feed => "https://rubygems.org/gems/sinatra/versions.atom"
94
- },
95
- :padrino =>
96
- {
97
- :type => :web,
98
- :supported => ["~>0.10"],
99
- :url => "https://rubygems.org/gems/padrino",
100
- :feed => "https://rubygems.org/gems/padrino/versions.atom"
101
- },
102
- :rack =>
103
- {
104
- :type => :web,
105
- :supported => [">= 1.1.0"],
106
- :deprecated => ["~>1.0.0"],
107
- :url => "https://rubygems.org/gems/rack",
108
- :feed => "https://rubygems.org/gems/rack/versions.atom"
109
- },
110
- :grape =>
111
- {
112
- :type => :web,
113
- :supported => [">= 0.2.0"],
114
- :url => "https://rubygems.org/gems/grape",
115
- :feed => "https://rubygems.org/gems/grape/versions.atom"
116
- },
117
-
118
- # Database
119
- :activerecord =>
120
- {
121
- :type => :database,
122
- :supported => ["~>3.0.0", "~>3.1.0", "~>3.2.0", "~>4.0.0", "~>4.1.0", "~>4.2.0", "~>5.0.0", "~>5.1.0", "~>6.0.0"],
123
- :deprecated => ["~>2.0.0", "~>2.1.0", "~>2.2.0", "~>2.3.0",],
124
- :url => "https://rubygems.org/gems/activerecord",
125
- :feed => "https://rubygems.org/gems/activerecord/versions.atom",
126
- :notes => ["Last supported agent for ~>2.1.0, ~>2.2.0, and ~>2.3.0 was 3.18.1.330.",
127
- "Last supported agent for 2.0.x was 3.6.8.168."]
128
- },
129
- :datamapper =>
130
- {
131
- :type => :database,
132
- :supported => ["~>1.0"],
133
- :url => "https://rubygems.org/gems/datamapper",
134
- :feed => "https://rubygems.org/gems/datamapper/versions.atom"
135
- },
136
- :sequel =>
137
- {
138
- :type => :database,
139
- :supported => ["~>3.37", "~>4.0"],
140
- :url => "https://rubygems.org/gems/sequel",
141
- :feed => "https://rubygems.org/gems/sequel/versions.atom"
142
- },
143
- :mongo =>
144
- {
145
- :type => :database,
146
- :supported => ["~>1.8", "~>2.1"],
147
- :url => "https://rubygems.org/gems/mongo",
148
- :feed => "https://rubygems.org/gems/mongo/versions.atom"
149
- },
150
- :redis =>
151
- {
152
- :type => :database,
153
- :supported => ["~>3.0"],
154
- :url => "https://rubygems.org/gems/redis",
155
- :feed => "https://rubygems.org/gems/redis/versions.atom"
156
- },
157
-
158
- # Background Jobs
159
- :rake =>
160
- {
161
- :type => :background,
162
- :supported => ["~>10.0"],
163
- :url => "https://rubygems.org/gems/rake",
164
- :feed => "https://rubygems.org/gems/rake/versions.atom"
165
- },
166
- :resque =>
167
- {
168
- :type => :background,
169
- :supported => ["~>1.23.0"],
170
- :deprecated => ["~>1.22.0"],
171
- :experimental=> [">= 2.0"],
172
- :url => "https://rubygems.org/gems/resque",
173
- :feed => "https://rubygems.org/gems/resque/versions.atom"
174
- },
175
- :sidekiq =>
176
- {
177
- :type => :background,
178
- :supported => ["~>2.8", "~>3.4.2", "~>4.0"],
179
- :url => "https://rubygems.org/gems/sidekiq",
180
- :feed => "https://rubygems.org/gems/sidekiq/versions.atom"
181
- },
182
- :delayed_job =>
183
- {
184
- :type => :background,
185
- :supported => ["~>2.0", "~>3.0", "~>4.0"],
186
- :url => "https://rubygems.org/gems/delayed_job",
187
- :feed => "https://rubygems.org/gems/delayed_job/versions.atom"
188
- },
189
-
190
- # HTTP Clients
191
- :curb =>
192
- {
193
- :type => :http,
194
- :supported => [ ">= 0.8.1" ],
195
- :url => "https://rubygems.org/gems/curb",
196
- :feed => "https://rubygems.org/gems/curb/versions.atom"
197
- },
198
- :excon =>
199
- {
200
- :type => :http,
201
- :supported => [ ">= 0.10.1" ],
202
- :url => "https://rubygems.org/gems/excon",
203
- :feed => "https://rubygems.org/gems/excon/versions.atom"
204
- },
205
- :httpclient =>
206
- {
207
- :type => :http,
208
- :supported => [ ">= 2.2.0"],
209
- :url => "https://rubygems.org/gems/httpclient",
210
- :feed => "https://rubygems.org/gems/httpclient/versions.atom"
211
- },
212
- :typhoeus =>
213
- {
214
- :type => :http,
215
- :supported => [ ">= 0.5.3"],
216
- :url => "https://rubygems.org/gems/typhoeus",
217
- :feed => "https://rubygems.org/gems/typhoeus/versions.atom"
218
- },
219
- :net_http =>
220
- {
221
- :type => :http,
222
- :name => "Net::HTTP",
223
- :notes => [
224
- "Supported for all agent-supported versions of Ruby.",
225
- "For more information on supported HTTP clients see http://docs.newrelic.com/docs/ruby/ruby-http-clients."]
226
- },
227
- :httprb =>
228
- {
229
- :type => :http,
230
- :supported => [ ">= 0.9.9"],
231
- :url => "https://rubygems.org/gems/http",
232
- :feed => "https://rubygems.org/gems/http/versions.atom"
233
- },
234
-
235
- # Other
236
- :sunspot =>
237
- {
238
- :type => :other,
239
- :url => "https://rubygems.org/gems/sunspot",
240
- :feed => "https://rubygems.org/gems/sunspot/versions.atom"
241
- },
242
- :acts_as_solr =>
243
- {
244
- :type => :other,
245
- :url => "https://rubygems.org/gems/acts_as_solr",
246
- :feed => "https://rubygems.org/gems/acts_as_solr/versions.atom"
247
- },
248
- :dalli =>
249
- {
250
- :type => :other,
251
- :url => "https://rubygems.org/gems/dalli",
252
- :feed => "https://rubygems.org/gems/dalli/versions.atom"
253
- },
254
- :'memcache-client' =>
255
- {
256
- :type => :other,
257
- :url => "https://rubygems.org/gems/memcache-client",
258
- :feed => "https://rubygems.org/gems/memcache-client/versions.atom"
259
- },
260
- :authlogic =>
261
- {
262
- :type => :other,
263
- :url => "https://rubygems.org/gems/authlogic",
264
- :feed => "https://rubygems.org/gems/authlogic/versions.atom"
265
- },
266
- :activemerchant =>
267
- {
268
- :type => :other,
269
- :supported => [ ">= 1.25.0"],
270
- :url => "https://rubygems.org/gems/activemerchant",
271
- :feed => "https://rubygems.org/gems/activemerchant/versions.atom"
272
- },
273
- }
274
- end
275
- end
@@ -1,29 +0,0 @@
1
- # encoding: utf-8
2
- # This file is distributed under New Relic's license terms.
3
- # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
4
-
5
- module NewRelic
6
- class Control
7
- module Frameworks
8
- # Includes limited support for Merb
9
- class Merb < NewRelic::Control
10
-
11
- def env
12
- @env ||= ::Merb.env
13
- end
14
- def root
15
- ::Merb.root
16
- end
17
-
18
- def init_config options={}
19
- ::Merb::Plugins.add_rakefiles File.join(newrelic_root,"lib/tasks/all.rb")
20
-
21
- # Merb gives you a Merb::Plugins.config hash...feel free to put your stuff in your piece of it
22
- ::Merb::Plugins.config[:newrelic] = {
23
- :config => self
24
- }
25
- end
26
- end
27
- end
28
- end
29
- end