newrelic_rpm 8.10.1 → 8.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (385) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/.rubocop.yml +20 -187
  4. data/.rubocop_todo.yml +11 -202
  5. data/.simplecov +6 -4
  6. data/CHANGELOG.md +68 -25
  7. data/Gemfile +0 -1
  8. data/README.md +1 -1
  9. data/Rakefile +3 -20
  10. data/Thorfile +0 -1
  11. data/bin/nrdebug +63 -43
  12. data/config.dot +5 -5
  13. data/init.rb +1 -2
  14. data/install.rb +1 -2
  15. data/lib/new_relic/agent/adaptive_sampler.rb +0 -1
  16. data/lib/new_relic/agent/agent/shutdown.rb +0 -1
  17. data/lib/new_relic/agent/agent/special_startup.rb +0 -1
  18. data/lib/new_relic/agent/agent/start_worker_thread.rb +0 -1
  19. data/lib/new_relic/agent/agent/startup.rb +0 -1
  20. data/lib/new_relic/agent/agent.rb +100 -73
  21. data/lib/new_relic/agent/agent_logger.rb +4 -5
  22. data/lib/new_relic/agent/attribute_filter.rb +39 -21
  23. data/lib/new_relic/agent/attribute_processing.rb +3 -4
  24. data/lib/new_relic/agent/attributes.rb +0 -1
  25. data/lib/new_relic/agent/audit_logger.rb +2 -3
  26. data/lib/new_relic/agent/autostart.rb +0 -1
  27. data/lib/new_relic/agent/chained_call.rb +0 -1
  28. data/lib/new_relic/agent/commands/agent_command.rb +0 -1
  29. data/lib/new_relic/agent/commands/agent_command_router.rb +3 -4
  30. data/lib/new_relic/agent/commands/thread_profiler_session.rb +0 -1
  31. data/lib/new_relic/agent/configuration/default_source.rb +56 -27
  32. data/lib/new_relic/agent/configuration/dotted_hash.rb +1 -2
  33. data/lib/new_relic/agent/configuration/environment_source.rb +3 -4
  34. data/lib/new_relic/agent/configuration/event_harvest_config.rb +0 -1
  35. data/lib/new_relic/agent/configuration/high_security_source.rb +0 -1
  36. data/lib/new_relic/agent/configuration/manager.rb +1 -2
  37. data/lib/new_relic/agent/configuration/manual_source.rb +0 -1
  38. data/lib/new_relic/agent/configuration/mask_defaults.rb +2 -3
  39. data/lib/new_relic/agent/configuration/security_policy_source.rb +0 -1
  40. data/lib/new_relic/agent/configuration/server_source.rb +0 -1
  41. data/lib/new_relic/agent/configuration/yaml_source.rb +2 -3
  42. data/lib/new_relic/agent/configuration.rb +0 -1
  43. data/lib/new_relic/agent/connect/request_builder.rb +1 -2
  44. data/lib/new_relic/agent/connect/response_handler.rb +1 -2
  45. data/lib/new_relic/agent/custom_event_aggregator.rb +0 -1
  46. data/lib/new_relic/agent/database/explain_plan_helpers.rb +0 -1
  47. data/lib/new_relic/agent/database/obfuscation_helpers.rb +0 -1
  48. data/lib/new_relic/agent/database/obfuscator.rb +0 -1
  49. data/lib/new_relic/agent/database/postgres_explain_obfuscator.rb +0 -1
  50. data/lib/new_relic/agent/database.rb +13 -14
  51. data/lib/new_relic/agent/database_adapter.rb +0 -1
  52. data/lib/new_relic/agent/datastores/metric_helper.rb +0 -4
  53. data/lib/new_relic/agent/datastores/mongo/event_formatter.rb +2 -3
  54. data/lib/new_relic/agent/datastores/mongo/metric_translator.rb +1 -4
  55. data/lib/new_relic/agent/datastores/mongo/obfuscator.rb +0 -1
  56. data/lib/new_relic/agent/datastores/mongo.rb +0 -1
  57. data/lib/new_relic/agent/datastores/redis.rb +0 -1
  58. data/lib/new_relic/agent/datastores.rb +0 -1
  59. data/lib/new_relic/agent/deprecator.rb +0 -1
  60. data/lib/new_relic/agent/distributed_tracing/cross_app_payload.rb +0 -1
  61. data/lib/new_relic/agent/distributed_tracing/cross_app_tracing.rb +0 -1
  62. data/lib/new_relic/agent/distributed_tracing/distributed_trace_attributes.rb +0 -1
  63. data/lib/new_relic/agent/distributed_tracing/distributed_trace_metrics.rb +0 -1
  64. data/lib/new_relic/agent/distributed_tracing/distributed_trace_payload.rb +0 -2
  65. data/lib/new_relic/agent/distributed_tracing/distributed_trace_transport_type.rb +0 -1
  66. data/lib/new_relic/agent/distributed_tracing/trace_context.rb +0 -1
  67. data/lib/new_relic/agent/distributed_tracing/trace_context_payload.rb +0 -1
  68. data/lib/new_relic/agent/distributed_tracing.rb +0 -1
  69. data/lib/new_relic/agent/encoding_normalizer.rb +0 -1
  70. data/lib/new_relic/agent/error_collector.rb +0 -1
  71. data/lib/new_relic/agent/error_event_aggregator.rb +0 -1
  72. data/lib/new_relic/agent/error_filter.rb +4 -5
  73. data/lib/new_relic/agent/error_trace_aggregator.rb +1 -2
  74. data/lib/new_relic/agent/event_aggregator.rb +0 -1
  75. data/lib/new_relic/agent/event_buffer.rb +0 -1
  76. data/lib/new_relic/agent/event_listener.rb +0 -1
  77. data/lib/new_relic/agent/event_loop.rb +2 -3
  78. data/lib/new_relic/agent/external.rb +1 -2
  79. data/lib/new_relic/agent/guid_generator.rb +0 -1
  80. data/lib/new_relic/agent/harvester.rb +0 -1
  81. data/lib/new_relic/agent/heap.rb +2 -3
  82. data/lib/new_relic/agent/hostname.rb +0 -1
  83. data/lib/new_relic/agent/http_clients/abstract.rb +0 -1
  84. data/lib/new_relic/agent/http_clients/curb_wrappers.rb +0 -1
  85. data/lib/new_relic/agent/http_clients/excon_wrappers.rb +0 -1
  86. data/lib/new_relic/agent/http_clients/http_rb_wrappers.rb +1 -2
  87. data/lib/new_relic/agent/http_clients/httpclient_wrappers.rb +1 -2
  88. data/lib/new_relic/agent/http_clients/net_http_wrappers.rb +0 -1
  89. data/lib/new_relic/agent/http_clients/typhoeus_wrappers.rb +1 -2
  90. data/lib/new_relic/agent/http_clients/uri_util.rb +0 -1
  91. data/lib/new_relic/agent/instrumentation/action_cable_subscriber.rb +0 -1
  92. data/lib/new_relic/agent/instrumentation/action_controller_subscriber.rb +0 -1
  93. data/lib/new_relic/agent/instrumentation/action_view_subscriber.rb +1 -2
  94. data/lib/new_relic/agent/instrumentation/active_job.rb +0 -1
  95. data/lib/new_relic/agent/instrumentation/active_merchant.rb +2 -2
  96. data/lib/new_relic/agent/instrumentation/active_record.rb +0 -1
  97. data/lib/new_relic/agent/instrumentation/active_record_helper.rb +0 -1
  98. data/lib/new_relic/agent/instrumentation/active_record_notifications.rb +0 -1
  99. data/lib/new_relic/agent/instrumentation/active_record_prepend.rb +0 -1
  100. data/lib/new_relic/agent/instrumentation/active_record_subscriber.rb +0 -1
  101. data/lib/new_relic/agent/instrumentation/active_storage.rb +0 -1
  102. data/lib/new_relic/agent/instrumentation/active_storage_subscriber.rb +0 -1
  103. data/lib/new_relic/agent/instrumentation/active_support_logger/chain.rb +0 -1
  104. data/lib/new_relic/agent/instrumentation/active_support_logger/instrumentation.rb +0 -1
  105. data/lib/new_relic/agent/instrumentation/active_support_logger/prepend.rb +0 -1
  106. data/lib/new_relic/agent/instrumentation/active_support_logger.rb +0 -1
  107. data/lib/new_relic/agent/instrumentation/acts_as_solr.rb +0 -1
  108. data/lib/new_relic/agent/instrumentation/authlogic.rb +0 -1
  109. data/lib/new_relic/agent/instrumentation/bunny/chain.rb +0 -1
  110. data/lib/new_relic/agent/instrumentation/bunny/instrumentation.rb +0 -1
  111. data/lib/new_relic/agent/instrumentation/bunny/prepend.rb +0 -1
  112. data/lib/new_relic/agent/instrumentation/bunny.rb +0 -1
  113. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +2 -3
  114. data/lib/new_relic/agent/instrumentation/curb/chain.rb +0 -1
  115. data/lib/new_relic/agent/instrumentation/curb/instrumentation.rb +14 -11
  116. data/lib/new_relic/agent/instrumentation/curb/prepend.rb +0 -1
  117. data/lib/new_relic/agent/instrumentation/curb.rb +0 -1
  118. data/lib/new_relic/agent/instrumentation/data_mapper.rb +1 -2
  119. data/lib/new_relic/agent/instrumentation/delayed_job/chain.rb +0 -1
  120. data/lib/new_relic/agent/instrumentation/delayed_job/instrumentation.rb +0 -1
  121. data/lib/new_relic/agent/instrumentation/delayed_job/prepend.rb +0 -1
  122. data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +0 -1
  123. data/lib/new_relic/agent/instrumentation/excon/middleware.rb +0 -1
  124. data/lib/new_relic/agent/instrumentation/excon.rb +0 -1
  125. data/lib/new_relic/agent/instrumentation/grape/chain.rb +0 -1
  126. data/lib/new_relic/agent/instrumentation/grape/instrumentation.rb +0 -1
  127. data/lib/new_relic/agent/instrumentation/grape/prepend.rb +0 -1
  128. data/lib/new_relic/agent/instrumentation/grape.rb +0 -1
  129. data/lib/new_relic/agent/instrumentation/grpc/client/chain.rb +0 -1
  130. data/lib/new_relic/agent/instrumentation/grpc/client/instrumentation.rb +0 -1
  131. data/lib/new_relic/agent/instrumentation/grpc/client/prepend.rb +0 -1
  132. data/lib/new_relic/agent/instrumentation/grpc/client/request_wrapper.rb +0 -1
  133. data/lib/new_relic/agent/instrumentation/grpc/helper.rb +0 -1
  134. data/lib/new_relic/agent/instrumentation/grpc/server/chain.rb +0 -1
  135. data/lib/new_relic/agent/instrumentation/grpc/server/instrumentation.rb +0 -1
  136. data/lib/new_relic/agent/instrumentation/grpc/server/rpc_desc_prepend.rb +0 -1
  137. data/lib/new_relic/agent/instrumentation/grpc/server/rpc_server_prepend.rb +0 -1
  138. data/lib/new_relic/agent/instrumentation/grpc_client.rb +0 -1
  139. data/lib/new_relic/agent/instrumentation/grpc_server.rb +0 -1
  140. data/lib/new_relic/agent/instrumentation/httpclient/chain.rb +0 -1
  141. data/lib/new_relic/agent/instrumentation/httpclient/instrumentation.rb +0 -1
  142. data/lib/new_relic/agent/instrumentation/httpclient/prepend.rb +0 -1
  143. data/lib/new_relic/agent/instrumentation/httpclient.rb +0 -1
  144. data/lib/new_relic/agent/instrumentation/httprb/chain.rb +0 -1
  145. data/lib/new_relic/agent/instrumentation/httprb/instrumentation.rb +0 -1
  146. data/lib/new_relic/agent/instrumentation/httprb/prepend.rb +0 -1
  147. data/lib/new_relic/agent/instrumentation/httprb.rb +0 -1
  148. data/lib/new_relic/agent/instrumentation/ignore_actions.rb +0 -1
  149. data/lib/new_relic/agent/instrumentation/logger/chain.rb +0 -1
  150. data/lib/new_relic/agent/instrumentation/logger/instrumentation.rb +0 -1
  151. data/lib/new_relic/agent/instrumentation/logger/prepend.rb +0 -1
  152. data/lib/new_relic/agent/instrumentation/logger.rb +0 -1
  153. data/lib/new_relic/agent/instrumentation/memcache/chain.rb +0 -1
  154. data/lib/new_relic/agent/instrumentation/memcache/dalli.rb +1 -2
  155. data/lib/new_relic/agent/instrumentation/memcache/helper.rb +0 -1
  156. data/lib/new_relic/agent/instrumentation/memcache/instrumentation.rb +0 -1
  157. data/lib/new_relic/agent/instrumentation/memcache/prepend.rb +1 -2
  158. data/lib/new_relic/agent/instrumentation/memcache.rb +4 -5
  159. data/lib/new_relic/agent/instrumentation/middleware_proxy.rb +1 -2
  160. data/lib/new_relic/agent/instrumentation/middleware_tracing.rb +0 -1
  161. data/lib/new_relic/agent/instrumentation/mongo.rb +0 -1
  162. data/lib/new_relic/agent/instrumentation/mongodb_command_subscriber.rb +1 -2
  163. data/lib/new_relic/agent/instrumentation/net_http/chain.rb +0 -1
  164. data/lib/new_relic/agent/instrumentation/net_http/instrumentation.rb +0 -1
  165. data/lib/new_relic/agent/instrumentation/net_http/prepend.rb +0 -1
  166. data/lib/new_relic/agent/instrumentation/net_http.rb +0 -1
  167. data/lib/new_relic/agent/instrumentation/notifications_subscriber.rb +2 -3
  168. data/lib/new_relic/agent/instrumentation/padrino/chain.rb +0 -1
  169. data/lib/new_relic/agent/instrumentation/padrino/instrumentation.rb +0 -1
  170. data/lib/new_relic/agent/instrumentation/padrino/prepend.rb +0 -1
  171. data/lib/new_relic/agent/instrumentation/padrino.rb +0 -1
  172. data/lib/new_relic/agent/instrumentation/passenger_instrumentation.rb +0 -1
  173. data/lib/new_relic/agent/instrumentation/queue_time.rb +0 -2
  174. data/lib/new_relic/agent/instrumentation/rack/chain.rb +0 -1
  175. data/lib/new_relic/agent/instrumentation/rack/helpers.rb +0 -1
  176. data/lib/new_relic/agent/instrumentation/rack/instrumentation.rb +0 -1
  177. data/lib/new_relic/agent/instrumentation/rack/prepend.rb +0 -1
  178. data/lib/new_relic/agent/instrumentation/rack.rb +0 -1
  179. data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +0 -1
  180. data/lib/new_relic/agent/instrumentation/rails_middleware.rb +0 -1
  181. data/lib/new_relic/agent/instrumentation/rails_notifications/action_cable.rb +0 -1
  182. data/lib/new_relic/agent/instrumentation/rails_notifications/action_controller.rb +0 -1
  183. data/lib/new_relic/agent/instrumentation/rails_notifications/action_view.rb +0 -1
  184. data/lib/new_relic/agent/instrumentation/rainbows_instrumentation.rb +0 -1
  185. data/lib/new_relic/agent/instrumentation/rake/chain.rb +0 -1
  186. data/lib/new_relic/agent/instrumentation/rake/instrumentation.rb +5 -1
  187. data/lib/new_relic/agent/instrumentation/rake/prepend.rb +0 -1
  188. data/lib/new_relic/agent/instrumentation/rake.rb +0 -1
  189. data/lib/new_relic/agent/instrumentation/redis/chain.rb +0 -1
  190. data/lib/new_relic/agent/instrumentation/redis/instrumentation.rb +0 -1
  191. data/lib/new_relic/agent/instrumentation/redis/prepend.rb +0 -1
  192. data/lib/new_relic/agent/instrumentation/redis.rb +0 -1
  193. data/lib/new_relic/agent/instrumentation/resque/chain.rb +0 -1
  194. data/lib/new_relic/agent/instrumentation/resque/helper.rb +0 -1
  195. data/lib/new_relic/agent/instrumentation/resque/instrumentation.rb +0 -1
  196. data/lib/new_relic/agent/instrumentation/resque/prepend.rb +0 -1
  197. data/lib/new_relic/agent/instrumentation/resque.rb +0 -1
  198. data/lib/new_relic/agent/instrumentation/sequel.rb +0 -1
  199. data/lib/new_relic/agent/instrumentation/sequel_helper.rb +0 -1
  200. data/lib/new_relic/agent/instrumentation/sidekiq.rb +1 -2
  201. data/lib/new_relic/agent/instrumentation/sinatra/chain.rb +0 -1
  202. data/lib/new_relic/agent/instrumentation/sinatra/ignorer.rb +0 -1
  203. data/lib/new_relic/agent/instrumentation/sinatra/instrumentation.rb +0 -1
  204. data/lib/new_relic/agent/instrumentation/sinatra/prepend.rb +0 -1
  205. data/lib/new_relic/agent/instrumentation/sinatra/transaction_namer.rb +0 -1
  206. data/lib/new_relic/agent/instrumentation/sinatra.rb +0 -1
  207. data/lib/new_relic/agent/instrumentation/sunspot.rb +0 -1
  208. data/lib/new_relic/agent/instrumentation/thread/chain.rb +0 -1
  209. data/lib/new_relic/agent/instrumentation/thread/instrumentation.rb +0 -1
  210. data/lib/new_relic/agent/instrumentation/thread/prepend.rb +0 -1
  211. data/lib/new_relic/agent/instrumentation/thread.rb +0 -1
  212. data/lib/new_relic/agent/instrumentation/tilt/chain.rb +0 -1
  213. data/lib/new_relic/agent/instrumentation/tilt/instrumentation.rb +0 -1
  214. data/lib/new_relic/agent/instrumentation/tilt/prepend.rb +0 -1
  215. data/lib/new_relic/agent/instrumentation/tilt.rb +0 -1
  216. data/lib/new_relic/agent/instrumentation/typhoeus/chain.rb +0 -1
  217. data/lib/new_relic/agent/instrumentation/typhoeus/instrumentation.rb +3 -4
  218. data/lib/new_relic/agent/instrumentation/typhoeus/prepend.rb +0 -1
  219. data/lib/new_relic/agent/instrumentation/typhoeus.rb +0 -1
  220. data/lib/new_relic/agent/instrumentation.rb +0 -1
  221. data/lib/new_relic/agent/internal_agent_error.rb +0 -1
  222. data/lib/new_relic/agent/javascript_instrumentor.rb +1 -2
  223. data/lib/new_relic/agent/linking_metadata.rb +0 -1
  224. data/lib/new_relic/agent/local_log_decorator.rb +0 -1
  225. data/lib/new_relic/agent/log_event_aggregator.rb +0 -1
  226. data/lib/new_relic/agent/log_once.rb +0 -1
  227. data/lib/new_relic/agent/log_priority.rb +0 -1
  228. data/lib/new_relic/agent/logging.rb +0 -1
  229. data/lib/new_relic/agent/memory_logger.rb +0 -1
  230. data/lib/new_relic/agent/messaging.rb +1 -2
  231. data/lib/new_relic/agent/method_tracer.rb +0 -1
  232. data/lib/new_relic/agent/method_tracer_helpers.rb +1 -2
  233. data/lib/new_relic/agent/monitors/cross_app_monitor.rb +0 -1
  234. data/lib/new_relic/agent/monitors/distributed_tracing_monitor.rb +0 -1
  235. data/lib/new_relic/agent/monitors/inbound_request_monitor.rb +0 -1
  236. data/lib/new_relic/agent/monitors/synthetics_monitor.rb +0 -1
  237. data/lib/new_relic/agent/monitors.rb +0 -1
  238. data/lib/new_relic/agent/new_relic_service/encoders.rb +0 -1
  239. data/lib/new_relic/agent/new_relic_service/json_marshaller.rb +0 -1
  240. data/lib/new_relic/agent/new_relic_service/marshaller.rb +0 -1
  241. data/lib/new_relic/agent/new_relic_service/security_policy_settings.rb +0 -1
  242. data/lib/new_relic/agent/new_relic_service.rb +193 -142
  243. data/lib/new_relic/agent/{noticible_error.rb → noticeable_error.rb} +1 -2
  244. data/lib/new_relic/agent/null_logger.rb +0 -1
  245. data/lib/new_relic/agent/obfuscator.rb +1 -2
  246. data/lib/new_relic/agent/parameter_filtering.rb +0 -1
  247. data/lib/new_relic/agent/payload_metric_mapping.rb +0 -1
  248. data/lib/new_relic/agent/pipe_channel_manager.rb +0 -1
  249. data/lib/new_relic/agent/pipe_service.rb +0 -1
  250. data/lib/new_relic/agent/prepend_supportability.rb +0 -1
  251. data/lib/new_relic/agent/priority_sampled_buffer.rb +2 -3
  252. data/lib/new_relic/agent/range_extensions.rb +0 -1
  253. data/lib/new_relic/agent/rules_engine/replacement_rule.rb +0 -1
  254. data/lib/new_relic/agent/rules_engine/segment_terms_rule.rb +0 -1
  255. data/lib/new_relic/agent/rules_engine.rb +0 -1
  256. data/lib/new_relic/agent/sampler.rb +0 -1
  257. data/lib/new_relic/agent/sampler_collection.rb +0 -1
  258. data/lib/new_relic/agent/samplers/cpu_sampler.rb +0 -1
  259. data/lib/new_relic/agent/samplers/delayed_job_sampler.rb +0 -1
  260. data/lib/new_relic/agent/samplers/memory_sampler.rb +5 -6
  261. data/lib/new_relic/agent/samplers/object_sampler.rb +0 -1
  262. data/lib/new_relic/agent/samplers/vm_sampler.rb +2 -1
  263. data/lib/new_relic/agent/span_event_aggregator.rb +0 -1
  264. data/lib/new_relic/agent/span_event_primitive.rb +0 -2
  265. data/lib/new_relic/agent/sql_sampler.rb +0 -1
  266. data/lib/new_relic/agent/stats.rb +12 -3
  267. data/lib/new_relic/agent/stats_engine/gc_profiler.rb +0 -2
  268. data/lib/new_relic/agent/stats_engine/stats_hash.rb +1 -2
  269. data/lib/new_relic/agent/stats_engine.rb +0 -1
  270. data/lib/new_relic/agent/synthetics_event_aggregator.rb +0 -1
  271. data/lib/new_relic/agent/system_info.rb +1 -2
  272. data/lib/new_relic/agent/threading/agent_thread.rb +2 -3
  273. data/lib/new_relic/agent/threading/backtrace_node.rb +0 -1
  274. data/lib/new_relic/agent/threading/backtrace_service.rb +0 -1
  275. data/lib/new_relic/agent/threading/thread_profile.rb +1 -2
  276. data/lib/new_relic/agent/timestamp_sampled_buffer.rb +0 -1
  277. data/lib/new_relic/agent/tracer.rb +2 -3
  278. data/lib/new_relic/agent/transaction/abstract_segment.rb +2 -3
  279. data/lib/new_relic/agent/transaction/datastore_segment.rb +0 -1
  280. data/lib/new_relic/agent/transaction/distributed_tracer.rb +0 -1
  281. data/lib/new_relic/agent/transaction/distributed_tracing.rb +0 -1
  282. data/lib/new_relic/agent/transaction/external_request_segment.rb +1 -2
  283. data/lib/new_relic/agent/transaction/message_broker_segment.rb +0 -1
  284. data/lib/new_relic/agent/transaction/request_attributes.rb +0 -1
  285. data/lib/new_relic/agent/transaction/segment.rb +0 -1
  286. data/lib/new_relic/agent/transaction/slowest_sample_buffer.rb +0 -1
  287. data/lib/new_relic/agent/transaction/synthetics_sample_buffer.rb +0 -1
  288. data/lib/new_relic/agent/transaction/trace.rb +0 -1
  289. data/lib/new_relic/agent/transaction/trace_builder.rb +0 -1
  290. data/lib/new_relic/agent/transaction/trace_context.rb +0 -1
  291. data/lib/new_relic/agent/transaction/trace_node.rb +2 -3
  292. data/lib/new_relic/agent/transaction/tracing.rb +0 -1
  293. data/lib/new_relic/agent/transaction/transaction_sample_buffer.rb +0 -2
  294. data/lib/new_relic/agent/transaction.rb +3 -5
  295. data/lib/new_relic/agent/transaction_error_primitive.rb +0 -1
  296. data/lib/new_relic/agent/transaction_event_aggregator.rb +0 -1
  297. data/lib/new_relic/agent/transaction_event_primitive.rb +0 -1
  298. data/lib/new_relic/agent/transaction_event_recorder.rb +1 -2
  299. data/lib/new_relic/agent/transaction_metrics.rb +1 -2
  300. data/lib/new_relic/agent/transaction_sampler.rb +0 -1
  301. data/lib/new_relic/agent/transaction_time_aggregator.rb +1 -2
  302. data/lib/new_relic/agent/utilization/aws.rb +0 -1
  303. data/lib/new_relic/agent/utilization/azure.rb +1 -2
  304. data/lib/new_relic/agent/utilization/gcp.rb +1 -2
  305. data/lib/new_relic/agent/utilization/pcf.rb +1 -2
  306. data/lib/new_relic/agent/utilization/vendor.rb +1 -2
  307. data/lib/new_relic/agent/utilization_data.rb +0 -1
  308. data/lib/new_relic/agent/vm/jruby_vm.rb +0 -1
  309. data/lib/new_relic/agent/vm/monotonic_gc_profiler.rb +0 -1
  310. data/lib/new_relic/agent/vm/mri_vm.rb +35 -23
  311. data/lib/new_relic/agent/vm/snapshot.rb +1 -2
  312. data/lib/new_relic/agent/vm.rb +0 -1
  313. data/lib/new_relic/agent/worker_loop.rb +0 -1
  314. data/lib/new_relic/agent.rb +13 -16
  315. data/lib/new_relic/cli/command.rb +1 -2
  316. data/lib/new_relic/cli/commands/deployments.rb +72 -21
  317. data/lib/new_relic/cli/commands/install.rb +0 -1
  318. data/lib/new_relic/coerce.rb +0 -1
  319. data/lib/new_relic/collection_helper.rb +1 -2
  320. data/lib/new_relic/constants.rb +0 -1
  321. data/lib/new_relic/control/class_methods.rb +0 -1
  322. data/lib/new_relic/control/frameworks/external.rb +0 -1
  323. data/lib/new_relic/control/frameworks/rails.rb +0 -1
  324. data/lib/new_relic/control/frameworks/rails3.rb +0 -1
  325. data/lib/new_relic/control/frameworks/rails4.rb +0 -1
  326. data/lib/new_relic/control/frameworks/rails_notifications.rb +0 -1
  327. data/lib/new_relic/control/frameworks/ruby.rb +0 -1
  328. data/lib/new_relic/control/frameworks/sinatra.rb +0 -1
  329. data/lib/new_relic/control/frameworks.rb +0 -1
  330. data/lib/new_relic/control/instance_methods.rb +17 -40
  331. data/lib/new_relic/control/instrumentation.rb +0 -1
  332. data/lib/new_relic/control/private_instance_methods.rb +48 -0
  333. data/lib/new_relic/control/server_methods.rb +0 -1
  334. data/lib/new_relic/control.rb +0 -1
  335. data/lib/new_relic/delayed_job_injection.rb +0 -1
  336. data/lib/new_relic/dependency_detection.rb +3 -4
  337. data/lib/new_relic/environment_report.rb +23 -14
  338. data/lib/new_relic/helper.rb +1 -2
  339. data/lib/new_relic/language_support.rb +2 -3
  340. data/lib/new_relic/latest_changes.rb +3 -4
  341. data/lib/new_relic/local_environment.rb +3 -4
  342. data/lib/new_relic/metric_data.rb +27 -22
  343. data/lib/new_relic/metric_spec.rb +0 -1
  344. data/lib/new_relic/noticed_error.rb +3 -6
  345. data/lib/new_relic/rack/agent_hooks.rb +0 -1
  346. data/lib/new_relic/rack/agent_middleware.rb +0 -1
  347. data/lib/new_relic/rack/browser_monitoring.rb +131 -123
  348. data/lib/new_relic/rack.rb +0 -1
  349. data/lib/new_relic/recipes/capistrano3.rb +2 -59
  350. data/lib/new_relic/recipes/capistrano_legacy.rb +1 -2
  351. data/lib/new_relic/recipes/helpers/send_deployment.rb +69 -0
  352. data/lib/new_relic/recipes.rb +0 -1
  353. data/lib/new_relic/supportability_helper.rb +1 -2
  354. data/lib/new_relic/traced_thread.rb +0 -1
  355. data/lib/new_relic/version.rb +2 -3
  356. data/lib/newrelic_rpm.rb +0 -1
  357. data/lib/sequel/extensions/newrelic_instrumentation.rb +2 -3
  358. data/lib/sequel/plugins/newrelic_instrumentation.rb +0 -1
  359. data/lib/tasks/all.rb +0 -1
  360. data/lib/tasks/config.rake +4 -113
  361. data/lib/tasks/coverage_report.rake +14 -19
  362. data/lib/tasks/{config.html.erb → helpers/config.html.erb} +0 -0
  363. data/lib/tasks/{config.text.erb → helpers/config.text.erb} +0 -0
  364. data/lib/tasks/helpers/format.rb +120 -0
  365. data/lib/tasks/helpers/matches.rb +12 -0
  366. data/lib/tasks/helpers/prompt.rb +24 -0
  367. data/lib/tasks/helpers/removers.rb +33 -0
  368. data/lib/tasks/install.rake +0 -1
  369. data/lib/tasks/instrumentation_generator/README.md +1 -1
  370. data/lib/tasks/instrumentation_generator/instrumentation.thor +22 -16
  371. data/lib/tasks/instrumentation_generator/templates/Envfile.tt +0 -1
  372. data/lib/tasks/instrumentation_generator/templates/chain.tt +0 -1
  373. data/lib/tasks/instrumentation_generator/templates/dependency_detection.tt +0 -1
  374. data/lib/tasks/instrumentation_generator/templates/instrumentation.tt +0 -1
  375. data/lib/tasks/instrumentation_generator/templates/prepend.tt +0 -1
  376. data/lib/tasks/instrumentation_generator/templates/test.tt +0 -1
  377. data/lib/tasks/multiverse.rake +0 -1
  378. data/lib/tasks/multiverse.rb +3 -29
  379. data/lib/tasks/newrelic.rb +0 -1
  380. data/lib/tasks/tests.rake +3 -8
  381. data/newrelic.yml +10 -1
  382. data/newrelic_rpm.gemspec +6 -7
  383. data/recipes/newrelic.rb +0 -1
  384. data/test/agent_helper.rb +17 -35
  385. metadata +11 -5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,49 @@
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
+
3
47
 
