newrelic_rpm 8.7.0 → 8.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (398) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +4 -0
  3. data/.rubocop.yml +68 -189
  4. data/.rubocop_todo.yml +52 -0
  5. data/.simplecov +15 -0
  6. data/.snyk +11 -0
  7. data/.yardopts +1 -0
  8. data/Brewfile +1 -0
  9. data/CHANGELOG.md +181 -23
  10. data/CONTRIBUTING.md +1 -1
  11. data/Gemfile +0 -1
  12. data/Guardfile +1 -0
  13. data/README.md +1 -1
  14. data/Rakefile +13 -20
  15. data/Thorfile +5 -0
  16. data/bin/newrelic +2 -1
  17. data/bin/newrelic_cmd +1 -0
  18. data/bin/nrdebug +66 -45
  19. data/config.dot +5 -5
  20. data/init.rb +4 -4
  21. data/install.rb +2 -2
  22. data/lib/new_relic/agent/adaptive_sampler.rb +4 -4
  23. data/lib/new_relic/agent/agent/shutdown.rb +34 -0
  24. data/lib/new_relic/agent/agent/special_startup.rb +70 -0
  25. data/lib/new_relic/agent/agent/start_worker_thread.rb +163 -0
  26. data/lib/new_relic/agent/agent/startup.rb +196 -0
  27. data/lib/new_relic/agent/agent.rb +134 -534
  28. data/lib/new_relic/agent/agent_logger.rb +8 -10
  29. data/lib/new_relic/agent/attribute_filter.rb +40 -21
  30. data/lib/new_relic/agent/attribute_processing.rb +7 -7
  31. data/lib/new_relic/agent/attributes.rb +2 -2
  32. data/lib/new_relic/agent/audit_logger.rb +3 -3
  33. data/lib/new_relic/agent/autostart.rb +2 -2
  34. data/lib/new_relic/agent/chained_call.rb +1 -1
  35. data/lib/new_relic/agent/commands/agent_command.rb +1 -1
  36. data/lib/new_relic/agent/commands/agent_command_router.rb +8 -8
  37. data/lib/new_relic/agent/commands/thread_profiler_session.rb +1 -1
  38. data/lib/new_relic/agent/configuration/default_source.rb +105 -41
  39. data/lib/new_relic/agent/configuration/dotted_hash.rb +2 -2
  40. data/lib/new_relic/agent/configuration/environment_source.rb +5 -5
  41. data/lib/new_relic/agent/configuration/event_harvest_config.rb +1 -1
  42. data/lib/new_relic/agent/configuration/high_security_source.rb +1 -1
  43. data/lib/new_relic/agent/configuration/manager.rb +5 -5
  44. data/lib/new_relic/agent/configuration/manual_source.rb +1 -1
  45. data/lib/new_relic/agent/configuration/mask_defaults.rb +3 -3
  46. data/lib/new_relic/agent/configuration/security_policy_source.rb +7 -4
  47. data/lib/new_relic/agent/configuration/server_source.rb +7 -7
  48. data/lib/new_relic/agent/configuration/yaml_source.rb +6 -4
  49. data/lib/new_relic/agent/configuration.rb +1 -1
  50. data/lib/new_relic/agent/connect/request_builder.rb +3 -3
  51. data/lib/new_relic/agent/connect/response_handler.rb +5 -5
  52. data/lib/new_relic/agent/custom_event_aggregator.rb +5 -5
  53. data/lib/new_relic/agent/database/explain_plan_helpers.rb +1 -1
  54. data/lib/new_relic/agent/database/obfuscation_helpers.rb +1 -1
  55. data/lib/new_relic/agent/database/obfuscator.rb +2 -2
  56. data/lib/new_relic/agent/database/postgres_explain_obfuscator.rb +1 -1
  57. data/lib/new_relic/agent/database.rb +21 -21
  58. data/lib/new_relic/agent/database_adapter.rb +1 -1
  59. data/lib/new_relic/agent/datastores/metric_helper.rb +12 -13
  60. data/lib/new_relic/agent/datastores/mongo/event_formatter.rb +4 -3
  61. data/lib/new_relic/agent/datastores/mongo/metric_translator.rb +2 -4
  62. data/lib/new_relic/agent/datastores/mongo/obfuscator.rb +2 -2
  63. data/lib/new_relic/agent/datastores/mongo.rb +1 -1
  64. data/lib/new_relic/agent/datastores/redis.rb +3 -3
  65. data/lib/new_relic/agent/datastores.rb +4 -4
  66. data/lib/new_relic/agent/deprecator.rb +1 -1
  67. data/lib/new_relic/agent/distributed_tracing/cross_app_payload.rb +1 -1
  68. data/lib/new_relic/agent/distributed_tracing/cross_app_tracing.rb +16 -17
  69. data/lib/new_relic/agent/distributed_tracing/distributed_trace_attributes.rb +9 -10
  70. data/lib/new_relic/agent/distributed_tracing/distributed_trace_metrics.rb +18 -19
  71. data/lib/new_relic/agent/distributed_tracing/distributed_trace_payload.rb +8 -10
  72. data/lib/new_relic/agent/distributed_tracing/distributed_trace_transport_type.rb +2 -3
  73. data/lib/new_relic/agent/distributed_tracing/trace_context.rb +40 -40
  74. data/lib/new_relic/agent/distributed_tracing/trace_context_payload.rb +16 -15
  75. data/lib/new_relic/agent/distributed_tracing.rb +17 -18
  76. data/lib/new_relic/agent/encoding_normalizer.rb +1 -1
  77. data/lib/new_relic/agent/error_collector.rb +6 -5
  78. data/lib/new_relic/agent/error_event_aggregator.rb +3 -4
  79. data/lib/new_relic/agent/error_filter.rb +5 -5
  80. data/lib/new_relic/agent/error_trace_aggregator.rb +3 -3
  81. data/lib/new_relic/agent/event_aggregator.rb +20 -20
  82. data/lib/new_relic/agent/event_buffer.rb +1 -1
  83. data/lib/new_relic/agent/event_listener.rb +1 -1
  84. data/lib/new_relic/agent/event_loop.rb +9 -9
  85. data/lib/new_relic/agent/external.rb +10 -10
  86. data/lib/new_relic/agent/guid_generator.rb +2 -2
  87. data/lib/new_relic/agent/harvester.rb +1 -1
  88. data/lib/new_relic/agent/heap.rb +5 -5
  89. data/lib/new_relic/agent/hostname.rb +4 -3
  90. data/lib/new_relic/agent/http_clients/abstract.rb +1 -2
  91. data/lib/new_relic/agent/http_clients/curb_wrappers.rb +5 -6
  92. data/lib/new_relic/agent/http_clients/excon_wrappers.rb +4 -5
  93. data/lib/new_relic/agent/http_clients/http_rb_wrappers.rb +2 -3
  94. data/lib/new_relic/agent/http_clients/httpclient_wrappers.rb +1 -2
  95. data/lib/new_relic/agent/http_clients/net_http_wrappers.rb +0 -1
  96. data/lib/new_relic/agent/http_clients/typhoeus_wrappers.rb +1 -2
  97. data/lib/new_relic/agent/http_clients/uri_util.rb +1 -2
  98. data/lib/new_relic/agent/instrumentation/action_cable_subscriber.rb +6 -5
  99. data/lib/new_relic/agent/instrumentation/action_controller_subscriber.rb +31 -23
  100. data/lib/new_relic/agent/instrumentation/action_view_subscriber.rb +7 -6
  101. data/lib/new_relic/agent/instrumentation/active_job.rb +11 -4
  102. data/lib/new_relic/agent/instrumentation/active_merchant.rb +4 -3
  103. data/lib/new_relic/agent/instrumentation/active_record.rb +9 -9
  104. data/lib/new_relic/agent/instrumentation/active_record_helper.rb +37 -21
  105. data/lib/new_relic/agent/instrumentation/active_record_notifications.rb +3 -3
  106. data/lib/new_relic/agent/instrumentation/active_record_prepend.rb +1 -1
  107. data/lib/new_relic/agent/instrumentation/active_record_subscriber.rb +21 -11
  108. data/lib/new_relic/agent/instrumentation/active_storage.rb +2 -2
  109. data/lib/new_relic/agent/instrumentation/active_storage_subscriber.rb +16 -15
  110. data/lib/new_relic/agent/instrumentation/active_support_logger/chain.rb +1 -1
  111. data/lib/new_relic/agent/instrumentation/active_support_logger/instrumentation.rb +1 -1
  112. data/lib/new_relic/agent/instrumentation/active_support_logger/prepend.rb +1 -1
  113. data/lib/new_relic/agent/instrumentation/active_support_logger.rb +2 -2
  114. data/lib/new_relic/agent/instrumentation/acts_as_solr.rb +2 -2
  115. data/lib/new_relic/agent/instrumentation/authlogic.rb +2 -2
  116. data/lib/new_relic/agent/instrumentation/bunny/chain.rb +10 -10
  117. data/lib/new_relic/agent/instrumentation/bunny/instrumentation.rb +10 -11
  118. data/lib/new_relic/agent/instrumentation/bunny/prepend.rb +4 -4
  119. data/lib/new_relic/agent/instrumentation/bunny.rb +1 -2
  120. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +25 -17
  121. data/lib/new_relic/agent/instrumentation/curb/chain.rb +21 -22
  122. data/lib/new_relic/agent/instrumentation/curb/instrumentation.rb +19 -16
  123. data/lib/new_relic/agent/instrumentation/curb/prepend.rb +2 -3
  124. data/lib/new_relic/agent/instrumentation/curb.rb +2 -2
  125. data/lib/new_relic/agent/instrumentation/data_mapper.rb +44 -44
  126. data/lib/new_relic/agent/instrumentation/delayed_job/chain.rb +1 -2
  127. data/lib/new_relic/agent/instrumentation/delayed_job/instrumentation.rb +2 -3
  128. data/lib/new_relic/agent/instrumentation/delayed_job/prepend.rb +1 -2
  129. data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +3 -3
  130. data/lib/new_relic/agent/instrumentation/excon/middleware.rb +3 -3
  131. data/lib/new_relic/agent/instrumentation/excon.rb +2 -2
  132. data/lib/new_relic/agent/instrumentation/grape/chain.rb +6 -6
  133. data/lib/new_relic/agent/instrumentation/grape/instrumentation.rb +5 -5
  134. data/lib/new_relic/agent/instrumentation/grape/prepend.rb +4 -4
  135. data/lib/new_relic/agent/instrumentation/grape.rb +1 -1
  136. data/lib/new_relic/agent/instrumentation/grpc/client/chain.rb +97 -0
  137. data/lib/new_relic/agent/instrumentation/grpc/client/instrumentation.rb +89 -0
  138. data/lib/new_relic/agent/instrumentation/grpc/client/prepend.rb +111 -0
  139. data/lib/new_relic/agent/instrumentation/grpc/client/request_wrapper.rb +30 -0
  140. data/lib/new_relic/agent/instrumentation/grpc/helper.rb +32 -0
  141. data/lib/new_relic/agent/instrumentation/grpc/server/chain.rb +69 -0
  142. data/lib/new_relic/agent/instrumentation/grpc/server/instrumentation.rb +134 -0
  143. data/lib/new_relic/agent/instrumentation/grpc/server/rpc_desc_prepend.rb +35 -0
  144. data/lib/new_relic/agent/instrumentation/grpc/server/rpc_server_prepend.rb +26 -0
  145. data/lib/new_relic/agent/instrumentation/grpc_client.rb +23 -0
  146. data/lib/new_relic/agent/instrumentation/grpc_server.rb +25 -0
  147. data/lib/new_relic/agent/instrumentation/httpclient/chain.rb +1 -1
  148. data/lib/new_relic/agent/instrumentation/httpclient/instrumentation.rb +6 -6
  149. data/lib/new_relic/agent/instrumentation/httpclient/prepend.rb +1 -1
  150. data/lib/new_relic/agent/instrumentation/httpclient.rb +2 -2
  151. data/lib/new_relic/agent/instrumentation/httprb/chain.rb +1 -1
  152. data/lib/new_relic/agent/instrumentation/httprb/instrumentation.rb +4 -4
  153. data/lib/new_relic/agent/instrumentation/httprb/prepend.rb +1 -1
  154. data/lib/new_relic/agent/instrumentation/httprb.rb +2 -2
  155. data/lib/new_relic/agent/instrumentation/ignore_actions.rb +2 -2
  156. data/lib/new_relic/agent/instrumentation/logger/chain.rb +2 -2
  157. data/lib/new_relic/agent/instrumentation/logger/instrumentation.rb +5 -1
  158. data/lib/new_relic/agent/instrumentation/logger/prepend.rb +1 -1
  159. data/lib/new_relic/agent/instrumentation/logger.rb +2 -2
  160. data/lib/new_relic/agent/instrumentation/memcache/chain.rb +2 -3
  161. data/lib/new_relic/agent/instrumentation/memcache/dalli.rb +24 -17
  162. data/lib/new_relic/agent/instrumentation/memcache/helper.rb +8 -9
  163. data/lib/new_relic/agent/instrumentation/memcache/instrumentation.rb +17 -15
  164. data/lib/new_relic/agent/instrumentation/memcache/prepend.rb +21 -15
  165. data/lib/new_relic/agent/instrumentation/memcache.rb +5 -6
  166. data/lib/new_relic/agent/instrumentation/middleware_proxy.rb +2 -2
  167. data/lib/new_relic/agent/instrumentation/middleware_tracing.rb +0 -1
  168. data/lib/new_relic/agent/instrumentation/mongo.rb +2 -2
  169. data/lib/new_relic/agent/instrumentation/mongodb_command_subscriber.rb +15 -14
  170. data/lib/new_relic/agent/instrumentation/net_http/chain.rb +1 -1
  171. data/lib/new_relic/agent/instrumentation/net_http/instrumentation.rb +5 -5
  172. data/lib/new_relic/agent/instrumentation/net_http/prepend.rb +1 -1
  173. data/lib/new_relic/agent/instrumentation/net_http.rb +2 -2
  174. data/lib/new_relic/agent/instrumentation/notifications_subscriber.rb +6 -6
  175. data/lib/new_relic/agent/instrumentation/padrino/chain.rb +1 -1
  176. data/lib/new_relic/agent/instrumentation/padrino/instrumentation.rb +1 -1
  177. data/lib/new_relic/agent/instrumentation/padrino/prepend.rb +1 -1
  178. data/lib/new_relic/agent/instrumentation/padrino.rb +2 -2
  179. data/lib/new_relic/agent/instrumentation/passenger_instrumentation.rb +3 -3
  180. data/lib/new_relic/agent/instrumentation/queue_time.rb +1 -2
  181. data/lib/new_relic/agent/instrumentation/rack/chain.rb +12 -12
  182. data/lib/new_relic/agent/instrumentation/rack/helpers.rb +1 -1
  183. data/lib/new_relic/agent/instrumentation/rack/instrumentation.rb +7 -7
  184. data/lib/new_relic/agent/instrumentation/rack/prepend.rb +4 -4
  185. data/lib/new_relic/agent/instrumentation/rack.rb +1 -1
  186. data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +6 -6
  187. data/lib/new_relic/agent/instrumentation/rails_middleware.rb +1 -1
  188. data/lib/new_relic/agent/instrumentation/rails_notifications/action_cable.rb +3 -2
  189. data/lib/new_relic/agent/instrumentation/rails_notifications/action_controller.rb +3 -2
  190. data/lib/new_relic/agent/instrumentation/rails_notifications/action_view.rb +3 -2
  191. data/lib/new_relic/agent/instrumentation/rainbows_instrumentation.rb +3 -3
  192. data/lib/new_relic/agent/instrumentation/rake/chain.rb +2 -2
  193. data/lib/new_relic/agent/instrumentation/rake/instrumentation.rb +6 -2
  194. data/lib/new_relic/agent/instrumentation/rake/prepend.rb +1 -1
  195. data/lib/new_relic/agent/instrumentation/rake.rb +3 -3
  196. data/lib/new_relic/agent/instrumentation/redis/chain.rb +3 -4
  197. data/lib/new_relic/agent/instrumentation/redis/instrumentation.rb +5 -6
  198. data/lib/new_relic/agent/instrumentation/redis/prepend.rb +3 -4
  199. data/lib/new_relic/agent/instrumentation/redis.rb +2 -2
  200. data/lib/new_relic/agent/instrumentation/resque/chain.rb +2 -2
  201. data/lib/new_relic/agent/instrumentation/resque/helper.rb +1 -1
  202. data/lib/new_relic/agent/instrumentation/resque/instrumentation.rb +0 -1
  203. data/lib/new_relic/agent/instrumentation/resque/prepend.rb +1 -1
  204. data/lib/new_relic/agent/instrumentation/resque.rb +3 -3
  205. data/lib/new_relic/agent/instrumentation/sequel.rb +8 -8
  206. data/lib/new_relic/agent/instrumentation/sequel_helper.rb +1 -1
  207. data/lib/new_relic/agent/instrumentation/sidekiq.rb +6 -5
  208. data/lib/new_relic/agent/instrumentation/sinatra/chain.rb +1 -1
  209. data/lib/new_relic/agent/instrumentation/sinatra/ignorer.rb +2 -2
  210. data/lib/new_relic/agent/instrumentation/sinatra/instrumentation.rb +1 -1
  211. data/lib/new_relic/agent/instrumentation/sinatra/prepend.rb +1 -1
  212. data/lib/new_relic/agent/instrumentation/sinatra/transaction_namer.rb +2 -2
  213. data/lib/new_relic/agent/instrumentation/sinatra.rb +2 -2
  214. data/lib/new_relic/agent/instrumentation/sunspot.rb +4 -4
  215. data/lib/new_relic/agent/instrumentation/thread/chain.rb +2 -2
  216. data/lib/new_relic/agent/instrumentation/thread/instrumentation.rb +1 -1
  217. data/lib/new_relic/agent/instrumentation/thread/prepend.rb +1 -1
  218. data/lib/new_relic/agent/instrumentation/thread.rb +2 -2
  219. data/lib/new_relic/agent/instrumentation/tilt/chain.rb +1 -1
  220. data/lib/new_relic/agent/instrumentation/tilt/instrumentation.rb +1 -1
  221. data/lib/new_relic/agent/instrumentation/tilt/prepend.rb +1 -1
  222. data/lib/new_relic/agent/instrumentation/tilt.rb +1 -1
  223. data/lib/new_relic/agent/instrumentation/typhoeus/chain.rb +1 -1
  224. data/lib/new_relic/agent/instrumentation/typhoeus/instrumentation.rb +8 -8
  225. data/lib/new_relic/agent/instrumentation/typhoeus/prepend.rb +1 -1
  226. data/lib/new_relic/agent/instrumentation/typhoeus.rb +2 -2
  227. data/lib/new_relic/agent/instrumentation.rb +1 -1
  228. data/lib/new_relic/agent/internal_agent_error.rb +1 -1
  229. data/lib/new_relic/agent/javascript_instrumentor.rb +8 -8
  230. data/lib/new_relic/agent/linking_metadata.rb +2 -3
  231. data/lib/new_relic/agent/local_log_decorator.rb +0 -1
  232. data/lib/new_relic/agent/log_event_aggregator.rb +7 -7
  233. data/lib/new_relic/agent/log_once.rb +1 -1
  234. data/lib/new_relic/agent/log_priority.rb +1 -1
  235. data/lib/new_relic/agent/logging.rb +13 -13
  236. data/lib/new_relic/agent/memory_logger.rb +1 -1
  237. data/lib/new_relic/agent/messaging.rb +19 -20
  238. data/lib/new_relic/agent/method_tracer.rb +15 -10
  239. data/lib/new_relic/agent/method_tracer_helpers.rb +83 -1
  240. data/lib/new_relic/agent/monitors/cross_app_monitor.rb +4 -4
  241. data/lib/new_relic/agent/monitors/distributed_tracing_monitor.rb +3 -3
  242. data/lib/new_relic/agent/monitors/inbound_request_monitor.rb +1 -1
  243. data/lib/new_relic/agent/monitors/synthetics_monitor.rb +2 -2
  244. data/lib/new_relic/agent/monitors.rb +5 -5
  245. data/lib/new_relic/agent/new_relic_service/encoders.rb +2 -2
  246. data/lib/new_relic/agent/new_relic_service/json_marshaller.rb +4 -4
  247. data/lib/new_relic/agent/new_relic_service/marshaller.rb +1 -1
  248. data/lib/new_relic/agent/new_relic_service/security_policy_settings.rb +1 -1
  249. data/lib/new_relic/agent/new_relic_service.rb +214 -166
  250. data/lib/new_relic/agent/{noticible_error.rb → noticeable_error.rb} +2 -3
  251. data/lib/new_relic/agent/null_logger.rb +1 -1
  252. data/lib/new_relic/agent/obfuscator.rb +3 -3
  253. data/lib/new_relic/agent/parameter_filtering.rb +1 -1
  254. data/lib/new_relic/agent/payload_metric_mapping.rb +1 -1
  255. data/lib/new_relic/agent/pipe_channel_manager.rb +10 -5
  256. data/lib/new_relic/agent/pipe_service.rb +2 -2
  257. data/lib/new_relic/agent/prepend_supportability.rb +2 -2
  258. data/lib/new_relic/agent/priority_sampled_buffer.rb +4 -4
  259. data/lib/new_relic/agent/range_extensions.rb +8 -28
  260. data/lib/new_relic/agent/rules_engine/replacement_rule.rb +2 -2
  261. data/lib/new_relic/agent/rules_engine/segment_terms_rule.rb +1 -1
  262. data/lib/new_relic/agent/rules_engine.rb +2 -2
  263. data/lib/new_relic/agent/sampler.rb +1 -1
  264. data/lib/new_relic/agent/sampler_collection.rb +1 -1
  265. data/lib/new_relic/agent/samplers/cpu_sampler.rb +1 -1
  266. data/lib/new_relic/agent/samplers/delayed_job_sampler.rb +2 -2
  267. data/lib/new_relic/agent/samplers/memory_sampler.rb +10 -10
  268. data/lib/new_relic/agent/samplers/object_sampler.rb +1 -1
  269. data/lib/new_relic/agent/samplers/vm_sampler.rb +3 -1
  270. data/lib/new_relic/agent/span_event_aggregator.rb +2 -2
  271. data/lib/new_relic/agent/span_event_primitive.rb +24 -19
  272. data/lib/new_relic/agent/sql_sampler.rb +8 -8
  273. data/lib/new_relic/agent/stats.rb +15 -4
  274. data/lib/new_relic/agent/stats_engine/gc_profiler.rb +1 -2
  275. data/lib/new_relic/agent/stats_engine/stats_hash.rb +4 -4
  276. data/lib/new_relic/agent/stats_engine.rb +1 -1
  277. data/lib/new_relic/agent/synthetics_event_aggregator.rb +6 -6
  278. data/lib/new_relic/agent/system_info.rb +68 -53
  279. data/lib/new_relic/agent/threading/agent_thread.rb +13 -9
  280. data/lib/new_relic/agent/threading/backtrace_node.rb +6 -4
  281. data/lib/new_relic/agent/threading/backtrace_service.rb +1 -1
  282. data/lib/new_relic/agent/threading/thread_profile.rb +4 -4
  283. data/lib/new_relic/agent/timestamp_sampled_buffer.rb +1 -1
  284. data/lib/new_relic/agent/tracer.rb +19 -17
  285. data/lib/new_relic/agent/transaction/abstract_segment.rb +93 -34
  286. data/lib/new_relic/agent/transaction/datastore_segment.rb +12 -12
  287. data/lib/new_relic/agent/transaction/distributed_tracer.rb +52 -48
  288. data/lib/new_relic/agent/transaction/distributed_tracing.rb +21 -22
  289. data/lib/new_relic/agent/transaction/external_request_segment.rb +37 -29
  290. data/lib/new_relic/agent/transaction/message_broker_segment.rb +6 -6
  291. data/lib/new_relic/agent/transaction/request_attributes.rb +29 -29
  292. data/lib/new_relic/agent/transaction/segment.rb +8 -8
  293. data/lib/new_relic/agent/transaction/slowest_sample_buffer.rb +1 -1
  294. data/lib/new_relic/agent/transaction/synthetics_sample_buffer.rb +1 -1
  295. data/lib/new_relic/agent/transaction/trace.rb +3 -3
  296. data/lib/new_relic/agent/transaction/trace_builder.rb +10 -10
  297. data/lib/new_relic/agent/transaction/trace_context.rb +22 -20
  298. data/lib/new_relic/agent/transaction/trace_node.rb +9 -9
  299. data/lib/new_relic/agent/transaction/tracing.rb +7 -7
  300. data/lib/new_relic/agent/transaction/transaction_sample_buffer.rb +1 -2
  301. data/lib/new_relic/agent/transaction.rb +35 -31
  302. data/lib/new_relic/agent/transaction_error_primitive.rb +9 -9
  303. data/lib/new_relic/agent/transaction_event_aggregator.rb +5 -5
  304. data/lib/new_relic/agent/transaction_event_primitive.rb +3 -4
  305. data/lib/new_relic/agent/transaction_event_recorder.rb +15 -14
  306. data/lib/new_relic/agent/transaction_metrics.rb +4 -4
  307. data/lib/new_relic/agent/transaction_sampler.rb +5 -5
  308. data/lib/new_relic/agent/transaction_time_aggregator.rb +14 -14
  309. data/lib/new_relic/agent/utilization/aws.rb +4 -4
  310. data/lib/new_relic/agent/utilization/azure.rb +2 -2
  311. data/lib/new_relic/agent/utilization/gcp.rb +7 -7
  312. data/lib/new_relic/agent/utilization/pcf.rb +4 -4
  313. data/lib/new_relic/agent/utilization/vendor.rb +28 -28
  314. data/lib/new_relic/agent/utilization_data.rb +1 -1
  315. data/lib/new_relic/agent/vm/jruby_vm.rb +1 -1
  316. data/lib/new_relic/agent/vm/monotonic_gc_profiler.rb +1 -1
  317. data/lib/new_relic/agent/vm/mri_vm.rb +36 -23
  318. data/lib/new_relic/agent/vm/snapshot.rb +2 -2
  319. data/lib/new_relic/agent/vm.rb +1 -1
  320. data/lib/new_relic/agent/worker_loop.rb +2 -2
  321. data/lib/new_relic/agent.rb +27 -27
  322. data/lib/new_relic/cli/command.rb +6 -6
  323. data/lib/new_relic/cli/commands/deployments.rb +81 -29
  324. data/lib/new_relic/cli/commands/install.rb +6 -6
  325. data/lib/new_relic/coerce.rb +5 -6
  326. data/lib/new_relic/collection_helper.rb +4 -4
  327. data/lib/new_relic/constants.rb +0 -1
  328. data/lib/new_relic/control/class_methods.rb +1 -1
  329. data/lib/new_relic/control/frameworks/external.rb +1 -1
  330. data/lib/new_relic/control/frameworks/rails.rb +3 -3
  331. data/lib/new_relic/control/frameworks/rails3.rb +1 -1
  332. data/lib/new_relic/control/frameworks/rails4.rb +1 -1
  333. data/lib/new_relic/control/frameworks/rails_notifications.rb +1 -1
  334. data/lib/new_relic/control/frameworks/ruby.rb +1 -1
  335. data/lib/new_relic/control/frameworks/sinatra.rb +1 -1
  336. data/lib/new_relic/control/frameworks.rb +1 -1
  337. data/lib/new_relic/control/instance_methods.rb +20 -42
  338. data/lib/new_relic/control/instrumentation.rb +7 -7
  339. data/lib/new_relic/control/private_instance_methods.rb +48 -0
  340. data/lib/new_relic/control/server_methods.rb +2 -2
  341. data/lib/new_relic/control.rb +1 -1
  342. data/lib/new_relic/delayed_job_injection.rb +1 -1
  343. data/lib/new_relic/dependency_detection.rb +23 -22
  344. data/lib/new_relic/environment_report.rb +24 -14
  345. data/lib/new_relic/helper.rb +5 -5
  346. data/lib/new_relic/language_support.rb +8 -3
  347. data/lib/new_relic/latest_changes.rb +4 -4
  348. data/lib/new_relic/local_environment.rb +9 -11
  349. data/lib/new_relic/metric_data.rb +30 -24
  350. data/lib/new_relic/metric_spec.rb +3 -3
  351. data/lib/new_relic/noticed_error.rb +3 -6
  352. data/lib/new_relic/rack/agent_hooks.rb +1 -1
  353. data/lib/new_relic/rack/agent_middleware.rb +1 -1
  354. data/lib/new_relic/rack/browser_monitoring.rb +132 -123
  355. data/lib/new_relic/rack.rb +1 -1
  356. data/lib/new_relic/recipes/capistrano3.rb +3 -59
  357. data/lib/new_relic/recipes/capistrano_legacy.rb +13 -13
  358. data/lib/new_relic/recipes/helpers/send_deployment.rb +69 -0
  359. data/lib/new_relic/recipes.rb +1 -1
  360. data/lib/new_relic/supportability_helper.rb +6 -6
  361. data/lib/new_relic/traced_thread.rb +5 -7
  362. data/lib/new_relic/version.rb +2 -2
  363. data/lib/newrelic_rpm.rb +1 -1
  364. data/lib/sequel/extensions/newrelic_instrumentation.rb +8 -8
  365. data/lib/sequel/plugins/newrelic_instrumentation.rb +1 -1
  366. data/lib/tasks/all.rb +1 -1
  367. data/lib/tasks/config.rake +8 -112
  368. data/lib/tasks/coverage_report.rake +28 -0
  369. data/lib/tasks/{config.html.erb → helpers/config.html.erb} +0 -0
  370. data/lib/tasks/{config.text.erb → helpers/config.text.erb} +0 -0
  371. data/lib/tasks/helpers/format.rb +120 -0
  372. data/lib/tasks/helpers/matches.rb +12 -0
  373. data/lib/tasks/helpers/prompt.rb +24 -0
  374. data/lib/tasks/helpers/removers.rb +33 -0
  375. data/lib/tasks/install.rake +4 -0
  376. data/lib/tasks/instrumentation_generator/README.md +63 -0
  377. data/lib/tasks/instrumentation_generator/TODO.md +33 -0
  378. data/lib/tasks/instrumentation_generator/instrumentation.thor +102 -0
  379. data/lib/tasks/instrumentation_generator/templates/Envfile.tt +9 -0
  380. data/lib/tasks/instrumentation_generator/templates/chain.tt +21 -0
  381. data/lib/tasks/instrumentation_generator/templates/chain_method.tt +7 -0
  382. data/lib/tasks/instrumentation_generator/templates/dependency_detection.tt +29 -0
  383. data/lib/tasks/instrumentation_generator/templates/instrumentation.tt +12 -0
  384. data/lib/tasks/instrumentation_generator/templates/instrumentation_method.tt +3 -0
  385. data/lib/tasks/instrumentation_generator/templates/newrelic.yml.tt +19 -0
  386. data/lib/tasks/instrumentation_generator/templates/prepend.tt +13 -0
  387. data/lib/tasks/instrumentation_generator/templates/prepend_method.tt +3 -0
  388. data/lib/tasks/instrumentation_generator/templates/test.tt +15 -0
  389. data/lib/tasks/multiverse.rake +4 -0
  390. data/lib/tasks/multiverse.rb +5 -30
  391. data/lib/tasks/newrelic.rb +1 -1
  392. data/lib/tasks/tests.rake +7 -8
  393. data/newrelic.yml +514 -483
  394. data/newrelic_rpm.gemspec +16 -21
  395. data/recipes/newrelic.rb +1 -1
  396. data/test/agent_helper.rb +125 -147
  397. metadata +82 -90
  398. data/bin/mongrel_rpm +0 -32
