newrelic_rpm 8.10.1 → 8.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (395) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/.rubocop.yml +20 -190
  4. data/.rubocop_todo.yml +11 -202
  5. data/.simplecov +6 -4
  6. data/Brewfile +1 -0
  7. data/CHANGELOG.md +113 -41
  8. data/Gemfile +0 -1
  9. data/README.md +1 -1
  10. data/Rakefile +3 -20
  11. data/Thorfile +0 -1
  12. data/bin/nrdebug +65 -43
  13. data/config.dot +5 -5
  14. data/docker-compose.yml +22 -0
  15. data/init.rb +1 -2
  16. data/install.rb +1 -2
  17. data/lib/new_relic/agent/adaptive_sampler.rb +0 -1
  18. data/lib/new_relic/agent/agent/shutdown.rb +1 -1
  19. data/lib/new_relic/agent/agent/special_startup.rb +2 -1
  20. data/lib/new_relic/agent/agent/start_worker_thread.rb +0 -1
  21. data/lib/new_relic/agent/agent/startup.rb +1 -1
  22. data/lib/new_relic/agent/agent.rb +100 -73
  23. data/lib/new_relic/agent/agent_logger.rb +4 -5
  24. data/lib/new_relic/agent/attribute_filter.rb +39 -21
  25. data/lib/new_relic/agent/attribute_processing.rb +3 -4
  26. data/lib/new_relic/agent/attributes.rb +1 -1
  27. data/lib/new_relic/agent/audit_logger.rb +3 -3
  28. data/lib/new_relic/agent/autostart.rb +0 -1
  29. data/lib/new_relic/agent/chained_call.rb +0 -1
  30. data/lib/new_relic/agent/commands/agent_command.rb +0 -1
  31. data/lib/new_relic/agent/commands/agent_command_router.rb +3 -4
  32. data/lib/new_relic/agent/commands/thread_profiler_session.rb +1 -1
  33. data/lib/new_relic/agent/configuration/default_source.rb +82 -31
  34. data/lib/new_relic/agent/configuration/dotted_hash.rb +2 -2
  35. data/lib/new_relic/agent/configuration/environment_source.rb +4 -4
  36. data/lib/new_relic/agent/configuration/event_harvest_config.rb +0 -1
  37. data/lib/new_relic/agent/configuration/high_security_source.rb +1 -1
  38. data/lib/new_relic/agent/configuration/manager.rb +4 -2
  39. data/lib/new_relic/agent/configuration/manual_source.rb +0 -1
  40. data/lib/new_relic/agent/configuration/mask_defaults.rb +2 -3
  41. data/lib/new_relic/agent/configuration/security_policy_source.rb +10 -1
  42. data/lib/new_relic/agent/configuration/server_source.rb +0 -1
  43. data/lib/new_relic/agent/configuration/yaml_source.rb +3 -3
  44. data/lib/new_relic/agent/configuration.rb +0 -1
  45. data/lib/new_relic/agent/connect/request_builder.rb +2 -2
  46. data/lib/new_relic/agent/connect/response_handler.rb +1 -2
  47. data/lib/new_relic/agent/custom_event_aggregator.rb +0 -1
  48. data/lib/new_relic/agent/database/explain_plan_helpers.rb +0 -1
  49. data/lib/new_relic/agent/database/obfuscation_helpers.rb +1 -1
  50. data/lib/new_relic/agent/database/obfuscator.rb +0 -1
  51. data/lib/new_relic/agent/database/postgres_explain_obfuscator.rb +0 -1
  52. data/lib/new_relic/agent/database.rb +20 -14
  53. data/lib/new_relic/agent/database_adapter.rb +2 -1
  54. data/lib/new_relic/agent/datastores/metric_helper.rb +0 -4
  55. data/lib/new_relic/agent/datastores/mongo/event_formatter.rb +5 -5
  56. data/lib/new_relic/agent/datastores/mongo/metric_translator.rb +2 -5
  57. data/lib/new_relic/agent/datastores/mongo.rb +0 -1
  58. data/lib/new_relic/agent/datastores/nosql_obfuscator.rb +41 -0
  59. data/lib/new_relic/agent/datastores/redis.rb +0 -1
  60. data/lib/new_relic/agent/datastores.rb +0 -1
  61. data/lib/new_relic/agent/deprecator.rb +0 -1
  62. data/lib/new_relic/agent/distributed_tracing/cross_app_payload.rb +0 -1
  63. data/lib/new_relic/agent/distributed_tracing/cross_app_tracing.rb +3 -1
  64. data/lib/new_relic/agent/distributed_tracing/distributed_trace_attributes.rb +3 -1
  65. data/lib/new_relic/agent/distributed_tracing/distributed_trace_metrics.rb +1 -1
  66. data/lib/new_relic/agent/distributed_tracing/distributed_trace_payload.rb +1 -2
  67. data/lib/new_relic/agent/distributed_tracing/distributed_trace_transport_type.rb +0 -1
  68. data/lib/new_relic/agent/distributed_tracing/trace_context.rb +1 -1
  69. data/lib/new_relic/agent/distributed_tracing/trace_context_payload.rb +0 -1
  70. data/lib/new_relic/agent/distributed_tracing.rb +0 -1
  71. data/lib/new_relic/agent/encoding_normalizer.rb +2 -1
  72. data/lib/new_relic/agent/error_collector.rb +3 -1
  73. data/lib/new_relic/agent/error_event_aggregator.rb +0 -1
  74. data/lib/new_relic/agent/error_filter.rb +5 -5
  75. data/lib/new_relic/agent/error_trace_aggregator.rb +2 -2
  76. data/lib/new_relic/agent/event_aggregator.rb +1 -1
  77. data/lib/new_relic/agent/event_buffer.rb +0 -1
  78. data/lib/new_relic/agent/event_listener.rb +0 -1
  79. data/lib/new_relic/agent/event_loop.rb +4 -3
  80. data/lib/new_relic/agent/external.rb +1 -2
  81. data/lib/new_relic/agent/guid_generator.rb +0 -1
  82. data/lib/new_relic/agent/harvester.rb +0 -1
  83. data/lib/new_relic/agent/heap.rb +2 -3
  84. data/lib/new_relic/agent/hostname.rb +0 -1
  85. data/lib/new_relic/agent/http_clients/abstract.rb +2 -1
  86. data/lib/new_relic/agent/http_clients/curb_wrappers.rb +0 -1
  87. data/lib/new_relic/agent/http_clients/excon_wrappers.rb +0 -1
  88. data/lib/new_relic/agent/http_clients/http_rb_wrappers.rb +1 -2
  89. data/lib/new_relic/agent/http_clients/httpclient_wrappers.rb +1 -2
  90. data/lib/new_relic/agent/http_clients/net_http_wrappers.rb +0 -1
  91. data/lib/new_relic/agent/http_clients/typhoeus_wrappers.rb +2 -2
  92. data/lib/new_relic/agent/http_clients/uri_util.rb +0 -1
  93. data/lib/new_relic/agent/instrumentation/action_cable_subscriber.rb +0 -1
  94. data/lib/new_relic/agent/instrumentation/action_controller_subscriber.rb +0 -1
  95. data/lib/new_relic/agent/instrumentation/action_view_subscriber.rb +1 -2
  96. data/lib/new_relic/agent/instrumentation/active_job.rb +0 -1
  97. data/lib/new_relic/agent/instrumentation/active_merchant.rb +3 -2
  98. data/lib/new_relic/agent/instrumentation/active_record.rb +0 -1
  99. data/lib/new_relic/agent/instrumentation/active_record_helper.rb +0 -1
  100. data/lib/new_relic/agent/instrumentation/active_record_notifications.rb +0 -1
  101. data/lib/new_relic/agent/instrumentation/active_record_prepend.rb +0 -1
  102. data/lib/new_relic/agent/instrumentation/active_record_subscriber.rb +0 -1
  103. data/lib/new_relic/agent/instrumentation/active_storage.rb +0 -1
  104. data/lib/new_relic/agent/instrumentation/active_storage_subscriber.rb +2 -1
  105. data/lib/new_relic/agent/instrumentation/active_support_logger/chain.rb +0 -1
  106. data/lib/new_relic/agent/instrumentation/active_support_logger/instrumentation.rb +0 -1
  107. data/lib/new_relic/agent/instrumentation/active_support_logger/prepend.rb +0 -1
  108. data/lib/new_relic/agent/instrumentation/active_support_logger.rb +0 -1
  109. data/lib/new_relic/agent/instrumentation/acts_as_solr.rb +1 -1
  110. data/lib/new_relic/agent/instrumentation/authlogic.rb +0 -1
  111. data/lib/new_relic/agent/instrumentation/bunny/chain.rb +0 -1
  112. data/lib/new_relic/agent/instrumentation/bunny/instrumentation.rb +0 -1
  113. data/lib/new_relic/agent/instrumentation/bunny/prepend.rb +0 -1
  114. data/lib/new_relic/agent/instrumentation/bunny.rb +0 -1
  115. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +3 -3
  116. data/lib/new_relic/agent/instrumentation/curb/chain.rb +0 -1
  117. data/lib/new_relic/agent/instrumentation/curb/instrumentation.rb +14 -11
  118. data/lib/new_relic/agent/instrumentation/curb/prepend.rb +0 -1
  119. data/lib/new_relic/agent/instrumentation/curb.rb +0 -1
  120. data/lib/new_relic/agent/instrumentation/data_mapper.rb +1 -2
  121. data/lib/new_relic/agent/instrumentation/delayed_job/chain.rb +0 -1
  122. data/lib/new_relic/agent/instrumentation/delayed_job/instrumentation.rb +0 -1
  123. data/lib/new_relic/agent/instrumentation/delayed_job/prepend.rb +0 -1
  124. data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +1 -1
  125. data/lib/new_relic/agent/instrumentation/elasticsearch/chain.rb +29 -0
  126. data/lib/new_relic/agent/instrumentation/elasticsearch/instrumentation.rb +66 -0
  127. data/lib/new_relic/agent/instrumentation/elasticsearch/prepend.rb +13 -0
  128. data/lib/new_relic/agent/instrumentation/elasticsearch.rb +31 -0
  129. data/lib/new_relic/agent/instrumentation/excon/middleware.rb +0 -1
  130. data/lib/new_relic/agent/instrumentation/excon.rb +0 -1
  131. data/lib/new_relic/agent/instrumentation/grape/chain.rb +0 -1
  132. data/lib/new_relic/agent/instrumentation/grape/instrumentation.rb +1 -1
  133. data/lib/new_relic/agent/instrumentation/grape/prepend.rb +0 -1
  134. data/lib/new_relic/agent/instrumentation/grape.rb +0 -1
  135. data/lib/new_relic/agent/instrumentation/grpc/client/chain.rb +0 -1
  136. data/lib/new_relic/agent/instrumentation/grpc/client/instrumentation.rb +0 -1
  137. data/lib/new_relic/agent/instrumentation/grpc/client/prepend.rb +0 -1
  138. data/lib/new_relic/agent/instrumentation/grpc/client/request_wrapper.rb +0 -1
  139. data/lib/new_relic/agent/instrumentation/grpc/helper.rb +0 -1
  140. data/lib/new_relic/agent/instrumentation/grpc/server/chain.rb +0 -1
  141. data/lib/new_relic/agent/instrumentation/grpc/server/instrumentation.rb +0 -1
  142. data/lib/new_relic/agent/instrumentation/grpc/server/rpc_desc_prepend.rb +0 -1
  143. data/lib/new_relic/agent/instrumentation/grpc/server/rpc_server_prepend.rb +0 -1
  144. data/lib/new_relic/agent/instrumentation/grpc_client.rb +0 -1
  145. data/lib/new_relic/agent/instrumentation/grpc_server.rb +0 -1
  146. data/lib/new_relic/agent/instrumentation/httpclient/chain.rb +0 -1
  147. data/lib/new_relic/agent/instrumentation/httpclient/instrumentation.rb +0 -1
  148. data/lib/new_relic/agent/instrumentation/httpclient/prepend.rb +0 -1
  149. data/lib/new_relic/agent/instrumentation/httpclient.rb +0 -1
  150. data/lib/new_relic/agent/instrumentation/httprb/chain.rb +0 -1
  151. data/lib/new_relic/agent/instrumentation/httprb/instrumentation.rb +0 -1
  152. data/lib/new_relic/agent/instrumentation/httprb/prepend.rb +0 -1
  153. data/lib/new_relic/agent/instrumentation/httprb.rb +0 -1
  154. data/lib/new_relic/agent/instrumentation/ignore_actions.rb +0 -1
  155. data/lib/new_relic/agent/instrumentation/logger/chain.rb +0 -1
  156. data/lib/new_relic/agent/instrumentation/logger/instrumentation.rb +4 -1
  157. data/lib/new_relic/agent/instrumentation/logger/prepend.rb +0 -1
  158. data/lib/new_relic/agent/instrumentation/logger.rb +0 -1
  159. data/lib/new_relic/agent/instrumentation/memcache/chain.rb +0 -1
  160. data/lib/new_relic/agent/instrumentation/memcache/dalli.rb +1 -2
  161. data/lib/new_relic/agent/instrumentation/memcache/helper.rb +0 -1
  162. data/lib/new_relic/agent/instrumentation/memcache/instrumentation.rb +0 -1
  163. data/lib/new_relic/agent/instrumentation/memcache/prepend.rb +1 -2
  164. data/lib/new_relic/agent/instrumentation/memcache.rb +4 -5
  165. data/lib/new_relic/agent/instrumentation/middleware_proxy.rb +1 -2
  166. data/lib/new_relic/agent/instrumentation/middleware_tracing.rb +0 -1
  167. data/lib/new_relic/agent/instrumentation/mongo.rb +0 -1
  168. data/lib/new_relic/agent/instrumentation/mongodb_command_subscriber.rb +3 -2
  169. data/lib/new_relic/agent/instrumentation/net_http/chain.rb +0 -1
  170. data/lib/new_relic/agent/instrumentation/net_http/instrumentation.rb +0 -1
  171. data/lib/new_relic/agent/instrumentation/net_http/prepend.rb +0 -1
  172. data/lib/new_relic/agent/instrumentation/net_http.rb +0 -1
  173. data/lib/new_relic/agent/instrumentation/notifications_subscriber.rb +4 -3
  174. data/lib/new_relic/agent/instrumentation/padrino/chain.rb +0 -1
  175. data/lib/new_relic/agent/instrumentation/padrino/instrumentation.rb +0 -1
  176. data/lib/new_relic/agent/instrumentation/padrino/prepend.rb +0 -1
  177. data/lib/new_relic/agent/instrumentation/padrino.rb +0 -1
  178. data/lib/new_relic/agent/instrumentation/passenger_instrumentation.rb +0 -1
  179. data/lib/new_relic/agent/instrumentation/queue_time.rb +0 -2
  180. data/lib/new_relic/agent/instrumentation/rack/chain.rb +0 -1
  181. data/lib/new_relic/agent/instrumentation/rack/helpers.rb +0 -1
  182. data/lib/new_relic/agent/instrumentation/rack/instrumentation.rb +3 -1
  183. data/lib/new_relic/agent/instrumentation/rack/prepend.rb +0 -1
  184. data/lib/new_relic/agent/instrumentation/rack.rb +0 -1
  185. data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +0 -1
  186. data/lib/new_relic/agent/instrumentation/rails_middleware.rb +0 -1
  187. data/lib/new_relic/agent/instrumentation/rails_notifications/action_cable.rb +0 -1
  188. data/lib/new_relic/agent/instrumentation/rails_notifications/action_controller.rb +0 -1
  189. data/lib/new_relic/agent/instrumentation/rails_notifications/action_view.rb +0 -1
  190. data/lib/new_relic/agent/instrumentation/rainbows_instrumentation.rb +0 -1
  191. data/lib/new_relic/agent/instrumentation/rake/chain.rb +0 -1
  192. data/lib/new_relic/agent/instrumentation/rake/instrumentation.rb +6 -1
  193. data/lib/new_relic/agent/instrumentation/rake/prepend.rb +0 -1
  194. data/lib/new_relic/agent/instrumentation/rake.rb +0 -1
  195. data/lib/new_relic/agent/instrumentation/redis/chain.rb +0 -1
  196. data/lib/new_relic/agent/instrumentation/redis/instrumentation.rb +0 -1
  197. data/lib/new_relic/agent/instrumentation/redis/prepend.rb +0 -1
  198. data/lib/new_relic/agent/instrumentation/redis.rb +0 -1
  199. data/lib/new_relic/agent/instrumentation/resque/chain.rb +0 -1
  200. data/lib/new_relic/agent/instrumentation/resque/helper.rb +0 -1
  201. data/lib/new_relic/agent/instrumentation/resque/instrumentation.rb +0 -1
  202. data/lib/new_relic/agent/instrumentation/resque/prepend.rb +0 -1
  203. data/lib/new_relic/agent/instrumentation/resque.rb +0 -1
  204. data/lib/new_relic/agent/instrumentation/sequel.rb +0 -1
  205. data/lib/new_relic/agent/instrumentation/sequel_helper.rb +0 -1
  206. data/lib/new_relic/agent/instrumentation/sidekiq.rb +2 -2
  207. data/lib/new_relic/agent/instrumentation/sinatra/chain.rb +0 -1
  208. data/lib/new_relic/agent/instrumentation/sinatra/ignorer.rb +0 -1
  209. data/lib/new_relic/agent/instrumentation/sinatra/instrumentation.rb +0 -1
  210. data/lib/new_relic/agent/instrumentation/sinatra/prepend.rb +0 -1
  211. data/lib/new_relic/agent/instrumentation/sinatra/transaction_namer.rb +0 -1
  212. data/lib/new_relic/agent/instrumentation/sinatra.rb +1 -1
  213. data/lib/new_relic/agent/instrumentation/sunspot.rb +0 -1
  214. data/lib/new_relic/agent/instrumentation/thread/chain.rb +0 -1
  215. data/lib/new_relic/agent/instrumentation/thread/instrumentation.rb +1 -1
  216. data/lib/new_relic/agent/instrumentation/thread/prepend.rb +0 -1
  217. data/lib/new_relic/agent/instrumentation/thread.rb +0 -1
  218. data/lib/new_relic/agent/instrumentation/tilt/chain.rb +0 -1
  219. data/lib/new_relic/agent/instrumentation/tilt/instrumentation.rb +1 -1
  220. data/lib/new_relic/agent/instrumentation/tilt/prepend.rb +0 -1
  221. data/lib/new_relic/agent/instrumentation/tilt.rb +0 -1
  222. data/lib/new_relic/agent/instrumentation/typhoeus/chain.rb +0 -1
  223. data/lib/new_relic/agent/instrumentation/typhoeus/instrumentation.rb +3 -4
  224. data/lib/new_relic/agent/instrumentation/typhoeus/prepend.rb +0 -1
  225. data/lib/new_relic/agent/instrumentation/typhoeus.rb +0 -1
  226. data/lib/new_relic/agent/instrumentation.rb +0 -1
  227. data/lib/new_relic/agent/internal_agent_error.rb +0 -1
  228. data/lib/new_relic/agent/javascript_instrumentor.rb +2 -2
  229. data/lib/new_relic/agent/linking_metadata.rb +0 -1
  230. data/lib/new_relic/agent/local_log_decorator.rb +1 -1
  231. data/lib/new_relic/agent/log_event_aggregator.rb +1 -1
  232. data/lib/new_relic/agent/log_once.rb +0 -1
  233. data/lib/new_relic/agent/log_priority.rb +0 -1
  234. data/lib/new_relic/agent/logging.rb +0 -1
  235. data/lib/new_relic/agent/memory_logger.rb +0 -1
  236. data/lib/new_relic/agent/messaging.rb +2 -2
  237. data/lib/new_relic/agent/method_tracer.rb +4 -1
  238. data/lib/new_relic/agent/method_tracer_helpers.rb +1 -2
  239. data/lib/new_relic/agent/monitors/cross_app_monitor.rb +0 -1
  240. data/lib/new_relic/agent/monitors/distributed_tracing_monitor.rb +1 -1
  241. data/lib/new_relic/agent/monitors/inbound_request_monitor.rb +0 -1
  242. data/lib/new_relic/agent/monitors/synthetics_monitor.rb +0 -1
  243. data/lib/new_relic/agent/monitors.rb +0 -1
  244. data/lib/new_relic/agent/new_relic_service/encoders.rb +0 -1
  245. data/lib/new_relic/agent/new_relic_service/json_marshaller.rb +0 -1
  246. data/lib/new_relic/agent/new_relic_service/marshaller.rb +0 -1
  247. data/lib/new_relic/agent/new_relic_service/security_policy_settings.rb +0 -1
  248. data/lib/new_relic/agent/new_relic_service.rb +195 -142
  249. data/lib/new_relic/agent/{noticible_error.rb → noticeable_error.rb} +1 -2
  250. data/lib/new_relic/agent/null_logger.rb +0 -1
  251. data/lib/new_relic/agent/obfuscator.rb +1 -2
  252. data/lib/new_relic/agent/parameter_filtering.rb +0 -1
  253. data/lib/new_relic/agent/payload_metric_mapping.rb +0 -1
  254. data/lib/new_relic/agent/pipe_channel_manager.rb +2 -1
  255. data/lib/new_relic/agent/pipe_service.rb +0 -1
  256. data/lib/new_relic/agent/prepend_supportability.rb +0 -1
  257. data/lib/new_relic/agent/priority_sampled_buffer.rb +2 -3
  258. data/lib/new_relic/agent/range_extensions.rb +0 -1
  259. data/lib/new_relic/agent/rules_engine/replacement_rule.rb +0 -1
  260. data/lib/new_relic/agent/rules_engine/segment_terms_rule.rb +0 -1
  261. data/lib/new_relic/agent/rules_engine.rb +1 -1
  262. data/lib/new_relic/agent/sampler.rb +0 -1
  263. data/lib/new_relic/agent/sampler_collection.rb +0 -1
  264. data/lib/new_relic/agent/samplers/cpu_sampler.rb +1 -1
  265. data/lib/new_relic/agent/samplers/delayed_job_sampler.rb +0 -1
  266. data/lib/new_relic/agent/samplers/memory_sampler.rb +10 -6
  267. data/lib/new_relic/agent/samplers/object_sampler.rb +0 -1
  268. data/lib/new_relic/agent/samplers/vm_sampler.rb +2 -1
  269. data/lib/new_relic/agent/span_event_aggregator.rb +0 -1
  270. data/lib/new_relic/agent/span_event_primitive.rb +1 -2
  271. data/lib/new_relic/agent/sql_sampler.rb +0 -1
  272. data/lib/new_relic/agent/stats.rb +13 -3
  273. data/lib/new_relic/agent/stats_engine/gc_profiler.rb +1 -2
  274. data/lib/new_relic/agent/stats_engine/stats_hash.rb +1 -2
  275. data/lib/new_relic/agent/stats_engine.rb +0 -1
  276. data/lib/new_relic/agent/synthetics_event_aggregator.rb +0 -1
  277. data/lib/new_relic/agent/system_info.rb +4 -2
  278. data/lib/new_relic/agent/threading/agent_thread.rb +3 -3
  279. data/lib/new_relic/agent/threading/backtrace_node.rb +0 -1
  280. data/lib/new_relic/agent/threading/backtrace_service.rb +1 -1
  281. data/lib/new_relic/agent/threading/thread_profile.rb +4 -2
  282. data/lib/new_relic/agent/timestamp_sampled_buffer.rb +0 -1
  283. data/lib/new_relic/agent/tracer.rb +6 -3
  284. data/lib/new_relic/agent/transaction/abstract_segment.rb +5 -3
  285. data/lib/new_relic/agent/transaction/datastore_segment.rb +3 -1
  286. data/lib/new_relic/agent/transaction/distributed_tracer.rb +4 -1
  287. data/lib/new_relic/agent/transaction/distributed_tracing.rb +1 -1
  288. data/lib/new_relic/agent/transaction/external_request_segment.rb +2 -2
  289. data/lib/new_relic/agent/transaction/message_broker_segment.rb +1 -1
  290. data/lib/new_relic/agent/transaction/request_attributes.rb +0 -1
  291. data/lib/new_relic/agent/transaction/segment.rb +1 -1
  292. data/lib/new_relic/agent/transaction/slowest_sample_buffer.rb +0 -1
  293. data/lib/new_relic/agent/transaction/synthetics_sample_buffer.rb +0 -1
  294. data/lib/new_relic/agent/transaction/trace.rb +4 -1
  295. data/lib/new_relic/agent/transaction/trace_builder.rb +0 -1
  296. data/lib/new_relic/agent/transaction/trace_context.rb +0 -1
  297. data/lib/new_relic/agent/transaction/trace_node.rb +3 -3
  298. data/lib/new_relic/agent/transaction/tracing.rb +0 -1
  299. data/lib/new_relic/agent/transaction/transaction_sample_buffer.rb +2 -2
  300. data/lib/new_relic/agent/transaction.rb +13 -5
  301. data/lib/new_relic/agent/transaction_error_primitive.rb +0 -1
  302. data/lib/new_relic/agent/transaction_event_aggregator.rb +1 -1
  303. data/lib/new_relic/agent/transaction_event_primitive.rb +0 -1
  304. data/lib/new_relic/agent/transaction_event_recorder.rb +1 -2
  305. data/lib/new_relic/agent/transaction_metrics.rb +1 -2
  306. data/lib/new_relic/agent/transaction_sampler.rb +0 -1
  307. data/lib/new_relic/agent/transaction_time_aggregator.rb +2 -2
  308. data/lib/new_relic/agent/utilization/aws.rb +0 -1
  309. data/lib/new_relic/agent/utilization/azure.rb +1 -2
  310. data/lib/new_relic/agent/utilization/gcp.rb +1 -2
  311. data/lib/new_relic/agent/utilization/pcf.rb +2 -2
  312. data/lib/new_relic/agent/utilization/vendor.rb +3 -2
  313. data/lib/new_relic/agent/utilization_data.rb +3 -1
  314. data/lib/new_relic/agent/vm/jruby_vm.rb +0 -1
  315. data/lib/new_relic/agent/vm/monotonic_gc_profiler.rb +0 -1
  316. data/lib/new_relic/agent/vm/mri_vm.rb +35 -23
  317. data/lib/new_relic/agent/vm/snapshot.rb +1 -2
  318. data/lib/new_relic/agent/vm.rb +0 -1
  319. data/lib/new_relic/agent/worker_loop.rb +0 -1
  320. data/lib/new_relic/agent.rb +17 -18
  321. data/lib/new_relic/cli/command.rb +1 -2
  322. data/lib/new_relic/cli/commands/deployments.rb +72 -21
  323. data/lib/new_relic/cli/commands/install.rb +1 -1
  324. data/lib/new_relic/coerce.rb +6 -1
  325. data/lib/new_relic/collection_helper.rb +2 -2
  326. data/lib/new_relic/constants.rb +0 -1
  327. data/lib/new_relic/control/class_methods.rb +0 -1
  328. data/lib/new_relic/control/frameworks/external.rb +0 -1
  329. data/lib/new_relic/control/frameworks/rails.rb +5 -1
  330. data/lib/new_relic/control/frameworks/rails3.rb +0 -1
  331. data/lib/new_relic/control/frameworks/rails4.rb +0 -1
  332. data/lib/new_relic/control/frameworks/rails_notifications.rb +0 -1
  333. data/lib/new_relic/control/frameworks/ruby.rb +0 -1
  334. data/lib/new_relic/control/frameworks/sinatra.rb +0 -1
  335. data/lib/new_relic/control/frameworks.rb +0 -1
  336. data/lib/new_relic/control/instance_methods.rb +17 -40
  337. data/lib/new_relic/control/instrumentation.rb +2 -1
  338. data/lib/new_relic/control/private_instance_methods.rb +48 -0
  339. data/lib/new_relic/control/server_methods.rb +0 -1
  340. data/lib/new_relic/control.rb +0 -1
  341. data/lib/new_relic/delayed_job_injection.rb +0 -1
  342. data/lib/new_relic/dependency_detection.rb +5 -4
  343. data/lib/new_relic/environment_report.rb +23 -14
  344. data/lib/new_relic/helper.rb +2 -2
  345. data/lib/new_relic/language_support.rb +3 -3
  346. data/lib/new_relic/latest_changes.rb +4 -4
  347. data/lib/new_relic/local_environment.rb +9 -4
  348. data/lib/new_relic/metric_data.rb +27 -22
  349. data/lib/new_relic/metric_spec.rb +2 -1
  350. data/lib/new_relic/noticed_error.rb +3 -6
  351. data/lib/new_relic/rack/agent_hooks.rb +0 -1
  352. data/lib/new_relic/rack/agent_middleware.rb +2 -1
  353. data/lib/new_relic/rack/browser_monitoring.rb +131 -123
  354. data/lib/new_relic/rack.rb +0 -1
  355. data/lib/new_relic/recipes/capistrano3.rb +2 -59
  356. data/lib/new_relic/recipes/capistrano_legacy.rb +1 -2
  357. data/lib/new_relic/recipes/helpers/send_deployment.rb +69 -0
  358. data/lib/new_relic/recipes.rb +0 -1
  359. data/lib/new_relic/supportability_helper.rb +1 -2
  360. data/lib/new_relic/traced_thread.rb +1 -1
  361. data/lib/new_relic/version.rb +2 -3
  362. data/lib/newrelic_rpm.rb +0 -1
  363. data/lib/sequel/extensions/newrelic_instrumentation.rb +2 -3
  364. data/lib/sequel/plugins/newrelic_instrumentation.rb +0 -1
  365. data/lib/tasks/all.rb +0 -1
  366. data/lib/tasks/config.rake +4 -113
  367. data/lib/tasks/coverage_report.rake +14 -19
  368. data/lib/tasks/{config.html.erb → helpers/config.html.erb} +0 -0
  369. data/lib/tasks/{config.text.erb → helpers/config.text.erb} +0 -0
  370. data/lib/tasks/helpers/format.rb +123 -0
  371. data/lib/tasks/helpers/matches.rb +12 -0
  372. data/lib/tasks/helpers/prompt.rb +24 -0
  373. data/lib/tasks/helpers/removers.rb +33 -0
  374. data/lib/tasks/install.rake +0 -1
  375. data/lib/tasks/instrumentation_generator/README.md +1 -1
  376. data/lib/tasks/instrumentation_generator/instrumentation.thor +45 -17
  377. data/lib/tasks/instrumentation_generator/templates/Envfile.tt +0 -1
  378. data/lib/tasks/instrumentation_generator/templates/chain.tt +2 -2
  379. data/lib/tasks/instrumentation_generator/templates/chain_method.tt +3 -2
  380. data/lib/tasks/instrumentation_generator/templates/dependency_detection.tt +0 -1
  381. data/lib/tasks/instrumentation_generator/templates/instrumentation.tt +2 -2
  382. data/lib/tasks/instrumentation_generator/templates/instrumentation_method.tt +1 -1
  383. data/lib/tasks/instrumentation_generator/templates/prepend.tt +1 -2
  384. data/lib/tasks/instrumentation_generator/templates/prepend_method.tt +1 -1
  385. data/lib/tasks/instrumentation_generator/templates/test.tt +1 -2
  386. data/lib/tasks/multiverse.rake +0 -1
  387. data/lib/tasks/multiverse.rb +3 -29
  388. data/lib/tasks/newrelic.rb +0 -1
  389. data/lib/tasks/tests.rake +3 -8
  390. data/newrelic.yml +23 -4
  391. data/newrelic_rpm.gemspec +8 -9
  392. data/recipes/newrelic.rb +0 -1
  393. data/test/agent_helper.rb +23 -35
  394. metadata +20 -80
  395. data/lib/new_relic/agent/datastores/mongo/obfuscator.rb +0 -44