4
48
  ## v8.10.1
5
49
 
@@ -41,7 +85,7 @@
41
85
 
42
86
  * **Performance: Rework timing range overlap calculations for multiple transaction segments**
43
87
 
44
- 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 perfomance 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.
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.
45
89
 
46
90
 
47
91
  * **Performance: Make frozen string literals the default for the agent**
@@ -78,7 +122,6 @@
78
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.
79
123
 
80
124
 
81
-
82
125
  ## v8.9.0
83
126
 
84
127
 
@@ -119,7 +162,7 @@
119
162
 
120
163
  * **APM logs-in-context log forwarding on by default**
121
164
 
122
- 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).
123
166
 
124
167
  * **Improved async support and Thread instrumentation**
125
168
 
@@ -128,7 +171,7 @@
128
171
  New configuration options included in this release:
129
172
  | Configuration name | Default | Behavior |
130
173
  | ----------- | ----------- |----------- |
131
- | `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 |
132
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. |
133
176
 
134
177
  We'd like to thank @mikeantonelli for sharing a gist with us that provided our team with an entry point for this feature.
@@ -217,7 +260,7 @@
217
260
 
218
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.
219
262
 
220
- * **Bugfix: Curb - satify method_with_tracing's verb argument requirement**
263
+ * **Bugfix: Curb - satisfy method_with_tracing's verb argument requirement**
221
264
 
222
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.
223
266
 
@@ -399,7 +442,7 @@
399
442
 
400
443
  * **Update configuration option default value for `span_events.max_samples_stored` from 1000 to 2000**
401
444
 
402
- 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).
403
446
 
404
447
  * **Agent now enforces server supplied maximum value for configuration option `span_events.max_samples_stored`**
405
448
 
@@ -473,7 +516,7 @@
473
516
 
474
517
  * **Bugfix: resolves "can't add a new key into hash during iteration" Errors**
475
518
 
476
- 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.
477
520
 
478
521
  * **Bugfix: kwarg support fixed for Rack middleware instrumentation**
479
522
 
@@ -530,7 +573,7 @@
530
573
 
531
574
  * **Ruby Agent 6.x to 7.x Migration Guide Available**
532
575
 
533
- 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.
534
577
 
535
578
  * **Ruby 2.0 and 2.1 Dropped**
536
579
 
@@ -649,7 +692,7 @@
649
692
  * **Default prepend_net_instrumentation to false**
650
693
 
651
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
652
- unexpected compatibilty issues.
695
+ unexpected compatibility issues.
653
696
 
654
697
  ## v6.14.0
655
698
 
@@ -659,14 +702,14 @@
659
702
 
660
703
  * **Bugfix: Delayed Job instrumentation fixed for Ruby 2.7+**
661
704
 
662
- 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
663
706
  Delayed Job's library. The led to Delayed job not auto-instrumenting correctly and has been fixed.
664
707
 
665
708
  * **Bugfix: Ruby 2.7+ methods sometimes erroneously attributed compiler warnings to the Agent's `add_method_tracer`**
666
709
 
667
710
  The specific edge cases presented are now fixed by this release of the agent. There are still some known corner-cases
668
711
  that will be resolved with upcoming changes in next major release of the Agent. If you encounter a problem with adding
669
- 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.
670
713
 
671
714
  * **Bugfix: Ruby 2.7+ fix for keyword arguments on Rack apps is unnecessary and removed**
672
715
 
@@ -683,14 +726,14 @@
683
726
 
684
727
  Previously, when a user specifies a `newrelic.yml.erb` and no `newrelic.yml` file, the agent fails to find
685
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
686
- 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
687
730
  path and will be utilized if present. NOTE: `newrelic.yml` still takes precedence over `newrelic.yml.erb` If found,
688
731
  the `.yml` file is used instead of the `.erb` file. Search directories and order of traversal remain unchanged.
689
732
 
690
733
  * **Bugfix: dependency detection of Redis now works without raising an exception**
691
734
 
692
735
  Previously, when detecting if Redis was available to instrument, the dependency detection would fail with an Exception raised
693
- (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`.
694
737
 