data/CHANGELOG.md CHANGED
@@ -1,10 +1,168 @@
1
1
  # New Relic Ruby Agent Release Notes #
2
2
 
3
+ ## v8.11.0
4
+
5
+ Version 8.11.0 of the agent updates the `newrelic deployments` command to work with API keys issued to newer accounts, fixes a memory leak in the instrumentation of Curb error handling, further preps for Ruby 3.2.0 support, and includes several community member driven cleanup and improvement efforts. Thank you to everyone involved!
6
+
7
+
8
+ * **Added support for New Relic REST API v2 when using `newrelic deployments` command**
9
+
10
+ Previously, the `newrelic deployments` command only supported the older version of the deployments api, which does not currently support newer license keys. Now you can use the New Relic REST API v2 to record deployments by providing your user API key to the agent configuration using `api_key`. When this configuration option is present, the `newrelic deployments` command will automatically use the New Relic REST API v2 deployment endpoint. [PR#1461](https://github.com/newrelic/newrelic-ruby-agent/pull/1461)
11
+
12
+ Thank you to [@Arkham](https://github.com/Arkham) for bringing this to our attention!
13
+
14
+
15
+ * **Cleanup: Performance tests, constants, rubocop-minitest assertions and refutations**
16
+
17
+ Community member [@esquith](https://github.com/esquith) contributed a whole slew of cleanup successes for our performance test configuration, orphaned constants in our code base, and RuboCop related improvements. [PR#1406](https://github.com/newrelic/newrelic-ruby-agent/pull/1406) [PR#1408](https://github.com/newrelic/newrelic-ruby-agent/pull/1408) [PR#1409](https://github.com/newrelic/newrelic-ruby-agent/pull/1409) [PR#1411](https://github.com/newrelic/newrelic-ruby-agent/pull/1411)
18
+
19
+ Thank you [@esquith](https://github.com/esquith) for these great contributions!
20
+
21
+
22
+ * **CI: Notify on a change from failure to success**
23
+
24
+ A super handy, much beloved feature of certain CI and build systems is to not only notify when builds start to fail, but also to notify again when the builds once again start to go green. Community member [@luigieai](https://github.com/luigieai) was able to figure out how to configure our existing complex, multiple-3rd-party-action based GitHub Actions pipeline to notify on a switch back to success from failure. [PR#1519](https://github.com/newrelic/newrelic-ruby-agent/pull/1519)
25
+
26
+ This is much appreciated! Thank you, [@luigieai](https://github.com/luigieai).
27
+
28
+
29
+ * **Spelling corrections**
30
+
31
+ Community member [@jsoref](https://github.com/jsoref), author of the [Check Spelling](https://github.com/marketplace/actions/check-spelling) GitHub Action, contributed a significant number of spelling corrections throughout the code base. The intelligent issues that were flagged made for a more comprehensive review than a simple dictionary based check would have been able to provide, and the changes are much appreciated. [PR#1508](https://github.com/newrelic/newrelic-ruby-agent/pull/1508)
32
+
33
+ Thank you very much, [@jsoref](https://github.com/jsoref)!
34
+
35
+
36
+ * **Ruby 3.2.0-preview2 compatibility**
37
+
38
+ Ruby 3.2.0-preview1 introduced a change to the way that Ruby reports VM stats and the approach was changed yet again to a 3rd approach with the preview2 release. New Relic reports on Ruby VM stats and is keeping track of the Ruby 3.2 development process to help ensure our customers with a smooth and worthwhile upgrade process once Ruby 3.2.0 (non-preview) is released. [PR#1436](https://github.com/newrelic/newrelic-ruby-agent/pull/1436)
39
+
40
+
41
+ * **Bugfix: Fix memory leak in the Curb instrumentation**
42
+
43
+ Community member [@charkost](https://github.com/charkost) was able to rework the `on_failure` callback logic prepped via the agent's Curb instrumentation in order to avoid some nesting that was causing memory leaks. [PR#1518](https://github.com/newrelic/newrelic-ruby-agent/pull/1518)
44
+
45
+ Many thanks for both the heads up on the issue and the fix, [@charkost](https://github.com/charkost)!
46
+
47
+
48
+ ## v8.10.1
49
+
50
+
51
+ * **Bugfix: Missing unscoped metrics when instrumentation.thread.tracing is enabled**
52
+
53
+ Previously, when `instrumentation.thread.tracing` was set to true, some puma applications encountered a bug where a varying number of unscoped metrics would be missing. The agent now will correctly store and send all unscoped metrics.
54
+
55
+ Thank you to @texpert for providing details of their situation to help resolve the issue.
56
+
57
+
58
+ * **Bugfix: gRPC instrumentation causes ArgumentError when other Google gems are present**
59
+
60
+ Previously, when the agent had gRPC instrumentation enabled in an application using other gems (such as google-ads-googleads), the instrumentation could cause the error `ArgumentError: wrong number of arguments (given 3, expected 2)`. The gRPC instrumentation has been updated to prevent this issue from occurring in the future.
61
+
62
+ Thank you to @FeminismIsAwesome for bringing this issue to our attention.
63
+
64
+
65
+ ## v8.10.0
66
+
67
+
68
+ * **New gRPC instrumentation**
69
+
70
+ The agent will now instrument [gRPC](https://grpc.io/) activity performed by clients and servers that use the [grpc](https://rubygems.org/gems/grpc) RubyGem. Instrumentation is automatic and enabled by default, so gRPC users should not need to modify any existing application code or agent configuration to benefit from the instrumentation. The instrumentation makes use of distributed tracing for a comprehensive overview of all gRPC traffic taking place across multiple monitored applications. This allows you to observe your client and server activity using any service that adheres to the W3C standard.
71
+
72
+ The following new configuration parameters have been added for gRPC. All are optional.
73
+
74
+ | Configuration name | Default | Behavior |
75
+ | ----------- | ----------- |----------- |
76
+ | `instrumentation.grpc_client` | auto | Set to 'disabled' to disable, set to 'chain' if there are module prepending conflicts |
77
+ | `instrumentation.grpc_server` | auto | Set to 'disabled' to disable, set to 'chain' if there are module prepending conflicts |
78
+ | `instrumentation.grpc.host_denylist` | "" | Provide a comma delimited list of host regex patterns (ex: "private.com$,exception.*") |
79
+
80
+
81
+ * **Code-level metrics functionality is enabled by default**
82
+
83
+ The code-level metrics functionality for the Ruby agent's [CodeStream integration](https://docs.newrelic.com/docs/apm/agents/ruby-agent/features/ruby-codestream-integration) is now enabled by default after we have received positive feedback and no open bugs for the past two releases.
84
+
85
+
86
+ * **Performance: Rework timing range overlap calculations for multiple transaction segments**
87
+
88
+ Many thanks to GitHub community members @bmulholland and @hkdnet. @bmulholland alerted us to [rmosolgo/graphql-ruby#3945](https://github.com/rmosolgo/graphql-ruby/issues/3945). That Issue essentially notes that the New Relic Ruby agent incurs a significant performance hit when the `graphql` RubyGem (which ships with New Relic Ruby agent support) is used with DataLoader to generate a high number of transactions. Then @hkdnet diagnosed the root cause in the Ruby agent and put together both a proof of concept fix and a full blown PR to resolve the problem. The agent keeps track multiple segments that are concurrently in play for a given transaction in order to merge the ones whose start and stop times intersect. The logic for doing this find-and-merge operation has been reworked to a) be deferred entirely until the transaction is ready to be recorded, and b) made more performant when it is needed. GraphQL DataLoader users and other users who generate lots of activity for monitoring within a short amount of time will hopefully see some good performance gains from these changes.
89
+
90
+
91
+ * **Performance: Make frozen string literals the default for the agent**
92
+
93
+ The Ruby `frozen_string_literal: true` magic source code comment has now been applied consistently across all Ruby files belonging to the agent. This can provide a performance boost, given that Ruby can rely on the strings remaining immutable. Previously only about a third of the agent's code was freezing string literals by default. Now that 100% of the code freezes string literals by default, we have internally observed some related performance gains through testing. We are hopeful that these will translate into some real world gains in production capacities.
94
+
95
+
96
+ * **Bugfix: Error when setting the yaml configuration with `transaction_tracer.transaction_threshold: apdex_f`**
97
+
98
+ Originally, the agent was only checking the `transaction_tracer.transaction_threshold` from the newrelic.yml correctly if it was on two lines.
99
+
100
+ Example:
101
+
102
+ ```
103
+ # newrelic.yml
104
+ transaction_tracer:
105
+ transaction_threshold: apdex_f
106
+ ```
107
+
108
+ When this was instead changed to be on one line, the agent was not able to correctly identify the value of apdex_f.
109
+
110
+ Example:
111
+ ```
112
+ # newrelic.yml
113
+ transaction_tracer.transaction_threshold: apdex_f
114
+ ```
115
+ This would cause prevent transactions from finishing due to the error `ArgumentError: comparison of Float with String failed`. This has now been corrected and the agent is able to process newrelic.yml with a one line `transaction_tracer.transaction_threshold: apdex_f` correctly now.
116
+
117
+ Thank you to @oboxodo for bringing this to our attention.
118
+
119
+
120
+ * **Bugfix: Don't modify frozen Logger**
121
+
122
+ Previously the agent would modify each instance of the Logger class by adding a unique instance variable as part of the instrumentation. This could cause the error `FrozenError: can't modify frozen Logger` to be thrown if the Logger instance had been frozen. The agent will now check if the object is frozen before attempting to modify the object. Thanks to @mkcosta for bringing this issue to our attention.
123
+
124
+
125
+ ## v8.9.0
126
+
127
+
128
+ * **Add support for Dalli 3.1.0 to Dalli 3.2.2**
129
+
130
+ Dalli versions 3.1.0 and above include breaking changes where the agent previously hooked into the gem. We have updated our instrumentation to correctly hook into Dalli 3.1.0 and above. At this time, 3.2.2 is the latest Dalli version and is confirmed to be supported.
131
+
132
+
133
+ * **Bugfix: Infinite Tracing hung on connection restart**
134
+
135
+ Previously, when using infinite tracing, the agent would intermittently encounter a deadlock when attempting to restart the infinite tracing connection. This bug would prevent the agent from sending all data types, including non-infinite-tracing-related data. This change reworks how we restart infinite tracing to prevent potential deadlocks.
136
+
137
+ * **Bugfix: Use read_nonblock instead of read on pipe**
138
+
139
+ Previously, our PipeChannelManager was using read which could cause Resque jobs to get stuck in some versions. This change updates the PipeChannelManager to use read_nonblock instead. This method can leverage error handling to allow the instrumentation to gracefully log a message and exit the stuck Resque job.
140
+
141
+
142
+ ## v8.8.0
143
+
144
+ * **Support Makara database adapters with ActiveRecord**
145
+
146
+ Thanks to a community submission from @lucasklaassen with [PR #1177](https://github.com/newrelic/newrelic-ruby-agent/pull/1177), the Ruby agent will now correctly work well with the [Makara gem](https://github.com/instacart/makara). Functionality such as SQL obfuscation should now work when Makara database adapters are used with Active Record.
147
+
148
+ * **Lowered the minimum payload size to compress**
149
+
150
+ Previously the Ruby agent used a particularly large payload size threshold of 64KiB that would need to be met before the agent would compress data en route to New Relic's collector. The original value stems from segfault issues that very old Rubies (< 2.2) used to encounter when compressing smaller payloads. This value has been lowered to 2KiB (2048 bytes), which should provide a more optimal balance between the CPU cycles spent on compression and the bandwidth savings gained from it.
151
+
152
+ * **Provide Code Level Metrics for New Relic CodeStream**
153
+
154
+ For Ruby on Rails applications and/or those with manually traced methods, the agent is now capable of reporting metrics with Ruby method-level granularity. When the new `code_level_metrics.enabled` configuration parameter is set to a `true` value, the agent will associate source-code-related metadata with the metrics for things such as Rails controller methods. Then, when the corresponding Ruby class file that defines the methods is loaded up in a [New Relic CodeStream](https://www.codestream.com/)-powered IDE, [the four golden signals](https://sre.google/sre-book/monitoring-distributed-systems/) for each method will be presented to the developer directly.
155
+
156
+ * **Supportability Metrics will always report uncompressed payload size**
157
+
158
+ New Relic's agent specifications call for Supportability Metrics to always reference the uncompressed payload byte size. Previously, the Ruby agent was calculating the byte size after compression. Furthermore, compression is only performed on payloads of a certain size. This means that sometimes the value could have represented a compressed size and sometimes an uncompressed one. Now the uncompressed value is always used, bringing consistency for comparing two instances of the same metric and alignment with the New Relic agent specifications.
159
+
160
+
3
161
  ## v8.7.0
4
162
 
5
163
  * **APM logs-in-context log forwarding on by default**
6
164
 
7
- Automatic application log forwarding is now enabled by default. This version of the agent will automatically send enriched application logs to New Relic. To learn more about about this feature see [here](https://docs.newrelic.com/docs/apm/new-relic-apm/getting-started/get-started-logs-context/), and additional configuration options are available [here](https://docs.newrelic.com/docs/logs/logs-context/configure-logs-context-ruby). To learn about how to toggle log ingestion on or off by account see [here](https://docs.newrelic.com/docs/logs/logs-context/disable-automatic-logging).
165
+ Automatic application log forwarding is now enabled by default. This version of the agent will automatically send enriched application logs to New Relic. To learn more about this feature see [here](https://docs.newrelic.com/docs/apm/new-relic-apm/getting-started/get-started-logs-context/), and additional configuration options are available [here](https://docs.newrelic.com/docs/logs/logs-context/configure-logs-context-ruby). To learn about how to toggle log ingestion on or off by account see [here](https://docs.newrelic.com/docs/logs/logs-context/disable-automatic-logging).
8
166
 
9
167
  * **Improved async support and Thread instrumentation**
10
168
 
@@ -13,7 +171,7 @@
13
171
  New configuration options included in this release:
14
172
  | Configuration name | Default | Behavior |
15
173
  | ----------- | ----------- |----------- |
16
- | `instrumentation.thread` | `auto` (enabled) | Allows the agent to correctly nest spans inside of an asyncronous transaction |
174
+ | `instrumentation.thread` | `auto` (enabled) | Allows the agent to correctly nest spans inside of an asynchronous transaction |
17
175
  | `instrumentation.thread.tracing` | `false` (disabled) | Automatically add tracing to all Threads created in the application. This may be enabled by default in a future release. |
18
176
 
19
177
  We'd like to thank @mikeantonelli for sharing a gist with us that provided our team with an entry point for this feature.
@@ -102,7 +260,7 @@
102
260
 
103
261
  Previously, unit tests would fail with unexpected invocation errors when `NEW_RELIC_LICENSE_KEY` and `NEW_RELIC_HOST` environment variables were present. Now, tests will discard these environment variables before running.
104
262
 
105
- * **Bugfix: Curb - satify method_with_tracing's verb argument requirement**
263
+ * **Bugfix: Curb - satisfy method_with_tracing's verb argument requirement**
106
264
 
107
265
  When Curb instrumentation is used (either via prepend or chain), be sure to always pass the verb argument over to `method_with_tracing` which requires it. Thank you to @knarewski for bringing this issue to our attention, for providing a means of reproducing an error, and for providing a fix. That fix has been replicated by the agent team with permission. See [Issue 1033](https://github.com/newrelic/newrelic-ruby-agent/issues/1033) for more details.
108
266
 
@@ -284,7 +442,7 @@
284
442
 
285
443
  * **Update configuration option default value for `span_events.max_samples_stored` from 1000 to 2000**
286
444
 
287
- For more information about this congfiguration option, visit [the Ruby agent documentation](https://docs.newrelic.com/docs/agents/ruby-agent/configuration/ruby-agent-configuration/#span_events-max_samples_stored).
445
+ For more information about this configuration option, visit [the Ruby agent documentation](https://docs.newrelic.com/docs/agents/ruby-agent/configuration/ruby-agent-configuration/#span_events-max_samples_stored).
288
446
 
289
447
  * **Agent now enforces server supplied maximum value for configuration option `span_events.max_samples_stored`**
290
448
 
@@ -358,7 +516,7 @@
358
516
 
359
517
  * **Bugfix: resolves "can't add a new key into hash during iteration" Errors**
360
518
 
361
- Thanks to @wyhaines for this fix that prevents "can't add a new key into hash during iteration" errors from occuring when iterating over environment data.
519
+ Thanks to @wyhaines for this fix that prevents "can't add a new key into hash during iteration" errors from occurring when iterating over environment data.
362
520
 
363
521
  * **Bugfix: kwarg support fixed for Rack middleware instrumentation**
364
522
 
@@ -415,7 +573,7 @@
415
573
 
416
574
  * **Ruby Agent 6.x to 7.x Migration Guide Available**
417
575
 
418
- Please see our [Ruby Agent 6.x to 7.x migration guide](https://docs.newrelic.com/docs/agents/ruby-agent/getting-started/migration-7x-guide/) for helpful strategies and tips for migrating from earlier versions of the Ruby agent to 7.0.0. We cover new configuration settings, diagnosiing and installing SSL CA certificates and deprecated items and their replacements in this guide.
576
+ Please see our [Ruby Agent 6.x to 7.x migration guide](https://docs.newrelic.com/docs/agents/ruby-agent/getting-started/migration-7x-guide/) for helpful strategies and tips for migrating from earlier versions of the Ruby agent to 7.0.0. We cover new configuration settings, diagnosing and installing SSL CA certificates and deprecated items and their replacements in this guide.
419
577
 
420
578
  * **Ruby 2.0 and 2.1 Dropped**
421
579
 
@@ -534,7 +692,7 @@
534
692
  * **Default prepend_net_instrumentation to false**
535
693
 
536
694
  Previously, `prepend_net_instrumentation` defaulted to true. However, many gems are still using monkey patching on Net::HTTP, which causes compatibility issues with using prepend. Defaulting this to false minimizes instances of
537
- unexpected compatibilty issues.
695
+ unexpected compatibility issues.
538
696
 
539
697
  ## v6.14.0
540
698
 
@@ -544,14 +702,14 @@
544
702
 
545
703
  * **Bugfix: Delayed Job instrumentation fixed for Ruby 2.7+**
546
704
 
547
- Previously, the agent was erroneousy separating positional and keyword arguments on the instrumented method calls into
705
+ Previously, the agent was erroneously separating positional and keyword arguments on the instrumented method calls into
548
706
  Delayed Job's library. The led to Delayed job not auto-instrumenting correctly and has been fixed.
549
707
 
550
708
  * **Bugfix: Ruby 2.7+ methods sometimes erroneously attributed compiler warnings to the Agent's `add_method_tracer`**
551
709
 
552
710
  The specific edge cases presented are now fixed by this release of the agent. There are still some known corner-cases
553
711
  that will be resolved with upcoming changes in next major release of the Agent. If you encounter a problem with adding
554
- method tracers and compiler warnings raised, please continue to submit small repoducible examples.
712
+ method tracers and compiler warnings raised, please continue to submit small reproducible examples.
555
713
 
556
714
  * **Bugfix: Ruby 2.7+ fix for keyword arguments on Rack apps is unnecessary and removed**
557
715
 
@@ -568,14 +726,14 @@
568
726
 
569
727
  Previously, when a user specifies a `newrelic.yml.erb` and no `newrelic.yml` file, the agent fails to find
570
728
  the `.erb` file because it was not in the list of files searched at startup. The Ruby agent has long supported this as a
571
- means of configuring the agent programatically. The `newrelic.yml.erb` filename is restored to the search
729
+ means of configuring the agent programmatically. The `newrelic.yml.erb` filename is restored to the search
572
730
  path and will be utilized if present. NOTE: `newrelic.yml` still takes precedence over `newrelic.yml.erb` If found,
573
731
  the `.yml` file is used instead of the `.erb` file. Search directories and order of traversal remain unchanged.
574
732
 
575
733
  * **Bugfix: dependency detection of Redis now works without raising an exception**
576
734
 
577
735
  Previously, when detecting if Redis was available to instrument, the dependency detection would fail with an Exception raised
578
- (with side effect of not attempting to instrument Redis). This is now fixed with a better dependency check that resolves falsly without raising an `Exception`.
736
+ (with side effect of not attempting to instrument Redis). This is now fixed with a better dependency check that resolves falsely without raising an `Exception`.
579
737
 
580
738
  * **Bugfix: Gracefully handles NilClass as a Middleware Class when instrumenting**
581
739
 
@@ -700,10 +858,10 @@
700
858
  Additionally, a bug in recording the metric for "findAndModify" as all lowercased "findandmodify"
701
859
  for versions 2.1 through 2.5 was fixed.
702
860
 
703
- * **Bugfix: Priority Sampler causes crash in high throughput environents in rare cases**
861
+ * **Bugfix: Priority Sampler causes crash in high throughput environments in rare cases**
704
862
 
705
863
  Previously, the priority sampling buffer would, in rare cases, generate an error in high-throughput
706
- environments once capacity is reached and the sampling algorthym engages. This issue is fixed.
864
+ environments once capacity is reached and the sampling algorithm engages. This issue is fixed.
707
865
 
708
866
  * **Additional Transaction Information applied to Span Events**
709
867
 
@@ -1422,7 +1580,7 @@
1422
1580
 
1423
1581
  Prior to this version, using an SSL connection to New Relic was
1424
1582
  the default behavior, but could be overridden. SSL connections are
1425
- now enforced (not overrideable).
1583
+ now enforced (not overridable).
1426
1584
 
1427
1585
  * Additional security checking before trying to explain
1428
1586
  multi-statement SQL queries
@@ -1588,7 +1746,7 @@
1588
1746
  The agent will now collect slow SQL explain plans, if configured to, on
1589
1747
  connections using the PostGIS adapter. Thanks Ari Pollak for the contribution!
1590
1748
 
1591
- * Lazily intialize New Relic Config
1749
+ * Lazily initialize New Relic Config
1592
1750
 
1593
1751
  The agent will lazily initialize the New Relic config. This allows the agent
1594
1752
  to pickup configuration from environment variables set by dotenv and similar
@@ -1835,7 +1993,7 @@
1835
1993
  * Include ControllerInstrumentation module with ActiveSupport.on_load
1836
1994
 
1837
1995
  The agent will now use the `on_load :action_controller` hook to include
1838
- the ControllerInstrumentation module in to both the `Base` and `API`
1996
+ the ControllerInstrumentation module into both the `Base` and `API`
1839
1997
  classes of ActionController for Rails 5. This ensures that the proper
1840
1998
  load order is retained, minimizing side-effects of having the agent in
1841
1999
  an application.
@@ -1880,7 +2038,7 @@
1880
2038
  better compatibility between our ActiveRecord Instrumentation and
1881
2039
  other third party gems that modify ActiveRecord using `Module#prepend`.
1882
2040
 
1883
- * Use license key passed in to NewRelic::Agent.manual_start
2041
+ * Use license key passed into NewRelic::Agent.manual_start
1884
2042
 
1885
2043
  Previously, the license key passed in when manually starting the agent
1886
2044
  with NewRelic::Agent.manual_start was not referenced when setting up
@@ -3013,7 +3171,7 @@
3013
3171
  runtime relative to the directory that the host process is started from.
3014
3172
 
3015
3173
  In cases where the host process was started from outside of the application's
3016
- root directory (for example, if the process is started from from '/'), it will
3174
+ root directory (for example, if the process is started from '/'), it will
3017
3175
  now also attempt to locate its configuration file based on the value of
3018
3176
  Rails.root for Rails applications.
3019
3177
 
@@ -3062,7 +3220,7 @@
3062
3220
  Rack::Builder, or via Rails' middleware stack in Rails 3.0+.
3063
3221
 
3064
3222
  This instrumentation may be disabled with the
3065
- disable_middlware_instrumentation configuration setting.
3223
+ disable_middleware_instrumentation configuration setting.
3066
3224
 
3067
3225
  For more details, see the documentation for this feature:
3068
3226
 
@@ -3200,7 +3358,7 @@
3200
3358
  * Separate in-transaction GC timings for web and background processes
3201
3359
 
3202
3360
  Previously, an application with GC instrumentation enabled, and both web and
3203
- background processes reporting in to it would show an overly inflated GC band
3361
+ background processes reporting into it would show an overly inflated GC band
3204
3362
  on the application overview graph, because data from both web and non-web
3205
3363
  transactions would be included. This has been fixed, and GC time during web
3206
3364
  and non-web transactions is now tracked separately.
@@ -3428,7 +3586,7 @@
3428
3586
 
3429
3587
  The agent's ActiveRecord 4.0 instrumentation could not gather SQL explain
3430
3588
  plans on JRuby by default because of a dependency on ObjectSpace, which isn't
3431
- avialable by default. This has been fixed.
3589
+ available by default. This has been fixed.
3432
3590
 
3433
3591
  * Fix for Curb http_put_with_newrelic
3434
3592
 
@@ -4061,7 +4219,7 @@
4061
4219
 
4062
4220
  * corrupt marshal data from pipe children crashing agent
4063
4221
 
4064
- If the agent received corrupted data from the Reqsue worker child agent
4222
+ If the agent received corrupted data from the Resque worker child agent
4065
4223
  it could crash the agent itself. fixed.
4066
4224
 
4067
4225
  * should reset RubyBench GC counter between polls
@@ -4115,7 +4273,7 @@
4115
4273
  * fix for issues with RAILS_ROOT deprecation warnings
4116
4274
  * fixed incorrect 1.9 GC time reporting
4117
4275
  * obfuscation for Slow SQL queries respects transaction trace config
4118
- * fix for RUM instrumentation repoting bad timing info in some cases
4276
+ * fix for RUM instrumentation reporting bad timing info in some cases
4119
4277
  * refactored ActiveRecord instrumentation, no longer requires Rails
4120
4278
 
4121
4279
  ## v3.3.0
data/CONTRIBUTING.md CHANGED
@@ -128,7 +128,7 @@ This will run the unit tests in standalone mode. You can run against a specific
128
128
  by passing the version name (which should match the name of a subdirectory in test/environments)
129
129
  as an argument to the test:env rake task, like this:
130
130
 
131
- bundle exec rake test:env[rails60]
131
+ bundle exec rake 'test:env[rails60]'
132
132
 
133
133
  These tests are setup to run automatically in
134
134
  [GitHub Actions](https://github.com/newrelic/newrelic-ruby-agent/actions) under several
data/Gemfile CHANGED
@@ -1,4 +1,3 @@
1
- # encoding: utf-8
2
1
  # This file is distributed under New Relic's license terms.
3
2
  # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
4
3
  # frozen_string_literal: true
data/Guardfile CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require './test/multiverse/lib/multiverse/bundler_patch'
2
3
 
3
4
  test_folders = Dir.glob("test/new_relic/*").select { |f| File.directory?(f) }
data/README.md CHANGED
@@ -91,7 +91,7 @@ This [troubleshooting framework](https://discuss.newrelic.com/t/ruby-troubleshoo
91
91
 
92
92
  New Relic offers NRDiag, [a client-side diagnostic utility](https://docs.newrelic.com/docs/using-new-relic/cross-product-functions/troubleshooting/new-relic-diagnostics) that automatically detects common problems with New Relic agents. If NRDiag detects a problem, it suggests troubleshooting steps. NRDiag can also automatically attach troubleshooting data to a New Relic Support ticket.
93
93
 
94
- If the issue has been confirmed as a bug or is a Feature request, please file a Github issue.
94
+ If the issue has been confirmed as a bug or is a Feature request, please file a GitHub issue.
95
95
 
96
96
  **Support Channels**
97
97
 
data/Rakefile CHANGED
@@ -1,7 +1,13 @@
1
+ # This file is distributed under New Relic's license terms.
2
+ # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
3
+ # frozen_string_literal: true
4
+
1
5
  require 'rubygems'
2
6
  require 'rake/testtask'
3
7
  require 'yard'
4
8
  require "#{File.dirname(__FILE__)}/lib/tasks/all.rb"
9
+ require_relative 'lib/tasks/helpers/prompt'
10
+ include Prompt
5
11
 
6
12
  YARD::Rake::YardocTask.new
7
13
 
@@ -11,15 +17,6 @@ task :test => ['test:newrelic']
11
17
  namespace :test do
12
18
  desc "Run all tests"
13
19
  task :all => %w[newrelic multiverse all_compatible_envs]
14
-
15
- begin
16
- require 'test_bisect'
17
- TestBisect::BisectTask.new do |t|
18
- t.test_task_name = 'test:newrelic'
19
- end
20
- rescue LoadError
21
- end
22
-
23
20
  agent_home = File.expand_path(File.dirname(__FILE__))
24
21
 
25
22
  desc "Run agent performance tests"
@@ -116,27 +113,23 @@ task :update_ca_bundle do |t|
116
113
  end
117
114
 
118
115
  namespace :cross_agent_tests do
119
- cross_agent_tests_upstream_path = File.expand_path(File.join(File.dirname(__FILE__), '..', 'cross_agent_tests'))
120
- cross_agent_tests_local_path = File.expand_path(File.join(File.dirname(__FILE__), 'test', 'fixtures', 'cross_agent_tests'))
116
+ CROSS_AGENT_TESTS_UPSTREAM_PATH = File.expand_path(File.join('..', 'cross_agent_tests')).freeze
117
+ CROSS_AGENT_TESTS_LOCAL_PATH = File.expand_path(File.join('test', 'fixtures', 'cross_agent_tests')).freeze
121
118
 
122
- # Note: before you pull, make sure your local repo is on the correct, synced branch!
123
119
  desc 'Pull latest changes from cross_agent_tests repo'
124
120
  task :pull do
125
- puts "Updating embedded cross_agent_tests from #{cross_agent_tests_upstream_path}..."
126
- cmd = "rsync -avu --exclude .git #{cross_agent_tests_upstream_path}/ #{cross_agent_tests_local_path}/"
127
- puts cmd
128
- system(cmd)
121
+ command = " rsync -av --exclude .git #{CROSS_AGENT_TESTS_UPSTREAM_PATH}/ #{CROSS_AGENT_TESTS_LOCAL_PATH}/"
122
+ prompt_to_continue(command)
129
123
  end
130
124
 
131
125
  desc 'Copy changes from embedded cross_agent_tests to official repo working copy'
132
126
  task :push do
133
- puts "Copying changes from embedded cross_agent_tests to #{cross_agent_tests_upstream_path}..."
134
- cmd = "rsync -avu #{cross_agent_tests_local_path}/ #{cross_agent_tests_upstream_path}/"
135
- puts cmd
136
- system(cmd)
127
+ command = "rsync -av #{CROSS_AGENT_TESTS_LOCAL_PATH}/ #{CROSS_AGENT_TESTS_UPSTREAM_PATH}/"
128
+ prompt_to_continue(command, 'remote (agent spec repo)')
137
129
  end
138
130
  end
139
131
 
132
+ desc 'Start an interactive console session'
140
133
  task :console do
141
134
  require 'pry'
142
135
  require 'newrelic_rpm'
data/Thorfile ADDED
@@ -0,0 +1,5 @@
1
+ # This file is distributed under New Relic's license terms.
2
+ # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
3
+ # frozen_string_literal: true
4
+
5
+ Dir["./lib/tasks/**/*.thor"].sort.each { |f| load f }
data/bin/newrelic CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
  # executes one of the commands in the new_relic/commands directory
3
4
  # pass the name of the command as an argument
4
5
 
@@ -9,5 +10,5 @@ begin
9
10
  rescue NewRelic::Cli::Command::CommandFailure => failure
10
11
  STDERR.puts failure.message
11
12
  STDERR.puts failure.options if failure.options
12
- exit 1
13
+ exit(1)
13
14
  end
data/bin/newrelic_cmd CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
  # This command has been renamed "newrelic"
3
4
  # executes one of the commands in the new_relic/commands directory
4
5
  # pass the name of the command as an argument