data/CHANGELOG.md CHANGED
@@ -1,19 +1,92 @@
1
1
  # New Relic Ruby Agent Release Notes #
2
2
 
3
+ ## v8.12.0
4
+
5
+ Version 8.12.0 of the agent delivers new Elasticsearch instrumentation, increases the default number of recorded Custom Events, announces the deprecation of Ruby 2.3, and brings some valuable code cleanup.
6
+
7
+ * **Support for Elasticsearch instrumentation**
8
+
9
+ This release adds support to automatically instrument the [elasticsearch](https://rubygems.org/gems/elasticsearch) gem. Versions 7.x and 8.x are supported. [PR#1525](https://github.com/newrelic/newrelic-ruby-agent/pull/1525)
10
+
11
+ | Configuration name | Default | Behavior |
12
+ | ----------- | ----------- |----------- |
13
+ | `instrumentation.elasticsearch` | auto | Controls auto-instrumentation of the elasticsearch library at start up. May be one of `auto`, `prepend`, `chain`, `disabled`. |
14
+ | `elasticsearch.capture_queries` | true | If `true`, the agent captures Elasticsearch queries in transaction traces. |
15
+ | `elasticsearch.obfuscate_queries` | true | If `true`, the agent obfuscates Elasticsearch queries in transaction traces. |
16
+
17
+ * **Custom Event Limit Increase**
18
+
19
+ This version increases the default limit of custom events from 1000 events per minute to 3000 events per minute. In the scenario that custom events were being limited, this change will allow more custom events to be sent to New Relic. There is also a new configurable maximum limit of 100,000 events per minute. To change the limits, see the documentation for [max_samples_stored](https://docs.newrelic.com/docs/apm/agents/ruby-agent/configuration/ruby-agent-configuration/#custom_insights_events-max_samples_stored). To learn more about the change and how to determine if custom events are being dropped, see our Explorers Hub [post](https://discuss.newrelic.com/t/send-more-custom-events-with-the-latest-apm-agents/190497). [PR#1541](https://github.com/newrelic/newrelic-ruby-agent/pull/1541)
20
+
21
+ * **Deprecate support for Ruby 2.3**
22
+
23
+ Ruby 2.3 reached end of life on March 31, 2019. The Ruby agent has deprecated support for Ruby 2.3 and will make breaking changes for this version in its next major release, v9.0.0 (release date not yet planned). All 8.x.x versions of the agent will remain compatible with Ruby 2.3.
24
+
25
+ * **Cleanup: Remove orphaned code**
26
+
27
+ In both the agent and unit tests, changes have taken place over the years that have left certain bits of code unreachable. This orphaned code can complicate code maintenance and refactoring, so getting it squared away can be very helpful. Commmuniy member [@ohbarye](https://github.com/ohbarye) contributed two separate cleanup PRs for this release; one for the agent and one for the tests. [PR#1537](https://github.com/newrelic/newrelic-ruby-agent/pull/1537) [PR#1548](https://github.com/newrelic/newrelic-ruby-agent/pull/1548)
28
+
29
+ Thank you to [@ohbarye](https://github.com/ohbarye) for contributing this helpful cleanup!
30
+
31
+
32
+ ## v8.11.0
33
+
34
+ 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!
35
+
36
+
37
+ * **Added support for New Relic REST API v2 when using `newrelic deployments` command**
38
+
39
+ 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)
40
+
41
+ Thank you to [@Arkham](https://github.com/Arkham) for bringing this to our attention!
42
+
43
+
44
+ * **Cleanup: Performance tests, constants, rubocop-minitest assertions and refutations**
45
+
46
+ 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)
47
+
48
+ Thank you [@esquith](https://github.com/esquith) for these great contributions!
49
+
50
+
51
+ * **CI: Notify on a change from failure to success**
52
+
53
+ 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)
54
+
55
+ This is much appreciated! Thank you, [@luigieai](https://github.com/luigieai).
56
+
57
+
58
+ * **Spelling corrections**
59
+
60
+ 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)
61
+
62
+ Thank you very much, [@jsoref](https://github.com/jsoref)!
63
+
64
+
65
+ * **Ruby 3.2.0-preview2 compatibility**
66
+
67
+ 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)
68
+
69
+
70
+ * **Bugfix: Fix memory leak in the Curb instrumentation**
71
+
72
+ 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)
73
+
74
+ Many thanks for both the heads up on the issue and the fix, [@charkost](https://github.com/charkost)!
75
+
3
76
 
4
77
  ## v8.10.1
5
78
 
6
79
 
7
80
  * **Bugfix: Missing unscoped metrics when instrumentation.thread.tracing is enabled**
8
-
81
+
9
82
  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.
10
-
83
+
11
84
  Thank you to @texpert for providing details of their situation to help resolve the issue.
12
-
13
-
85
+
86
+
14
87
  * **Bugfix: gRPC instrumentation causes ArgumentError when other Google gems are present**
15
88
 
16
- 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.
89
+ 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.
17
90
 
18
91
  Thank you to @FeminismIsAwesome for bringing this issue to our attention.
19
92
 
@@ -41,7 +114,7 @@
41
114
 
42
115
  * **Performance: Rework timing range overlap calculations for multiple transaction segments**
43
116
 
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.
117
+ 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
118
 
46
119
 
47
120
  * **Performance: Make frozen string literals the default for the agent**
@@ -50,26 +123,26 @@
50
123
 
51
124
 
52
125
  * **Bugfix: Error when setting the yaml configuration with `transaction_tracer.transaction_threshold: apdex_f`**
53
-
54
- Originally, the agent was only checking the `transaction_tracer.transaction_threshold` from the newrelic.yml correctly if it was on two lines.
126
+
127
+ Originally, the agent was only checking the `transaction_tracer.transaction_threshold` from the newrelic.yml correctly if it was on two lines.
55
128
 
56
129
  Example:
57
130
 
58
131
  ```
59
132
  # newrelic.yml
60
133
  transaction_tracer:
61
- transaction_threshold: apdex_f
134
+ transaction_threshold: apdex_f
62
135
  ```
63
136
 
64
- When this was instead changed to be on one line, the agent was not able to correctly identify the value of apdex_f.
137
+ When this was instead changed to be on one line, the agent was not able to correctly identify the value of apdex_f.
65
138
 
66
139
  Example:
67
140
  ```
68
141
  # newrelic.yml
69
142
  transaction_tracer.transaction_threshold: apdex_f
70
143
  ```
71
- 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.
72
-
144
+ 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.
145
+
73
146
  Thank you to @oboxodo for bringing this to our attention.
74
147
 
75
148
 
@@ -78,10 +151,9 @@
78
151
  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
152
 
80
153
 
81
-
82
154
  ## v8.9.0
83
-
84
-
155
+
156
+
85
157
  * **Add support for Dalli 3.1.0 to Dalli 3.2.2**
86
158
 
87
159
  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.
@@ -93,9 +165,9 @@
93
165
 
94
166
  * **Bugfix: Use read_nonblock instead of read on pipe**
95
167
 
96
- 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.
168
+ 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.
169
+
97
170
 
98
-
99
171
  ## v8.8.0
100
172
 
101
173
  * **Support Makara database adapters with ActiveRecord**
@@ -119,7 +191,7 @@
119
191
 
120
192
  * **APM logs-in-context log forwarding on by default**
121
193
 
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).
194
+ 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
195
 
124
196
  * **Improved async support and Thread instrumentation**
125
197
 
@@ -128,7 +200,7 @@
128
200
  New configuration options included in this release:
129
201
  | Configuration name | Default | Behavior |
130
202
  | ----------- | ----------- |----------- |
131
- | `instrumentation.thread` | `auto` (enabled) | Allows the agent to correctly nest spans inside of an asyncronous transaction |
203
+ | `instrumentation.thread` | `auto` (enabled) | Allows the agent to correctly nest spans inside of an asynchronous transaction |
132
204
  | `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
205
 
134
206
  We'd like to thank @mikeantonelli for sharing a gist with us that provided our team with an entry point for this feature.
@@ -192,7 +264,7 @@
192
264
  * **Bugfix: Error events missing attributes when created outside of a transaction**
193
265
 
194
266
  Previously the agent was not assigning a priority to error events that were created by calling notice_error outside the scope of a transaction. This caused issues with sampling when the error event buffer was full, resulting in a `NoMethodError: undefined method '<' for nil:NilClass` in the newrelic_agent.log. This bugfix ensures that a priority is always assigned on error events so that the agent will be able to sample these error events correctly. Thank you to @olleolleolle for bringing this issue to our attention.
195
-
267
+
196
268
 
197
269
 
198
270
  ## v8.6.0
@@ -217,7 +289,7 @@
217
289
 
218
290
  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
291
 
220
- * **Bugfix: Curb - satify method_with_tracing's verb argument requirement**
292
+ * **Bugfix: Curb - satisfy method_with_tracing's verb argument requirement**
221
293
 
222
294
  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
295
 
@@ -399,7 +471,7 @@
399
471
 
400
472
  * **Update configuration option default value for `span_events.max_samples_stored` from 1000 to 2000**
401
473
 
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).
474
+ 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
475
 
404
476
  * **Agent now enforces server supplied maximum value for configuration option `span_events.max_samples_stored`**
405
477
 
@@ -473,7 +545,7 @@
473
545
 
474
546
  * **Bugfix: resolves "can't add a new key into hash during iteration" Errors**
475
547
 
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.
548
+ 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
549
 
478
550
  * **Bugfix: kwarg support fixed for Rack middleware instrumentation**
479
551
 
@@ -530,7 +602,7 @@
530
602
 
531
603
  * **Ruby Agent 6.x to 7.x Migration Guide Available**
532
604
 
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.
605
+ 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
606
 
535
607
  * **Ruby 2.0 and 2.1 Dropped**
536
608
 
@@ -649,7 +721,7 @@
649
721
  * **Default prepend_net_instrumentation to false**
650
722
 
651
723
  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.
724
+ unexpected compatibility issues.
653
725
 
654
726
  ## v6.14.0
655
727
 
@@ -659,14 +731,14 @@
659
731
 
660
732
  * **Bugfix: Delayed Job instrumentation fixed for Ruby 2.7+**
661
733
 
662
- Previously, the agent was erroneousy separating positional and keyword arguments on the instrumented method calls into
734
+ Previously, the agent was erroneously separating positional and keyword arguments on the instrumented method calls into
663
735
  Delayed Job's library. The led to Delayed job not auto-instrumenting correctly and has been fixed.
664
736
 
665
737
  * **Bugfix: Ruby 2.7+ methods sometimes erroneously attributed compiler warnings to the Agent's `add_method_tracer`**
666
738
 
667
739
  The specific edge cases presented are now fixed by this release of the agent. There are still some known corner-cases
668
740
  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.
741
+ method tracers and compiler warnings raised, please continue to submit small reproducible examples.
670
742
 
671
743
  * **Bugfix: Ruby 2.7+ fix for keyword arguments on Rack apps is unnecessary and removed**
672
744
 
@@ -683,14 +755,14 @@
683
755
 
684
756
  Previously, when a user specifies a `newrelic.yml.erb` and no `newrelic.yml` file, the agent fails to find
685
757
  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
758
+ means of configuring the agent programmatically. The `newrelic.yml.erb` filename is restored to the search
687
759
  path and will be utilized if present. NOTE: `newrelic.yml` still takes precedence over `newrelic.yml.erb` If found,
688
760
  the `.yml` file is used instead of the `.erb` file. Search directories and order of traversal remain unchanged.
689
761
 
690
762
  * **Bugfix: dependency detection of Redis now works without raising an exception**
691
763
 
692
764
  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`.
765
+ (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
766
 
695
767
  * **Bugfix: Gracefully handles NilClass as a Middleware Class when instrumenting**
696
768
 
@@ -815,10 +887,10 @@
815
887
  Additionally, a bug in recording the metric for "findAndModify" as all lowercased "findandmodify"
816
888
  for versions 2.1 through 2.5 was fixed.
817
889
 
818
- * **Bugfix: Priority Sampler causes crash in high throughput environents in rare cases**
890
+ * **Bugfix: Priority Sampler causes crash in high throughput environments in rare cases**
819
891
 
820
892
  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.
893
+ environments once capacity is reached and the sampling algorithm engages. This issue is fixed.
822
894
 
823
895
  * **Additional Transaction Information applied to Span Events**
824
896
 
@@ -1537,7 +1609,7 @@
1537
1609
 
1538
1610
  Prior to this version, using an SSL connection to New Relic was
1539
1611
  the default behavior, but could be overridden. SSL connections are
1540
- now enforced (not overrideable).
1612
+ now enforced (not overridable).
1541
1613
 
1542
1614
  * Additional security checking before trying to explain
1543
1615
  multi-statement SQL queries
@@ -1703,7 +1775,7 @@
1703
1775
  The agent will now collect slow SQL explain plans, if configured to, on
1704
1776
  connections using the PostGIS adapter. Thanks Ari Pollak for the contribution!
1705
1777
 
1706
- * Lazily intialize New Relic Config
1778
+ * Lazily initialize New Relic Config
1707
1779
 
1708
1780
  The agent will lazily initialize the New Relic config. This allows the agent
1709
1781
  to pickup configuration from environment variables set by dotenv and similar
@@ -1950,7 +2022,7 @@
1950
2022
  * Include ControllerInstrumentation module with ActiveSupport.on_load
1951
2023
 
1952
2024
  The agent will now use the `on_load :action_controller` hook to include
1953
- the ControllerInstrumentation module in to both the `Base` and `API`
2025
+ the ControllerInstrumentation module into both the `Base` and `API`
1954
2026
  classes of ActionController for Rails 5. This ensures that the proper
1955
2027
  load order is retained, minimizing side-effects of having the agent in
1956
2028
  an application.
@@ -1995,7 +2067,7 @@
1995
2067
  better compatibility between our ActiveRecord Instrumentation and
1996
2068
  other third party gems that modify ActiveRecord using `Module#prepend`.
1997
2069
 
1998
- * Use license key passed in to NewRelic::Agent.manual_start
2070
+ * Use license key passed into NewRelic::Agent.manual_start
1999
2071
 
2000
2072
  Previously, the license key passed in when manually starting the agent
2001
2073
  with NewRelic::Agent.manual_start was not referenced when setting up
@@ -3128,7 +3200,7 @@
3128
3200
  runtime relative to the directory that the host process is started from.
3129
3201
 
3130
3202
  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
3203
+ root directory (for example, if the process is started from '/'), it will
3132
3204
  now also attempt to locate its configuration file based on the value of
3133
3205
  Rails.root for Rails applications.
3134
3206
 
@@ -3177,7 +3249,7 @@
3177
3249
  Rack::Builder, or via Rails' middleware stack in Rails 3.0+.
3178
3250
 
3179
3251
  This instrumentation may be disabled with the
3180
- disable_middlware_instrumentation configuration setting.
3252
+ disable_middleware_instrumentation configuration setting.
3181
3253
 
3182
3254
  For more details, see the documentation for this feature:
3183
3255
 
@@ -3315,7 +3387,7 @@
3315
3387
  * Separate in-transaction GC timings for web and background processes
3316
3388
 
3317
3389
  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
3390
+ background processes reporting into it would show an overly inflated GC band
3319
3391
  on the application overview graph, because data from both web and non-web
3320
3392
  transactions would be included. This has been fixed, and GC time during web
3321
3393
  and non-web transactions is now tracked separately.
@@ -3543,7 +3615,7 @@
3543
3615
 
3544
3616
  The agent's ActiveRecord 4.0 instrumentation could not gather SQL explain
3545
3617
  plans on JRuby by default because of a dependency on ObjectSpace, which isn't
3546
- avialable by default. This has been fixed.
3618
+ available by default. This has been fixed.
3547
3619
 
3548
3620
  * Fix for Curb http_put_with_newrelic
3549
3621
 
@@ -4176,7 +4248,7 @@
4176
4248
 
4177
4249
  * corrupt marshal data from pipe children crashing agent
4178
4250
 
4179
- If the agent received corrupted data from the Reqsue worker child agent
4251
+ If the agent received corrupted data from the Resque worker child agent
4180
4252
  it could crash the agent itself. fixed.
4181
4253
 
4182
4254
  * should reset RubyBench GC counter between polls
@@ -4230,7 +4302,7 @@
4230
4302
  * fix for issues with RAILS_ROOT deprecation warnings
4231
4303
  * fixed incorrect 1.9 GC time reporting
4232
4304
  * obfuscation for Slow SQL queries respects transaction trace config
4233
- * fix for RUM instrumentation repoting bad timing info in some cases
4305
+ * fix for RUM instrumentation reporting bad timing info in some cases
4234
4306
  * refactored ActiveRecord instrumentation, no longer requires Rails
4235
4307
 
4236
4308
  ## 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,20 +212,14 @@ 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
222
+
218
223
  section(f, "C Backtraces") { c_backtraces }
219
224
  section(f, "Ruby Backtrace(s)") { ruby_backtraces }
220
225
  end
@@ -226,23 +231,38 @@ class ProcessReport
226
231
  end
227
232
  end
228
233
  end
234
+
235
+ private
236
+
237
+ def add_environment_sections(handle)
238
+ section(handle, "Time") { Time.now }
239
+ section(handle, "PID") { @target.pid }
240
+ section(handle, "Command") { @target.procline }
241
+ section(handle, "RSS") { @target.rss }
242
+ section(handle, "CPU") { @target.cpu }
243
+ section(handle, "Parent PID") { @target.ppid }
244
+ section(handle, "OS") { ShellWrapper.execute('uname -a') }
245
+ section(handle, "Environment") { @target.environment }
246
+ end
229
247
  end
230
248
 
231
249
  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':"
250
+ puts <<-PROMPT
251
+ Are you sure you want to attach to PID #{target_pid} ('#{target_cmd}')}?
252
+
253
+ ************************** !WARNING! **************************
254
+ Extracting debug information from this process may cause it to CRASH OR HANG.
255
+
256
+ It is highly recommended that you only run this script against processes that
257
+ are already unresponsive.
258
+
259
+ Additionally, the output may contain sensitive information from the program's
260
+ command line arguments, environment, or open file list. Please examine the
261
+ output before sharing it.
262
+ ************************** !WARNING! **************************
263
+
264
+ To continue, type 'continue':
265
+ PROMPT
246
266
 
247
267
  until $stdin.gets.strip == 'continue'
248
268
  puts "Please type 'continue' to continue, or ctrl-c to abort."
@@ -257,11 +277,13 @@ fail("Could not find gdb, please ensure it is installed and in your PATH") if gd
257
277
 
258
278
  target = RubyProcess.new(target_pid)
259
279
  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")
280
+ fail("You do not appear to have permissions to attach to the target process.\nPlease check the process owner " \
281
+ 'and try again with sudo if necessary')
261
282
  end
262
283
  if !target.alive?
263
284
  fail("Could not find process with PID #{target_pid}")
264
285
  end
286
+
265
287
  target_cmd = target.procline
266
288
 
267
289
  prompt_for_confirmation(target_pid, target_cmd)
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]"