695
738
  * **Bugfix: Gracefully handles NilClass as a Middleware Class when instrumenting**
696
739
 
@@ -815,10 +858,10 @@
815
858
  Additionally, a bug in recording the metric for "findAndModify" as all lowercased "findandmodify"
816
859
  for versions 2.1 through 2.5 was fixed.
817
860
 
818
- * **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**
819
862
 
820
863
  Previously, the priority sampling buffer would, in rare cases, generate an error in high-throughput
821
- 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.
822
865
 
823
866
  * **Additional Transaction Information applied to Span Events**
824
867
 
@@ -1537,7 +1580,7 @@
1537
1580
 
1538
1581
  Prior to this version, using an SSL connection to New Relic was
1539
1582
  the default behavior, but could be overridden. SSL connections are
1540
- now enforced (not overrideable).
1583
+ now enforced (not overridable).
1541
1584
 
1542
1585
  * Additional security checking before trying to explain
1543
1586
  multi-statement SQL queries
@@ -1703,7 +1746,7 @@
1703
1746
  The agent will now collect slow SQL explain plans, if configured to, on
1704
1747
  connections using the PostGIS adapter. Thanks Ari Pollak for the contribution!
1705
1748
 
1706
- * Lazily intialize New Relic Config
1749
+ * Lazily initialize New Relic Config
1707
1750
 
1708
1751
  The agent will lazily initialize the New Relic config. This allows the agent
1709
1752
  to pickup configuration from environment variables set by dotenv and similar
@@ -1950,7 +1993,7 @@
1950
1993
  * Include ControllerInstrumentation module with ActiveSupport.on_load
1951
1994
 
1952
1995
  The agent will now use the `on_load :action_controller` hook to include
1953
- the ControllerInstrumentation module in to both the `Base` and `API`
1996
+ the ControllerInstrumentation module into both the `Base` and `API`
1954
1997
  classes of ActionController for Rails 5. This ensures that the proper
1955
1998
  load order is retained, minimizing side-effects of having the agent in
1956
1999
  an application.
@@ -1995,7 +2038,7 @@
1995
2038
  better compatibility between our ActiveRecord Instrumentation and
1996
2039
  other third party gems that modify ActiveRecord using `Module#prepend`.
1997
2040
 
1998
- * Use license key passed in to NewRelic::Agent.manual_start
2041
+ * Use license key passed into NewRelic::Agent.manual_start
1999
2042
 
2000
2043
  Previously, the license key passed in when manually starting the agent
2001
2044
  with NewRelic::Agent.manual_start was not referenced when setting up
@@ -3128,7 +3171,7 @@
3128
3171
  runtime relative to the directory that the host process is started from.
3129
3172
 
3130
3173
  In cases where the host process was started from outside of the application's
3131
- 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
3132
3175
  now also attempt to locate its configuration file based on the value of
3133
3176
  Rails.root for Rails applications.
3134
3177
 
@@ -3177,7 +3220,7 @@
3177
3220
  Rack::Builder, or via Rails' middleware stack in Rails 3.0+.
3178
3221
 
3179
3222
  This instrumentation may be disabled with the
3180
- disable_middlware_instrumentation configuration setting.
3223
+ disable_middleware_instrumentation configuration setting.
3181
3224
 
3182
3225
  For more details, see the documentation for this feature:
3183
3226
 
@@ -3315,7 +3358,7 @@
3315
3358
  * Separate in-transaction GC timings for web and background processes
3316
3359
 
3317
3360
  Previously, an application with GC instrumentation enabled, and both web and
3318
- 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
3319
3362
  on the application overview graph, because data from both web and non-web
3320
3363
  transactions would be included. This has been fixed, and GC time during web
3321
3364
  and non-web transactions is now tracked separately.
@@ -3543,7 +3586,7 @@
3543
3586
 
3544
3587
  The agent's ActiveRecord 4.0 instrumentation could not gather SQL explain
3545
3588
  plans on JRuby by default because of a dependency on ObjectSpace, which isn't
3546
- avialable by default. This has been fixed.
3589
+ available by default. This has been fixed.
3547
3590
 
3548
3591
  * Fix for Curb http_put_with_newrelic
3549
3592
 
@@ -4176,7 +4219,7 @@
4176
4219
 
4177
4220
  * corrupt marshal data from pipe children crashing agent
4178
4221
 
4179
- 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
4180
4223
  it could crash the agent itself. fixed.
4181
4224
 
4182
4225
  * should reset RubyBench GC counter between polls
@@ -4230,7 +4273,7 @@
4230
4273
  * fix for issues with RAILS_ROOT deprecation warnings
4231
4274
  * fixed incorrect 1.9 GC time reporting
4232
4275
  * obfuscation for Slow SQL queries respects transaction trace config
4233
- * fix for RUM instrumentation repoting bad timing info in some cases
4276
+ * fix for RUM instrumentation reporting bad timing info in some cases
4234
4277
  * refactored ActiveRecord instrumentation, no longer requires Rails
4235
4278
 
4236
4279
  ## v3.3.0
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/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,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
@@ -7,6 +6,8 @@ require 'rubygems'
7
6
  require 'rake/testtask'
8
7
  require 'yard'
9
8
  require "#{File.dirname(__FILE__)}/lib/tasks/all.rb"
9
+ require_relative 'lib/tasks/helpers/prompt'
10
+ include Prompt
10
11
 
11
12
  YARD::Rake::YardocTask.new
12
13
 
@@ -115,25 +116,6 @@ namespace :cross_agent_tests do
115
116
  CROSS_AGENT_TESTS_UPSTREAM_PATH = File.expand_path(File.join('..', 'cross_agent_tests')).freeze
116
117
  CROSS_AGENT_TESTS_LOCAL_PATH = File.expand_path(File.join('test', 'fixtures', 'cross_agent_tests')).freeze
117
118
 
118
- def prompt_to_continue(command, destination = 'local')
119
- puts "The following rsync command will be executed to update the #{destination} copy of the specs:"
120
- puts
121
- puts command
122
- puts
123
- puts "CAUTION: Any unsaved changes that exist within the #{destination} content will be OVERWRITTEN!"
124
- if destination.eql?('local')
125
- puts 'CAUTION 2: Before continuing, make sure your local repo is on the correct, synced branch!'
126
- end
127
- puts
128
- print "Do you wish to continue? ('y' to continue, return to cancel) [n] "
129
- continue = STDIN.gets.chomp
130
- if continue.downcase.eql?('y')
131
- system(command)
132
- else
133
- puts 'Cancelled'
134
- end
135
- end
136
-
137
119
  desc 'Pull latest changes from cross_agent_tests repo'
138
120
  task :pull do
139
121
  command = " rsync -av --exclude .git #{CROSS_AGENT_TESTS_UPSTREAM_PATH}/ #{CROSS_AGENT_TESTS_LOCAL_PATH}/"
@@ -147,6 +129,7 @@ namespace :cross_agent_tests do
147
129
  end
148
130
  end
149
131
 
132
+ desc 'Start an interactive console session'
150
133
  task :console do
151
134
  require 'pry'
152
135
  require 'newrelic_rpm'
data/Thorfile 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/bin/nrdebug CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- # encoding: utf-8
4
3
  # This file is distributed under New Relic's license terms.
5
4
  # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
6
5
  # frozen_string_literal: true
@@ -97,11 +96,11 @@ class LinuxProcessDataProvider < ProcessDataProvider
97
96
  end
98
97
 
99
98
  def procline
100
- File.read(proc_path('cmdline')).gsub("\000", " ")
99
+ File.read(proc_path('cmdline')).tr("\000", " ")
101
100
  end
102
101
 
103
102
  def environment
104
- File.read(proc_path('environ')).gsub("\000", "\n")
103
+ File.read(proc_path('environ')).tr("\000", "\n")
105
104
  end
106
105
  end
107
106
 
@@ -134,8 +133,29 @@ class RubyProcess
134
133
  backtrace_file = Tempfile.new('nrdebug_ruby_bt')
135
134
  File.chmod(0666, backtrace_file.path)
136
135
 
137
- backtrace_gathering_code = 'Thread.list.each { |t| bt = t.backtrace rescue nil; puts \"#{t.inspect}\n#{bt && bt.join(\"\n\")}\n\n\" }'
138
- gdb_script_body = <<-END
136
+ body = gdb_script_body(backtrace_file)
137
+
138
+ script_file = write_script_file(body)
139
+
140
+ gdb_stderr = Tempfile.new('nrdebug_gdb_stderr')
141
+
142
+ gdb_cmd = "gdb -batch -x #{script_file.path} 2>#{gdb_stderr.path}"
143
+ gdb_output = ShellWrapper.execute(gdb_cmd)
144
+ ruby_backtrace = File.read(backtrace_file.path)
145
+
146
+ script_file.close!
147
+ backtrace_file.close!
148
+ gdb_stderr.close!
149
+
150
+ [gdb_output, ruby_backtrace]
151
+ end
152
+
153
+ private
154
+
155
+ def gdb_script_body(backtrace_file)
156
+ backtrace_gathering_code = 'Thread.list.each { |t| bt = t.backtrace rescue nil; ' \
157
+ 'puts \"#{t.inspect}\n#{bt && bt.join(\"\n\")}\n\n\" }'
158
+ <<-END
139
159
  attach #{pid}
140
160
  t a a bt
141
161
  call (void)close(1)
@@ -148,23 +168,14 @@ class RubyProcess
148
168
  call (void)fflush(0)
149
169
  quit
150
170
  END
151
- Logger.log("Using gdb script:\n#{gdb_script_body}")
171
+ end
152
172
 
173
+ def write_script_file(body)
174
+ Logger.log("Using gdb script:\n#{body}")
153
175
  script_file = Tempfile.new('nrdebug_gdb_script')
154
- script_file.write(gdb_script_body)
176
+ script_file.write(body)
155
177
  script_file.close
156
-
157
- gdb_stderr = Tempfile.new('nrdebug_gdb_stderr')
158
-
159
- gdb_cmd = "gdb -batch -x #{script_file.path} 2>#{gdb_stderr.path}"
160
- gdb_output = ShellWrapper.execute(gdb_cmd)
161
- ruby_backtrace = File.read(backtrace_file.path)
162
-
163
- script_file.close!
164
- backtrace_file.close!
165
- gdb_stderr.close!
166
-
167
- [gdb_output, ruby_backtrace]
178
+ script_file
168
179
  end
169
180
  end
170
181
 
@@ -201,18 +212,11 @@ class ProcessReport
201
212
 
202
213
  def generate
203
214
  open do |f|
204
- section(f, "Time") { Time.now }
205
- section(f, "PID") { @target.pid }
206
- section(f, "Command") { @target.procline }
207
- section(f, "RSS") { @target.rss }
208
- section(f, "CPU") { @target.cpu }
209
- section(f, "Parent PID") { @target.ppid }
210
- section(f, "OS") { ShellWrapper.execute('uname -a') }
211
- section(f, "Environment") { @target.environment }
215
+ add_environment_sections(f)
212
216
 
213
217
  section(f) do
214
218
  c_backtraces, ruby_backtraces = @target.gather_backtraces
215
- if c_backtraces.match(/could not attach/i)
219
+ if c_backtraces =~ /could not attach/i
216
220
  fail("Failed to attach to target process. Please try again with sudo.")
217
221
  end
218
222
  section(f, "C Backtraces") { c_backtraces }
@@ -226,23 +230,38 @@ class ProcessReport
226
230
  end
227
231
  end
228
232
  end
233
+
234
+ private
235
+
236
+ def add_environment_sections(handle)
237
+ section(handle, "Time") { Time.now }
238
+ section(handle, "PID") { @target.pid }
239
+ section(handle, "Command") { @target.procline }
240
+ section(handle, "RSS") { @target.rss }
241
+ section(handle, "CPU") { @target.cpu }
242
+ section(handle, "Parent PID") { @target.ppid }
243
+ section(handle, "OS") { ShellWrapper.execute('uname -a') }
244
+ section(handle, "Environment") { @target.environment }
245
+ end
229
246
  end
230
247
 
231
248
  def prompt_for_confirmation(target_pid, target_cmd)
232
- puts "Are you sure you want to attach to PID #{target_pid} ('#{target_cmd}')}?"
233
- puts ''
234
- puts '************************** !WARNING! **************************'
235
- puts "Extracting debug information from this process may cause it to CRASH OR HANG."
236
- puts ''
237
- puts "It is highly recommended that you only run this script against processes that"
238
- puts "are already unresponsive."
239
- puts ''
240
- puts "Additionally, the output may contain sensitive information from the program's"
241
- puts "command line arguments, environment, or open file list. Please examine the"
242
- puts "output before sharing it."
243
- puts '************************** !WARNING! **************************'
244
- puts ''
245
- puts "To continue, type 'continue':"
249
+ puts <<-PROMPT
250
+ Are you sure you want to attach to PID #{target_pid} ('#{target_cmd}')}?
251
+
252
+ ************************** !WARNING! **************************
253
+ Extracting debug information from this process may cause it to CRASH OR HANG.
254
+
255
+ It is highly recommended that you only run this script against processes that
256
+ are already unresponsive.
257
+
258
+ Additionally, the output may contain sensitive information from the program's
259
+ command line arguments, environment, or open file list. Please examine the
260
+ output before sharing it.
261
+ ************************** !WARNING! **************************
262
+
263
+ To continue, type 'continue':
264
+ PROMPT
246
265
 
247
266
  until $stdin.gets.strip == 'continue'
248
267
  puts "Please type 'continue' to continue, or ctrl-c to abort."
@@ -257,7 +276,8 @@ fail("Could not find gdb, please ensure it is installed and in your PATH") if gd
257
276
 
258
277
  target = RubyProcess.new(target_pid)
259
278
  if !target.attachable?
260
- fail("You do not appear to have permissions to attach to the target process.\nPlease check the process owner and try again with sudo if necessary")
279
+ fail("You do not appear to have permissions to attach to the target process.\nPlease check the process owner " \
280
+ 'and try again with sudo if necessary')
261
281
  end
262
282
  if !target.alive?
263
283
  fail("Could not find process with PID #{target_pid}")
data/config.dot CHANGED
@@ -90,7 +90,7 @@ digraph AgentEnabled {
90
90
  "Agent#log_seed_token"
91
91
  "Agent#log_error"
92
92
  "Agent#monitoring?"
93
- "Agent#check_trasaction_sampler_status"
93
+ "Agent#check_transaction_sampler_status"
94
94
  "Agent#check_sql_sampler_status"
95
95
  "Agent#config_transaction_tracer"
96
96
  "Agent#set_sql_recording!"
@@ -134,8 +134,8 @@ digraph AgentEnabled {
134
134
 
135
135
  "MetricFrame.update_apdex"
136
136
 
137
- "TranactionInfo#force_persist_sample?"
138
- "TranactionInfo#include_guid?"
137
+ "TransactionInfo#force_persist_sample?"
138
+ "TransactionInfo#include_guid?"
139
139
 
140
140
  "TransactionSampleBuilder#initialize"
141
141
  "TransactionSampleBuilder#set_transaction_info"
@@ -257,8 +257,8 @@ digraph AgentEnabled {
257
257
 
258
258
  "MetricFrame.update_apdex" -> "[apdex_t]"
259
259
 
260
- "TranactionInfo#force_persist_sample?" -> "[apdex_t]"
261
- "TranactionInfo#include_guid?" -> "[apdex_t]"
260
+ "TransactionInfo#force_persist_sample?" -> "[apdex_t]"
261
+ "TransactionInfo#include_guid?" -> "[apdex_t]"
262
262
 
263
263
  "TransactionSampleBuilder#initialize" -> "[transaction_tracer.limit_segments]"
264
264
  "TransactionSampleBuilder#set_transaction_info" -> "[capture_params]"
data/init.rb 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
@@ -15,7 +14,7 @@ require 'new_relic/control'
15
14
 
16
15
  # Initializer for the NewRelic Ruby Agent
17
16
 
18
- # After verison 2.0 of Rails we can access the configuration directly.
17
+ # After version 2.0 of Rails we can access the configuration directly.
19
18
  # We need it to add dev mode routes after initialization finished.
20
19
 
21
20
  begin
data/install.rb CHANGED
@@ -1,9 +1,8 @@
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
5
4
 
6
- if __FILE__ == $0 || $0 =~ /script\/plugin/ || File.basename($0) == 'rake'
5
+ if __FILE__ == $0 || $0.include?('script/plugin') || File.basename($0) == 'rake'
7
6
  $LOAD_PATH << File.expand_path(File.join(File.dirname(__FILE__), 'lib'))
8
7
  require 'new_relic/cli/command'
9
8
  begin
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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