newrelic_rpm 5.5.0.348 → 7.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (364) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +9 -0
  3. data/.yardopts +1 -0
  4. data/CHANGELOG.md +931 -0
  5. data/CONTRIBUTING.md +117 -19
  6. data/Gemfile +6 -2
  7. data/Guardfile +18 -1
  8. data/LICENSE +208 -38
  9. data/README.md +80 -84
  10. data/ROADMAP.md +24 -0
  11. data/Rakefile +2 -0
  12. data/THIRD_PARTY_NOTICES.md +213 -0
  13. data/bin/nrdebug +1 -1
  14. data/config.dot +1 -0
  15. data/init.rb +1 -1
  16. data/install.rb +1 -1
  17. data/lib/new_relic/agent.rb +111 -20
  18. data/lib/new_relic/agent/adaptive_sampler.rb +1 -1
  19. data/lib/new_relic/agent/agent.rb +182 -194
  20. data/lib/new_relic/agent/agent_logger.rb +5 -1
  21. data/lib/new_relic/agent/attribute_filter.rb +85 -25
  22. data/lib/new_relic/agent/attribute_processing.rb +1 -1
  23. data/lib/new_relic/agent/attributes.rb +152 -0
  24. data/lib/new_relic/agent/audit_logger.rb +11 -1
  25. data/lib/new_relic/agent/autostart.rb +19 -15
  26. data/lib/new_relic/agent/chained_call.rb +1 -1
  27. data/lib/new_relic/agent/commands/agent_command.rb +1 -1
  28. data/lib/new_relic/agent/commands/agent_command_router.rb +3 -22
  29. data/lib/new_relic/agent/commands/thread_profiler_session.rb +1 -1
  30. data/lib/new_relic/agent/configuration.rb +1 -1
  31. data/lib/new_relic/agent/configuration/default_source.rb +656 -188
  32. data/lib/new_relic/agent/configuration/dotted_hash.rb +1 -1
  33. data/lib/new_relic/agent/configuration/environment_source.rb +5 -3
  34. data/lib/new_relic/agent/configuration/event_harvest_config.rb +45 -0
  35. data/lib/new_relic/agent/configuration/high_security_source.rb +2 -1
  36. data/lib/new_relic/agent/configuration/manager.rb +17 -13
  37. data/lib/new_relic/agent/configuration/manual_source.rb +1 -1
  38. data/lib/new_relic/agent/configuration/mask_defaults.rb +1 -1
  39. data/lib/new_relic/agent/configuration/security_policy_source.rb +15 -1
  40. data/lib/new_relic/agent/configuration/server_source.rb +39 -4
  41. data/lib/new_relic/agent/configuration/yaml_source.rb +12 -7
  42. data/lib/new_relic/agent/connect/request_builder.rb +63 -0
  43. data/lib/new_relic/agent/connect/response_handler.rb +61 -0
  44. data/lib/new_relic/agent/custom_event_aggregator.rb +1 -1
  45. data/lib/new_relic/agent/database.rb +2 -3
  46. data/lib/new_relic/agent/database/explain_plan_helpers.rb +1 -1
  47. data/lib/new_relic/agent/database/obfuscation_helpers.rb +2 -2
  48. data/lib/new_relic/agent/database/obfuscator.rb +1 -1
  49. data/lib/new_relic/agent/database/postgres_explain_obfuscator.rb +1 -1
  50. data/lib/new_relic/agent/database_adapter.rb +33 -0
  51. data/lib/new_relic/agent/datastores.rb +7 -9
  52. data/lib/new_relic/agent/datastores/metric_helper.rb +2 -3
  53. data/lib/new_relic/agent/datastores/mongo.rb +2 -2
  54. data/lib/new_relic/agent/datastores/mongo/event_formatter.rb +3 -3
  55. data/lib/new_relic/agent/datastores/mongo/metric_translator.rb +1 -1
  56. data/lib/new_relic/agent/datastores/mongo/obfuscator.rb +9 -9
  57. data/lib/new_relic/agent/datastores/mongo/statement_formatter.rb +1 -1
  58. data/lib/new_relic/agent/datastores/redis.rb +1 -5
  59. data/lib/new_relic/agent/deprecator.rb +1 -1
  60. data/lib/new_relic/agent/distributed_tracing.rb +115 -32
  61. data/lib/new_relic/agent/{cross_app_payload.rb → distributed_tracing/cross_app_payload.rb} +3 -2
  62. data/lib/new_relic/agent/{cross_app_tracing.rb → distributed_tracing/cross_app_tracing.rb} +61 -46
  63. data/lib/new_relic/agent/distributed_tracing/distributed_trace_attributes.rb +84 -0
  64. data/lib/new_relic/agent/distributed_tracing/distributed_trace_metrics.rb +75 -0
  65. data/lib/new_relic/agent/{distributed_trace_payload.rb → distributed_tracing/distributed_trace_payload.rb} +32 -113
  66. data/lib/new_relic/agent/distributed_tracing/distributed_trace_transport_type.rb +39 -0
  67. data/lib/new_relic/agent/distributed_tracing/trace_context.rb +246 -0
  68. data/lib/new_relic/agent/distributed_tracing/trace_context_payload.rb +126 -0
  69. data/lib/new_relic/agent/encoding_normalizer.rb +1 -1
  70. data/lib/new_relic/agent/error_collector.rb +88 -58
  71. data/lib/new_relic/agent/error_event_aggregator.rb +10 -7
  72. data/lib/new_relic/agent/error_filter.rb +167 -0
  73. data/lib/new_relic/agent/error_trace_aggregator.rb +2 -1
  74. data/lib/new_relic/agent/event_aggregator.rb +27 -33
  75. data/lib/new_relic/agent/event_buffer.rb +1 -1
  76. data/lib/new_relic/agent/event_listener.rb +1 -1
  77. data/lib/new_relic/agent/event_loop.rb +1 -1
  78. data/lib/new_relic/agent/external.rb +13 -11
  79. data/lib/new_relic/agent/guid_generator.rb +28 -0
  80. data/lib/new_relic/agent/harvester.rb +1 -1
  81. data/lib/new_relic/agent/heap.rb +1 -1
  82. data/lib/new_relic/agent/hostname.rb +16 -2
  83. data/lib/new_relic/agent/http_clients/abstract.rb +82 -0
  84. data/lib/new_relic/agent/http_clients/curb_wrappers.rb +25 -20
  85. data/lib/new_relic/agent/http_clients/excon_wrappers.rb +29 -14
  86. data/lib/new_relic/agent/http_clients/http_rb_wrappers.rb +18 -22
  87. data/lib/new_relic/agent/http_clients/httpclient_wrappers.rb +11 -12
  88. data/lib/new_relic/agent/http_clients/net_http_wrappers.rb +17 -5
  89. data/lib/new_relic/agent/http_clients/typhoeus_wrappers.rb +5 -7
  90. data/lib/new_relic/agent/http_clients/uri_util.rb +12 -11
  91. data/lib/new_relic/agent/instrumentation.rb +1 -1
  92. data/lib/new_relic/agent/instrumentation/action_cable_subscriber.rb +26 -43
  93. data/lib/new_relic/agent/instrumentation/action_controller_subscriber.rb +53 -73
  94. data/lib/new_relic/agent/instrumentation/action_view_subscriber.rb +81 -56
  95. data/lib/new_relic/agent/instrumentation/active_job.rb +7 -8
  96. data/lib/new_relic/agent/instrumentation/active_merchant.rb +1 -1
  97. data/lib/new_relic/agent/instrumentation/active_record.rb +85 -38
  98. data/lib/new_relic/agent/instrumentation/active_record_helper.rb +17 -6
  99. data/lib/new_relic/agent/instrumentation/active_record_notifications.rb +152 -0
  100. data/lib/new_relic/agent/instrumentation/active_record_prepend.rb +35 -11
  101. data/lib/new_relic/agent/instrumentation/active_record_subscriber.rb +47 -51
  102. data/lib/new_relic/agent/instrumentation/active_storage.rb +23 -0
  103. data/lib/new_relic/agent/instrumentation/active_storage_subscriber.rb +63 -0
  104. data/lib/new_relic/agent/instrumentation/acts_as_solr.rb +10 -9
  105. data/lib/new_relic/agent/instrumentation/authlogic.rb +1 -1
  106. data/lib/new_relic/agent/instrumentation/bunny.rb +13 -132
  107. data/lib/new_relic/agent/instrumentation/bunny/chain.rb +45 -0
  108. data/lib/new_relic/agent/instrumentation/bunny/instrumentation.rb +152 -0
  109. data/lib/new_relic/agent/instrumentation/bunny/prepend.rb +35 -0
  110. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +11 -4
  111. data/lib/new_relic/agent/instrumentation/curb.rb +11 -183
  112. data/lib/new_relic/agent/instrumentation/curb/chain.rb +93 -0
  113. data/lib/new_relic/agent/instrumentation/curb/instrumentation.rb +222 -0
  114. data/lib/new_relic/agent/instrumentation/curb/prepend.rb +63 -0
  115. data/lib/new_relic/agent/instrumentation/data_mapper.rb +5 -3
  116. data/lib/new_relic/agent/instrumentation/delayed_job/chain.rb +38 -0
  117. data/lib/new_relic/agent/instrumentation/delayed_job/instrumentation.rb +53 -0
  118. data/lib/new_relic/agent/instrumentation/delayed_job/prepend.rb +34 -0
  119. data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +9 -49
  120. data/lib/new_relic/agent/instrumentation/excon.rb +4 -3
  121. data/lib/new_relic/agent/instrumentation/excon/connection.rb +8 -5
  122. data/lib/new_relic/agent/instrumentation/excon/middleware.rb +3 -2
  123. data/lib/new_relic/agent/instrumentation/grape.rb +14 -107
  124. data/lib/new_relic/agent/instrumentation/grape/chain.rb +25 -0
  125. data/lib/new_relic/agent/instrumentation/grape/instrumentation.rb +100 -0
  126. data/lib/new_relic/agent/instrumentation/grape/prepend.rb +17 -0
  127. data/lib/new_relic/agent/instrumentation/httpclient.rb +10 -30
  128. data/lib/new_relic/agent/instrumentation/httpclient/chain.rb +25 -0
  129. data/lib/new_relic/agent/instrumentation/httpclient/instrumentation.rb +38 -0
  130. data/lib/new_relic/agent/instrumentation/httpclient/prepend.rb +17 -0
  131. data/lib/new_relic/agent/instrumentation/httprb.rb +29 -0
  132. data/lib/new_relic/agent/instrumentation/httprb/chain.rb +22 -0
  133. data/lib/new_relic/agent/instrumentation/httprb/instrumentation.rb +30 -0
  134. data/lib/new_relic/agent/instrumentation/httprb/prepend.rb +15 -0
  135. data/lib/new_relic/agent/instrumentation/ignore_actions.rb +1 -1
  136. data/lib/new_relic/agent/instrumentation/memcache.rb +55 -68
  137. data/lib/new_relic/agent/instrumentation/memcache/chain.rb +16 -0
  138. data/lib/new_relic/agent/instrumentation/memcache/dalli.rb +39 -118
  139. data/lib/new_relic/agent/instrumentation/memcache/helper.rb +56 -0
  140. data/lib/new_relic/agent/instrumentation/memcache/instrumentation.rb +88 -0
  141. data/lib/new_relic/agent/instrumentation/memcache/prepend.rb +88 -0
  142. data/lib/new_relic/agent/instrumentation/merb/controller.rb +1 -1
  143. data/lib/new_relic/agent/instrumentation/merb/errors.rb +1 -1
  144. data/lib/new_relic/agent/instrumentation/middleware_proxy.rb +4 -2
  145. data/lib/new_relic/agent/instrumentation/middleware_tracing.rb +20 -11
  146. data/lib/new_relic/agent/instrumentation/mongo.rb +17 -4
  147. data/lib/new_relic/agent/instrumentation/mongodb_command_subscriber.rb +36 -3
  148. data/lib/new_relic/agent/instrumentation/net_http.rb +44 -0
  149. data/lib/new_relic/agent/instrumentation/net_http/chain.rb +25 -0
  150. data/lib/new_relic/agent/instrumentation/net_http/instrumentation.rb +40 -0
  151. data/lib/new_relic/agent/instrumentation/net_http/prepend.rb +21 -0
  152. data/lib/new_relic/agent/instrumentation/notifications_subscriber.rb +100 -0
  153. data/lib/new_relic/agent/instrumentation/padrino.rb +19 -52
  154. data/lib/new_relic/agent/instrumentation/padrino/chain.rb +34 -0
  155. data/lib/new_relic/agent/instrumentation/padrino/instrumentation.rb +27 -0
  156. data/lib/new_relic/agent/instrumentation/padrino/prepend.rb +20 -0
  157. data/lib/new_relic/agent/instrumentation/passenger_instrumentation.rb +1 -1
  158. data/lib/new_relic/agent/instrumentation/queue_time.rb +1 -1
  159. data/lib/new_relic/agent/instrumentation/rack.rb +30 -138
  160. data/lib/new_relic/agent/instrumentation/rack/chain.rb +58 -0
  161. data/lib/new_relic/agent/instrumentation/rack/helpers.rb +32 -0
  162. data/lib/new_relic/agent/instrumentation/rack/instrumentation.rb +73 -0
  163. data/lib/new_relic/agent/instrumentation/rack/prepend.rb +37 -0
  164. data/lib/new_relic/agent/instrumentation/rails/action_controller.rb +1 -1
  165. data/lib/new_relic/agent/instrumentation/rails/action_web_service.rb +1 -1
  166. data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +1 -1
  167. data/lib/new_relic/agent/instrumentation/rails_middleware.rb +1 -1
  168. data/lib/new_relic/agent/instrumentation/{rails5 → rails_notifications}/action_cable.rb +6 -7
  169. data/lib/new_relic/agent/instrumentation/{rails5 → rails_notifications}/action_controller.rb +4 -4
  170. data/lib/new_relic/agent/instrumentation/{rails4 → rails_notifications}/action_view.rb +4 -4
  171. data/lib/new_relic/agent/instrumentation/rainbows_instrumentation.rb +1 -1
  172. data/lib/new_relic/agent/instrumentation/rake.rb +14 -155
  173. data/lib/new_relic/agent/instrumentation/rake/chain.rb +25 -0
  174. data/lib/new_relic/agent/instrumentation/rake/instrumentation.rb +144 -0
  175. data/lib/new_relic/agent/instrumentation/rake/prepend.rb +14 -0
  176. data/lib/new_relic/agent/instrumentation/redis.rb +13 -102
  177. data/lib/new_relic/agent/instrumentation/redis/chain.rb +34 -0
  178. data/lib/new_relic/agent/instrumentation/redis/instrumentation.rb +65 -0
  179. data/lib/new_relic/agent/instrumentation/redis/prepend.rb +24 -0
  180. data/lib/new_relic/agent/instrumentation/resque.rb +22 -30
  181. data/lib/new_relic/agent/instrumentation/resque/chain.rb +22 -0
  182. data/lib/new_relic/agent/instrumentation/resque/helper.rb +19 -0
  183. data/lib/new_relic/agent/instrumentation/resque/instrumentation.rb +35 -0
  184. data/lib/new_relic/agent/instrumentation/resque/prepend.rb +16 -0
  185. data/lib/new_relic/agent/instrumentation/sequel.rb +2 -2
  186. data/lib/new_relic/agent/instrumentation/sequel_helper.rb +1 -1
  187. data/lib/new_relic/agent/instrumentation/sidekiq.rb +48 -24
  188. data/lib/new_relic/agent/instrumentation/sinatra.rb +21 -160
  189. data/lib/new_relic/agent/instrumentation/sinatra/chain.rb +55 -0
  190. data/lib/new_relic/agent/instrumentation/sinatra/ignorer.rb +30 -35
  191. data/lib/new_relic/agent/instrumentation/sinatra/instrumentation.rb +124 -0
  192. data/lib/new_relic/agent/instrumentation/sinatra/prepend.rb +33 -0
  193. data/lib/new_relic/agent/instrumentation/sinatra/transaction_namer.rb +1 -1
  194. data/lib/new_relic/agent/instrumentation/sunspot.rb +1 -1
  195. data/lib/new_relic/agent/instrumentation/typhoeus.rb +12 -74
  196. data/lib/new_relic/agent/instrumentation/typhoeus/chain.rb +22 -0
  197. data/lib/new_relic/agent/instrumentation/typhoeus/instrumentation.rb +82 -0
  198. data/lib/new_relic/agent/instrumentation/typhoeus/prepend.rb +14 -0
  199. data/lib/new_relic/agent/internal_agent_error.rb +1 -1
  200. data/lib/new_relic/agent/javascript_instrumentor.rb +15 -10
  201. data/lib/new_relic/agent/log_once.rb +1 -1
  202. data/lib/new_relic/agent/logging.rb +139 -0
  203. data/lib/new_relic/agent/memory_logger.rb +1 -1
  204. data/lib/new_relic/agent/messaging.rb +15 -82
  205. data/lib/new_relic/agent/method_tracer.rb +10 -8
  206. data/lib/new_relic/agent/method_tracer_helpers.rb +5 -5
  207. data/lib/new_relic/agent/monitors.rb +27 -0
  208. data/lib/new_relic/agent/monitors/cross_app_monitor.rb +110 -0
  209. data/lib/new_relic/agent/monitors/distributed_tracing_monitor.rb +27 -0
  210. data/lib/new_relic/agent/{inbound_request_monitor.rb → monitors/inbound_request_monitor.rb} +4 -4
  211. data/lib/new_relic/agent/{synthetics_monitor.rb → monitors/synthetics_monitor.rb} +4 -7
  212. data/lib/new_relic/agent/new_relic_service.rb +106 -40
  213. data/lib/new_relic/agent/new_relic_service/encoders.rb +1 -1
  214. data/lib/new_relic/agent/new_relic_service/json_marshaller.rb +1 -2
  215. data/lib/new_relic/agent/new_relic_service/marshaller.rb +6 -27
  216. data/lib/new_relic/agent/new_relic_service/security_policy_settings.rb +1 -1
  217. data/lib/new_relic/agent/noticible_error.rb +22 -0
  218. data/lib/new_relic/agent/null_logger.rb +1 -1
  219. data/lib/new_relic/agent/obfuscator.rb +1 -1
  220. data/lib/new_relic/agent/parameter_filtering.rb +19 -6
  221. data/lib/new_relic/agent/payload_metric_mapping.rb +1 -1
  222. data/lib/new_relic/agent/pipe_channel_manager.rb +1 -1
  223. data/lib/new_relic/agent/pipe_service.rb +1 -1
  224. data/lib/new_relic/agent/prepend_supportability.rb +1 -1
  225. data/lib/new_relic/agent/priority_sampled_buffer.rb +9 -4
  226. data/lib/new_relic/agent/range_extensions.rb +1 -1
  227. data/lib/new_relic/agent/rules_engine.rb +1 -1
  228. data/lib/new_relic/agent/rules_engine/replacement_rule.rb +1 -1
  229. data/lib/new_relic/agent/rules_engine/segment_terms_rule.rb +1 -1
  230. data/lib/new_relic/agent/sampler.rb +1 -1
  231. data/lib/new_relic/agent/sampler_collection.rb +1 -1
  232. data/lib/new_relic/agent/samplers/cpu_sampler.rb +1 -1
  233. data/lib/new_relic/agent/samplers/delayed_job_sampler.rb +1 -1
  234. data/lib/new_relic/agent/samplers/memory_sampler.rb +2 -2
  235. data/lib/new_relic/agent/samplers/object_sampler.rb +1 -1
  236. data/lib/new_relic/agent/samplers/vm_sampler.rb +1 -1
  237. data/lib/new_relic/agent/span_event_aggregator.rb +3 -5
  238. data/lib/new_relic/agent/span_event_primitive.rb +129 -65
  239. data/lib/new_relic/agent/sql_sampler.rb +12 -12
  240. data/lib/new_relic/agent/stats.rb +1 -1
  241. data/lib/new_relic/agent/stats_engine.rb +3 -3
  242. data/lib/new_relic/agent/stats_engine/gc_profiler.rb +2 -2
  243. data/lib/new_relic/agent/stats_engine/stats_hash.rb +1 -1
  244. data/lib/new_relic/agent/supported_versions.rb +3 -3
  245. data/lib/new_relic/agent/synthetics_event_aggregator.rb +1 -1
  246. data/lib/new_relic/agent/system_info.rb +18 -4
  247. data/lib/new_relic/agent/threading/agent_thread.rb +2 -2
  248. data/lib/new_relic/agent/threading/backtrace_node.rb +1 -1
  249. data/lib/new_relic/agent/threading/backtrace_service.rb +4 -4
  250. data/lib/new_relic/agent/threading/thread_profile.rb +10 -24
  251. data/lib/new_relic/agent/timestamp_sampled_buffer.rb +1 -1
  252. data/lib/new_relic/agent/tracer.rb +509 -0
  253. data/lib/new_relic/agent/transaction.rb +143 -171
  254. data/lib/new_relic/agent/transaction/abstract_segment.rb +33 -6
  255. data/lib/new_relic/agent/transaction/datastore_segment.rb +1 -3
  256. data/lib/new_relic/agent/transaction/distributed_tracer.rb +177 -0
  257. data/lib/new_relic/agent/transaction/distributed_tracing.rb +59 -149
  258. data/lib/new_relic/agent/transaction/external_request_segment.rb +32 -39
  259. data/lib/new_relic/agent/transaction/message_broker_segment.rb +5 -12
  260. data/lib/new_relic/agent/transaction/request_attributes.rb +1 -1
  261. data/lib/new_relic/agent/transaction/segment.rb +28 -2
  262. data/lib/new_relic/agent/transaction/slowest_sample_buffer.rb +1 -1
  263. data/lib/new_relic/agent/transaction/synthetics_sample_buffer.rb +1 -1
  264. data/lib/new_relic/agent/transaction/trace.rb +6 -13
  265. data/lib/new_relic/agent/transaction/trace_builder.rb +1 -2
  266. data/lib/new_relic/agent/transaction/trace_context.rb +168 -0
  267. data/lib/new_relic/agent/transaction/trace_node.rb +12 -8
  268. data/lib/new_relic/agent/transaction/tracing.rb +1 -100
  269. data/lib/new_relic/agent/transaction/transaction_sample_buffer.rb +1 -1
  270. data/lib/new_relic/agent/transaction_error_primitive.rb +11 -16
  271. data/lib/new_relic/agent/transaction_event_aggregator.rb +1 -1
  272. data/lib/new_relic/agent/transaction_event_primitive.rb +29 -40
  273. data/lib/new_relic/agent/transaction_event_recorder.rb +4 -4
  274. data/lib/new_relic/agent/transaction_metrics.rb +1 -1
  275. data/lib/new_relic/agent/transaction_sampler.rb +2 -6
  276. data/lib/new_relic/agent/transaction_time_aggregator.rb +50 -26
  277. data/lib/new_relic/agent/utilization/aws.rb +1 -1
  278. data/lib/new_relic/agent/utilization/azure.rb +1 -1
  279. data/lib/new_relic/agent/utilization/gcp.rb +1 -1
  280. data/lib/new_relic/agent/utilization/pcf.rb +1 -1
  281. data/lib/new_relic/agent/utilization/vendor.rb +1 -1
  282. data/lib/new_relic/agent/utilization_data.rb +37 -2
  283. data/lib/new_relic/agent/vm.rb +1 -1
  284. data/lib/new_relic/agent/vm/jruby_vm.rb +1 -1
  285. data/lib/new_relic/agent/vm/monotonic_gc_profiler.rb +1 -1
  286. data/lib/new_relic/agent/vm/mri_vm.rb +7 -5
  287. data/lib/new_relic/agent/vm/snapshot.rb +1 -1
  288. data/lib/new_relic/agent/worker_loop.rb +1 -1
  289. data/lib/new_relic/cli/command.rb +1 -1
  290. data/lib/new_relic/cli/commands/deployments.rb +2 -3
  291. data/lib/new_relic/cli/commands/install.rb +4 -3
  292. data/lib/new_relic/coerce.rb +32 -7
  293. data/lib/new_relic/collection_helper.rb +1 -1
  294. data/lib/new_relic/constants.rb +42 -0
  295. data/lib/new_relic/control.rb +1 -1
  296. data/lib/new_relic/control/class_methods.rb +8 -2
  297. data/lib/new_relic/control/frameworks.rb +1 -1
  298. data/lib/new_relic/control/frameworks/external.rb +1 -1
  299. data/lib/new_relic/control/frameworks/merb.rb +1 -1
  300. data/lib/new_relic/control/frameworks/rails.rb +12 -10
  301. data/lib/new_relic/control/frameworks/rails3.rb +1 -1
  302. data/lib/new_relic/control/frameworks/rails4.rb +1 -1
  303. data/lib/new_relic/control/frameworks/{rails5.rb → rails_notifications.rb} +2 -2
  304. data/lib/new_relic/control/frameworks/ruby.rb +1 -1
  305. data/lib/new_relic/control/frameworks/sinatra.rb +1 -1
  306. data/lib/new_relic/control/instance_methods.rb +12 -2
  307. data/lib/new_relic/control/instrumentation.rb +1 -1
  308. data/lib/new_relic/control/server_methods.rb +1 -1
  309. data/lib/new_relic/delayed_job_injection.rb +1 -1
  310. data/lib/new_relic/dependency_detection.rb +124 -14
  311. data/lib/new_relic/environment_report.rb +2 -4
  312. data/lib/new_relic/helper.rb +1 -1
  313. data/lib/new_relic/language_support.rb +1 -1
  314. data/lib/new_relic/latest_changes.rb +4 -4
  315. data/lib/new_relic/local_environment.rb +1 -1
  316. data/lib/new_relic/metric_data.rb +1 -1
  317. data/lib/new_relic/metric_spec.rb +1 -1
  318. data/lib/new_relic/noticed_error.rb +38 -21
  319. data/lib/new_relic/rack.rb +1 -1
  320. data/lib/new_relic/rack/agent_hooks.rb +1 -1
  321. data/lib/new_relic/rack/agent_middleware.rb +2 -2
  322. data/lib/new_relic/rack/browser_monitoring.rb +16 -9
  323. data/lib/new_relic/recipes.rb +1 -1
  324. data/lib/new_relic/recipes/capistrano3.rb +1 -1
  325. data/lib/new_relic/recipes/capistrano_legacy.rb +1 -1
  326. data/lib/new_relic/supportability_helper.rb +16 -1
  327. data/lib/new_relic/version.rb +3 -3
  328. data/lib/newrelic_rpm.rb +1 -1
  329. data/lib/sequel/extensions/newrelic_instrumentation.rb +1 -1
  330. data/lib/sequel/plugins/newrelic_instrumentation.rb +1 -1
  331. data/lib/tasks/all.rb +1 -1
  332. data/lib/tasks/config.html.erb +14 -25
  333. data/lib/tasks/config.rake +9 -9
  334. data/lib/tasks/multiverse.rb +35 -1
  335. data/lib/tasks/newrelic.rb +1 -1
  336. data/lib/tasks/tests.rake +6 -1
  337. data/newrelic_rpm.gemspec +22 -17
  338. data/recipes/newrelic.rb +1 -1
  339. data/test/agent_helper.rb +358 -78
  340. metadata +151 -66
  341. data/.travis.yml +0 -201
  342. data/cert/cacert.pem +0 -1177
  343. data/lib/new_relic/agent/commands/xray_session.rb +0 -55
  344. data/lib/new_relic/agent/commands/xray_session_collection.rb +0 -161
  345. data/lib/new_relic/agent/cross_app_monitor.rb +0 -110
  346. data/lib/new_relic/agent/distributed_trace_monitor.rb +0 -41
  347. data/lib/new_relic/agent/http_clients/abstract_request.rb +0 -31
  348. data/lib/new_relic/agent/instrumentation/active_record_4.rb +0 -42
  349. data/lib/new_relic/agent/instrumentation/active_record_5.rb +0 -41
  350. data/lib/new_relic/agent/instrumentation/evented_subscriber.rb +0 -104
  351. data/lib/new_relic/agent/instrumentation/http.rb +0 -46
  352. data/lib/new_relic/agent/instrumentation/net.rb +0 -50
  353. data/lib/new_relic/agent/instrumentation/rails4/action_controller.rb +0 -32
  354. data/lib/new_relic/agent/instrumentation/rails5/action_view.rb +0 -27
  355. data/lib/new_relic/agent/transaction/attributes.rb +0 -154
  356. data/lib/new_relic/agent/transaction/xray_sample_buffer.rb +0 -64
  357. data/lib/new_relic/agent/transaction_state.rb +0 -186
  358. data/lib/new_relic/build.rb +0 -2
  359. data/lib/new_relic/metrics.rb +0 -13
  360. data/lib/tasks/versions.html.erb +0 -28
  361. data/lib/tasks/versions.postface.html +0 -8
  362. data/lib/tasks/versions.preface.html +0 -9
  363. data/lib/tasks/versions.rake +0 -65
  364. data/lib/tasks/versions.txt.erb +0 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b17c73d708623383395fecf3a60a063566a12b59a10d2b18d686deef72f31773
4
- data.tar.gz: f9b9275cf1f9f980175454d8ed5f06a4fa2d173c4edf52e136580c96b2e05eda
3
+ metadata.gz: e364456c599b5484bd0b031f9bc19fd1ec634954c6c060eee1ac85c38adfed78
4
+ data.tar.gz: aaaaa6a31504b5aac1da40ac2c0d69fefbbae8525ce96ef38e7fc01460c618d9
5
5
  SHA512:
6
- metadata.gz: 8cc16f8281e2e00829add33da0ba8053afbfe29e56b9e901c40d40cd44be982df5859492a26041aed7593b687316848113dcc02b646816e2812132bda4a86db5
7
- data.tar.gz: 7eecd067c7606152a08e6485c6f0a642f5e73081812b011f89ba8d2b3fdd74df66ee0686e385d078ec4a4286e396a1ee9206bbc9c2585925596b9b7e90101015
6
+ metadata.gz: c8a7d6825a9d05a99d45bffb9fc537f5630f9e8077cd939970f28b17e85991fa80443752bc05560b5fcea7f3a47058e68eb96621f66a0e3b2989206a0aa66ebd
7
+ data.tar.gz: 2586902aac108d89c355eccae23acf6b88a72c18abdc773ef4938f3a5aaf17568821e2890bd2ecc4e56695d3798f1f74bdb136f2df3fc6002aacaa563fd329ea
data/.gitignore CHANGED
@@ -1,4 +1,6 @@
1
+ .ruby-version
1
2
  Gemfile.lock
3
+ Guard*
2
4
  .DS\_Store
3
5
  .svn/
4
6
  *~
@@ -25,4 +27,11 @@ lib/new_relic/build.rb
25
27
  .bundle
26
28
  .yardoc
27
29
  artifacts/
30
+ test/performance/log/
28
31
  test/performance/script/log/
32
+ infinite_tracing/log/
33
+ infinite_tracing/test/new_relic/infinite_tracing/log
34
+ test/fixtures/cross_agent_tests/*/README.md
35
+ node_modules/
36
+ yarn.lock
37
+ errors.txt
data/.yardopts CHANGED
@@ -12,6 +12,7 @@ lib/new_relic/agent/stats_engine/metric_stats.rb
12
12
  lib/new_relic/agent/datastores.rb
13
13
  lib/new_relic/agent/messaging.rb
14
14
  lib/new_relic/agent/sql_sampler.rb
15
+ lib/new_relic/agent/tracer.rb
15
16
  lib/new_relic/agent/transaction.rb
16
17
  lib/new_relic/agent/transaction_sampler.rb
17
18
  lib/new_relic/rack/agent_hooks.rb
data/CHANGELOG.md CHANGED
@@ -1,5 +1,936 @@
1
1
  # New Relic Ruby Agent Release Notes #
2
2
 
3
+ ## v7.2.0
4
+
5
+ * **Expected Errors and Ignore Errors**
6
+ This release adds support for configuration for expected/ignored errors by class name, status code, and message. The following configuration options are now available:
7
+ - `error_collector.ignore_classes`
8
+ - `error_collector.ignore_messages`
9
+ - `error_collector.ignore_status_codes`
10
+ - `error_collector.expected_classes`
11
+ - `error_collector.expected_messages`
12
+ - `error_collector.expected_status_codes`
13
+ For more details about expected and ignored errors, please see our [configuration documentation](https://docs.newrelic.com/docs/agents/ruby-agent/configuration/)
14
+
15
+ * **Bugfix: resolves "can't add a new key into hash during iteration" Errors**
16
+
17
+ 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.
18
+
19
+ * **Bugfix: kwarg support fixed for Rack middleware instrumentation**
20
+
21
+ Thanks to @walro for submitting this fix. This fixes the rack instrumentation when using kwargs.
22
+
23
+ * **Update known conflicts with use of Module#Prepend**
24
+
25
+ With our release of v7.0.0, we updated our instrumentation to use Module#Prepend by default, instead of method chaining. We have received reports of conflicts and added a check for these known conflicts. If a known conflict with prepend is detected while using the default value of 'auto' for gem instrumentation, the agent will instead install method chaining instrumentation in order to avoid this conflict. This check can be bypassed by setting the instrumentation method for the gem to 'prepend'.
26
+
27
+
28
+ ## v7.1.0
29
+
30
+ * **Add support for CSP nonces when using our API to insert the browser agent**
31
+
32
+ We now support passing in a nonce to our API method `browser_timing_header` to allow the browser agent to run on applications using CSP nonces. This allows users to inject the browser agent themselves and use the nonce required for the script to run. In order to utilize this new feature, you must disable auto instrumentation for the browser agent, and use the API method browser_timing_header to pass the nonce in and inject the script manually.
33
+
34
+ * **Removed MD5 use in the SQL sampler**
35
+
36
+ In order to allow the agent to run in FIPS compliant environments, the usage of MD5 for aggregating slow sql traces has been replaced with SHA1.
37
+
38
+ * **Enable server-side configuration of distributed tracing**
39
+
40
+ `distributed_tracing.enabled` may now be set in server-side application configuration.
41
+
42
+ * **Bugfix: Fix for missing part of a previous bugfix**
43
+
44
+ Our previous fix of "nil Middlewares injection now prevented and gracefully handled in Sinatra" released in 7.0.0 was partially overwritten by some of the other changes in that release. This release adds back those missing sections of the bugfix, and should resolve the issue for sinatra users.
45
+
46
+ * **Update known conflicts with use of Module#Prepend**
47
+
48
+ With our release of v7.0.0, we updated our instrumentation to use Module#Prepend by default, instead of method chaining. We have received reports of conflicts and added a check for these known conflicts. If a known conflict with prepend is detected while using the default value of 'auto' for gem instrumentation, the agent will instead install method chaining instrumentation in order to avoid this conflict. This check can be bypassed by setting the instrumentation method for the gem to 'prepend'.
49
+
50
+ * **Bugfix: Updated support for ActiveRecord 6.1+ instrumentation**
51
+
52
+ Previously, the agent depended on `connection_id` to be present in the Active Support instrumentation for `sql.active_record`
53
+ to get the current ActiveRecord connection. As of Rails 6.1, `connection_id` has been dropped in favor of providing the connection
54
+ object through the `connection` value exclusively. This resulted in datastore spans displaying fallback behavior, including showing
55
+ "ActiveRecord" as the database vendor.
56
+
57
+ * **Bugfix: Updated support for Resque's FORK_PER_JOB option**
58
+
59
+ Support for Resque's FORK_PER_JOB flag within the Ruby agent was incomplete and nonfunctional. The agent should now behave
60
+ correctly when running in a non-forking Resque worker process.
61
+
62
+ * **Bugfix: Added check for ruby2_keywords in add_transaction_tracer**
63
+
64
+ Thanks @beauraF for the contribution! Previously, the add_transaction_tracer was not updated when we added support for ruby 3. In order to correctly support `**kwargs`, ruby2_keywords was added to correctly update the method signature to use **kwargs in ruby versions that support that.
65
+
66
+ * **Confirmed support for yajl 1.4.0**
67
+
68
+ Thanks to @creaturenex for the contribution! `yajl-ruby` 1.4.0 was added to our test suite and confirmed all tests pass, showing the agent supports this version as well.
69
+
70
+
71
+ ## v7.0.0
72
+
73
+ * **Ruby Agent 6.x to 7.x Migration Guide Available**
74
+
75
+ 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.
76
+
77
+ * **Ruby 2.0 and 2.1 Dropped**
78
+
79
+ Support for Ruby 2.0 and 2.1 dropped with this release. No code changes that would prevent the agent from continuing to
80
+ work with these releases are known. However, Rubies 2.0 and 2.1 are no longer included in our test matrices and are not supported
81
+ for 7.0.0 and onward.
82
+
83
+ * **Implemented prepend auto-instrumentation strategies for most Ruby gems/libraries**
84
+
85
+ This release brings the auto-instrumentation strategies for most gems into the modern era for Ruby by providing both
86
+ prepend and method-chaining (a.k.a. method-aliasing) strategies for auto instrumenting. Prepend, which has been available since
87
+ Ruby 2.0 is now the default strategy employed in auto-instrumenting. It is known that some external gems lead to Stack Level
88
+ too Deep exceptions when prepend and method-chaining are mixed. In such known cases, auto-instrumenting strategy will fall back
89
+ to method-chaining automatically.
90
+
91
+ This release also deprecates many overlapping and inconsistently named configuration settings in favor of being able to control
92
+ behavior of instrumentation per library with one setting that can be one of auto (the default), disabled, prepend, or chain.
93
+
94
+ Please see the above-referenced migration guide for further details.
95
+
96
+ * **Removed SSL cert bundle**
97
+
98
+ The agent will no longer ship this bundle and will rely on system certs.
99
+
100
+ * **Removed deprecated config options**
101
+
102
+ The following config options were previously deprecated and are no longer available
103
+ - `disable_active_record_4`
104
+ - `disable_active_record_5`
105
+ - `autostart.blacklisted_constants`
106
+ - `autostart.blacklisted_executables`
107
+ - `autostart.blacklisted_rake_tasks`
108
+ - `strip_exception_messages.whitelist`
109
+
110
+ * **Removed deprecated attribute**
111
+
112
+ The attribute `httpResponseCode` was previously deprecated and replaced with `http.statusCode`. This deprecated attribute has now been removed.
113
+
114
+ * **Removed deprecated option in notice_error**
115
+
116
+ Previously, the `:trace_only` option to NewRelic::Agent.notice_error was deprecated and replaced with `:expected`. This deprecated option has been removed.
117
+
118
+ * **Removed deprecated api methods**
119
+
120
+ Previously the api methods `create_distributed_trace_payload` and `accept_distributed_trace_payload` were deprecated. These have now been removed. Instead, please see `insert_distributed_trace_headers` and `accept_distributed_trace_headers`, respectively.
121
+
122
+ * **Bugfix: Prevent browser monitoring middleware from installing to middleware multiple times**
123
+
124
+ In rare cases on jRuby, the BrowserMonitoring middleware could attempt to install itself
125
+ multiple times at start up. This bug fix addresses that by using a mutex to introduce
126
+ thread safety to the operation. Sintra in particular can have this race condition because
127
+ its middleware stack is not installed until the first request is received.
128
+
129
+ * **Skip constructing Time for transactions**
130
+
131
+ Thanks to @viraptor, we are no longer constructing an unused Time object with every call to starting a new Transaction.
132
+
133
+ * **Bugfix: nil Middlewares injection now prevented and gracefully handled in Sinatra**
134
+
135
+ Previously, the agent could potentially inject multiples of an instrumented middleware if Sinatra received many
136
+ requests at once during start up and initialization due to Sinatra's ability to delay full start up as long as possible.
137
+ This has now been fixed and the Ruby agent correctly instruments only once as well as gracefully handles nil middleware
138
+ classes in general.
139
+
140
+ * **Bugfix: Ensure transaction nesting max depth is always consistent with length of segments**
141
+
142
+ Thanks to @warp for noticing and fixing the scenario where Transaction nesting_max_depth can get out of sync
143
+ with segments length resulting in an exception when attempting to nest the initial segment which does not exist.
144
+
145
+ ## v6.15.0
146
+
147
+ * **Official Ruby 3.0 support**
148
+
149
+ The ruby agent has been verified to run on ruby 3.0.0
150
+
151
+ * **Added support for Rails 6.1**
152
+
153
+ The ruby agent has been verified to run with Rails 6.1
154
+ Special thanks to @hasghari for setting this up!
155
+
156
+ * **Added support for Sidekiq 6.0, 6.1**
157
+
158
+ The ruby agent has been verified to run with both 6.0 and 6.1 versions of sidekiq
159
+
160
+ * **Bugfix: No longer overwrites sidekiq trace data**
161
+
162
+ Distributed tracing data is now added to the job trace info rather than overwriting the existing data.
163
+
164
+ * **Bugfix: Fixes cases where errors are reported for spans with no other attributes**
165
+
166
+ Previously, in cases where a span does not have any agent/custom attributes on it, but an error
167
+ is noticed and recorded against the span, a `FrozenError: can't modify frozen Hash` is thrown.
168
+ This is now fixed and errors are now correctly recorded against such span events.
169
+
170
+ * **Bugfix: `DistributedTracing.insert_distributed_trace_headers` Supportability metric now recorded**
171
+
172
+ Previously, API calls to `DistributedTracing.insert_distributed_trace_headers` would lead to an exception
173
+ about the missing supportability metric rather than flowing through the API implementation as intended.
174
+ This would potentially lead to broken distributed traces as the trace headers were not inserted on the API call.
175
+ `DistributedTracing.insert_distributed_trace_headers` now correctly records the supportability metric and
176
+ inserts the distributed trace headers as intended.
177
+
178
+ * **Bugfix: child completions after parent completes sometimes throws exception attempting to access nil parent**
179
+
180
+ In scenarios where the child segment/span is completing after the parent in jRuby, the parent may have already
181
+ been freed and no longer accessible. This would lead to an attempt to call `descendant_complete` on a Nil
182
+ object. This is fixed to protect against calling the `descendant_complete` in such cases.
183
+
184
+ * **Feature: implements `force_install_exit_handler` config flag**
185
+
186
+ The `force_install_exit_handler` configuration flag allows an application to instruct the agent to install its
187
+ graceful shutdown exit handler, which will send any locally cached data to the New Relic collector prior to the
188
+ application shutting down. This is useful for when the primary framework has an embedded Sinatra application that
189
+ is otherwise detected and skips installing the exit hook for graceful shutdowns.
190
+
191
+ * **Default prepend_net_instrumentation to false**
192
+
193
+ 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
194
+ unexpected compatibilty issues.
195
+
196
+ ## v6.14.0
197
+
198
+ * **Bugfix: Method tracers no longer cloning arguments**
199
+
200
+ Previously, when calling add_method_tracer with certain combination of arguments, it would lead to the wrapped method's arguments being cloned rather than passed to the original method for manipulation as intended. This has been fixed.
201
+
202
+ * **Bugfix: Delayed Job instrumentation fixed for Ruby 2.7+**
203
+
204
+ Previously, the agent was erroneousy separating positional and keyword arguments on the instrumented method calls into
205
+ Delayed Job's library. The led to Delayed job not auto-instrumenting correctly and has been fixed.
206
+
207
+ * **Bugfix: Ruby 2.7+ methods sometimes erroneously attributed compiler warnings to the Agent's `add_method_tracer`**
208
+
209
+ The specific edge cases presented are now fixed by this release of the agent. There are still some known corner-cases
210
+ that will be resolved with upcoming changes in next major release of the Agent. If you encounter a problem with adding
211
+ method tracers and compiler warnings raised, please continue to submit small repoducible examples.
212
+
213
+ * **Bugfix: Ruby 2.7+ fix for keyword arguments on Rack apps is unnecessary and removed**
214
+
215
+ A common fix for positional and keyword arguments for method parameters was implemented where it was not needed and
216
+ led to RackApps getting extra arguments converted to keyword arguments rather than Hash when it expected one. This
217
+ Ruby 2.7+ change was reverted so that Rack apps behave correctly for Ruby >= 2.7.
218
+
219
+ * **Feature: captures incoming and outgoing request headers for distributed tracing**
220
+
221
+ HTTP request headers will be logged when log level is at least debug level. Similarly, request headers
222
+ for exchanges with New Relic servers are now audit logged when audit logging is enabled.
223
+
224
+ * **Bugfix: `newrelic.yml.erb` added to the configuration search path**
225
+
226
+ Previously, when a user specifies a `newrelic.yml.erb` and no `newrelic.yml` file, the agent fails to find
227
+ the `.erb` file because it was not in the list of files searched at startup. The Ruby agent has long supported this as a
228
+ means of configuring the agent programatically. The `newrelic.yml.erb` filename is restored to the search
229
+ path and will be utilized if present. NOTE: `newrelic.yml` still takes precedence over `newrelic.yml.erb` If found,
230
+ the `.yml` file is used instead of the `.erb` file. Search directories and order of traversal remain unchanged.
231
+
232
+ * **Bugfix: dependency detection of Redis now works without raising an exception**
233
+
234
+ Previously, when detecting if Redis was available to instrument, the dependency detection would fail with an Exception raised
235
+ (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`.
236
+
237
+ * **Bugfix: Gracefully handles NilClass as a Middleware Class when instrumenting**
238
+
239
+ Previously, if a NilClass is passed as the Middleware Class to instrument when processing the middleware stack,
240
+ the agent would fail to fully load and instrument the middleware stack. This fix gracefully skips over nil classes.
241
+
242
+ * **Memory Sampler updated to recognize macOS Big Sur**
243
+
244
+ Previously, the agent was unable to recognize the platform macOS Big Sur in the memory sampler, resulting in an error being logged. The memory sampler is now able to recognize Big Sur.
245
+
246
+ * **Prepend implementation of Net::HTTP instrumentation available**
247
+
248
+ There is now a config option (`prepend_net_instrumentation`) that will enable the agent to use prepend while instrumenting Net::HTTP. This option is set to true by default.
249
+
250
+ ## v6.13.1
251
+
252
+ * **Bugfix: obfuscating URLs to external services no longer modifying original URI**
253
+
254
+ A recent change to the Ruby agent to obfuscate URIs sent to external services had the unintended side-effect of removing query parameters
255
+ from the original URI. This is fixed to obfuscate while also preserving the original URI.
256
+
257
+ Thanks to @VictorJimenezKwast for pinpointing and helpful unit test to demonstrate.
258
+
259
+ ## v6.13.0
260
+
261
+ * **Bugfix: never use redirect host when accessing preconnect endpoint**
262
+
263
+ When connecting to New Relic, the Ruby Agent uses the value in `Agent.config[:host]` to post a request to the New Relic preconnect endpoint. This endpoint returns a "redirect host" which is the URL to which agents send data from that point on.
264
+
265
+ Previously, if the agent needed to reconnect to the collector, it would incorrectly use this redirect host to call the preconnect
266
+ endpoint, when it should have used the original configured value in `Agent.config[:host]`. The agent now uses the correct host
267
+ for all calls to preconnect.
268
+
269
+ * **Bugfix: calling `add_custom_attributes` no longer modifies the params of the caller**
270
+
271
+ The previous agent's improvements to recording attributes at the span level had an unexpected
272
+ side-effect of modifying the params passed to the API call as duplicated attributes were deleted
273
+ in the process. This is now fixed and params passed in are no longer modified.
274
+
275
+ Thanks to Pete Johns (@johnsyweb) for the PR that resolves this bug.
276
+
277
+ * **Bugfix: `http.url` query parameters spans are now obfuscated**
278
+
279
+ Previously, the agent was recording the full URL of the external requests, including
280
+ the query and fragment parts of the URL as part of the attributes on the external request
281
+ span. This has been fixed so that the URL is obfuscated to filter out potentially sensitive data.
282
+
283
+ * **Use system SSL certificates by default**
284
+
285
+ The Ruby agent previously used a root SSL/TLS certificate bundle by default. Now the agent will attempt to use
286
+ the default system certificates, but will fall back to the bundled certs if there is an issue (and log that this occurred).
287
+
288
+ * **Bugfix: reduce allocations for segment attributes**
289
+
290
+ Previously, every segment received an `Attributes` object on initialization. The agent now lazily creates attributes
291
+ on segments, resulting in a significant reduction in object allocations for a typical transaction.
292
+
293
+ * **Bugfix: eliminate errors around Rake::VERSION with Rails**
294
+
295
+ When running a Rails application with rake tasks, customers could see the following error:
296
+
297
+ * **Prevent connecting agent thread from hanging on shutdown**
298
+
299
+ A bug in `Net::HTTP`'s Gzip decoder can cause the (un-catchable)
300
+ thread-kill exception to be replaced with a (catchable) `Zlib` exception,
301
+ which prevents a connecting agent thread from exiting during shutdown,
302
+ causing the Ruby process to hang indefinitely.
303
+ This workaround checks for an `aborting` thread in the `#connect` exception handler
304
+ and re-raises the exception, allowing a killed thread to continue exiting.
305
+
306
+ Thanks to Will Jordan (@wjordan) for chasing this one down and patching with tests.
307
+
308
+ * **Fix error messages about Rake instrumentation**
309
+
310
+ When running a Rails application with rake tasks, customers could see the following error in logs resulting from
311
+ a small part of rake functionality being loaded with the Rails test runner:
312
+
313
+ ```
314
+ ERROR : Error while detecting rake_instrumentation:
315
+ ERROR : NameError: uninitialized constant Rake::VERSION
316
+ ```
317
+
318
+ Such error messages should no longer appear in this context.
319
+
320
+ Thanks to @CamilleDrapier for pointing out this issue.
321
+
322
+ * **Remove NewRelic::Metrics**
323
+
324
+ The `NewRelic::Metrics` module has been removed from the agent since it is no longer used.
325
+
326
+ Thanks to @csaura for the contribution!
327
+
328
+ ## v6.12.0
329
+
330
+ * The New Relic Ruby Agent is now open source under the [Apache 2 license](LICENSE)
331
+ and you can now observe the project roadmap. See our [Contributing guide](https://github.com/newrelic/newrelic-ruby-agent/blob/main/CONTRIBUTING.md)
332
+ and [Code of Conduct](https://github.com/newrelic/.github/blob/master/CODE_OF_CONDUCT.md) for details on contributing!
333
+
334
+ * **Security: Updated all uses of Rake to >= 12.3.3**
335
+
336
+ All versions of Rake testing prior to 12.3.3 were removed to address
337
+ [CVE-2020-8130](https://nvd.nist.gov/vuln/detail/CVE-2020-8130).
338
+ No functionality in the agent was removed nor deprecated with this change, and older versions
339
+ of rake are expected to continue to work as they have in the past. However, versions of
340
+ rake < 12.3.3 are no longer tested nor supported.
341
+
342
+ * **Bugfix: fixes an error capturing content length in middleware on multi-part responses**
343
+
344
+ In the middleware tracing, the `Content-Length` header is sometimes returned as an array of
345
+ values when content is a multi-part response. Previously, the agent would fail with
346
+ "NoMethodError: undefined method `to_i` for Array" Error. This bug is now fixed and
347
+ multi-part content lengths are summed for a total when an `Array` is present.
348
+
349
+ * **Added support for auto-instrumenting Mongo gem versions 2.6 to 2.12**
350
+
351
+ * **Bugfix: MongoDB instrumentation did not handle CommandFailed events when noticing errors**
352
+
353
+ The mongo gem sometimes returns a CommandFailed object instead of a CommandSucceeded object with
354
+ error attributes populated. The instrumentation did not handle noticing errors on CommandFailed
355
+ objects and resulted in logging an error and backtrace to the log file.
356
+
357
+ Additionally, a bug in recording the metric for "findAndModify" as all lowercased "findandmodify"
358
+ for versions 2.1 through 2.5 was fixed.
359
+
360
+ * **Bugfix: Priority Sampler causes crash in high throughput environents in rare cases**
361
+
362
+ Previously, the priority sampling buffer would, in rare cases, generate an error in high-throughput
363
+ environments once capacity is reached and the sampling algorthym engages. This issue is fixed.
364
+
365
+ * **Additional Transaction Information applied to Span Events**
366
+
367
+ When Distributed Tracing and/or Infinite Tracing are enabled, the Agent will now incorporate additional information from the Transaction Event on to the root Span Event of the transaction.
368
+
369
+ The following items are affected:
370
+ * Custom attribute values applied to the Transaction via our [add_custom_attributes](http://www.rubydoc.info/github/newrelic/newrelic-ruby-agent/NewRelic/Agent#add_custom_attributes-instance_method) API method.
371
+ * Request parameters: `request.parameters.*`
372
+ * Request headers: `request.headers.*`
373
+ * Response headers: `response.headers.*`
374
+ * Resque job arguments: `job.resque.args.*`
375
+ * Sidekiq job arguments: `job.sidekiq.args.*`
376
+ * Messaging arguments: `message.*`
377
+ * `httpResponseCode` (deprecated in this version; see note below)/`http.statusCode`
378
+ * `response.status`
379
+ * `request.uri`
380
+ * `request.method`
381
+ * `host.displayName`
382
+
383
+ * **Security Recommendation**
384
+
385
+ Review your Transaction attributes [include](https://docs.newrelic.com/docs/agents/ruby-agent/attributes/enable-disable-attributes-ruby#transaction_events-attributes-include) and [exclude](https://docs.newrelic.com/docs/agents/ruby-agent/attributes/enable-disable-attributes-ruby#transaction_events-attributes-exclude) configurations. Any attribute include or exclude settings specific to Transaction Events should be applied
386
+ to your Span attributes [include](https://docs.newrelic.com/docs/agents/ruby-agent/attributes/enable-disable-attributes-ruby#span-events-attributes-include) and [exclude](https://docs.newrelic.com/docs/agents/ruby-agent/attributes/enable-disable-attributes-ruby#span-events-attributes-exclude) configuration or your global attributes [include](https://docs.newrelic.com/docs/agents/ruby-agent/attributes/enable-disable-attributes-ruby#attributes-include) and [exclude](https://docs.newrelic.com/docs/agents/ruby-agent/attributes/enable-disable-attributes-ruby#attributes-exclude) configuration.
387
+
388
+ * **Agent attribute deprecation: httpResponseCode**
389
+
390
+ Starting in this agent version, the [agent attribute](https://docs.newrelic.com/docs/agents/ruby-agent/attributes/ruby-agent-attributes#attributes) `httpResponseCode` (string value) has been deprecated. Customers can begin using `http.statusCode`
391
+ (integer value) immediately, and `httpResponseCode` will be removed in the agent's next major version update.
392
+
393
+ * **Bugfix: Eliminate warnings for distributed tracing when using sidekiq**
394
+
395
+ Previously, using sidekiq with distributed tracing disabled resulted in warning messages\
396
+ `WARN : Not configured to accept distributed trace headers`\
397
+ ` WARN : Not configured to insert distributed trace headers`\
398
+ These messages no longer appear.
399
+
400
+ ## v6.11.0
401
+
402
+ * **Infinite Tracing**
403
+
404
+ This release adds support for [Infinite Tracing](https://docs.newrelic.com/docs/understand-dependencies/distributed-tracing/enable-configure/enable-distributed-tracing). Infinite Tracing observes 100% of your distributed traces and provides visualizations for the most actionable data. With Infinite Tracing, you get examples of errors and long-running traces so you can better diagnose and troubleshoot your systems.
405
+
406
+ Configure your agent to send traces to a trace observer in New Relic Edge. View distributed traces through New Relic’s UI. There is no need to install a collector on your network.
407
+
408
+ Infinite Tracing is currently available on a sign-up basis. If you would like to participate, please contact your sales representative.
409
+
410
+ * **Bugfix: Cross Application Tracing (CAT) adds a missing field to response**
411
+
412
+ Previously, the Ruby agent's Cross Application Tracing header was missing a reserved field that would lead to an error
413
+ in the Go agent's processing of incoming headers from the Ruby agent. This fix adds that missing field to the headers, eliminating
414
+ the issue with traces involving the Ruby agent and the Go agent.
415
+
416
+ * **Bugfix: Environment Report now supports Rails >= 6.1**
417
+
418
+ Previously, users of Rails 6.1 would see the following deprecation warning appear when the Ruby agent attempted to
419
+ collect enviroment data: `DEPRECATION WARNING: [] is deprecated and will be removed from Rails 6.2`. These deprecation methods
420
+ no longer appear.
421
+
422
+ Thanks to Sébastien Dubois (sedubois) for reporting this issue and for the contribution!
423
+
424
+ * **Added distributed tracing to Sidekiq jobs**
425
+
426
+ Previously, Sidekiq jobs were not included in portions of <a href="https://docs.newrelic.com/docs/understand-dependencies/distributed-tracing/get-started/introduction-distributed-tracing">distributed traces</a> captured by the Ruby agent. Now you can view distributed
427
+ traces that include Sidekiq jobs instrumented by the Ruby agent.
428
+
429
+ Thanks to andreaseger for the contribution!
430
+
431
+ * **Bugfix: Eliminate warnings appearing when using `add_method_tracer` with Ruby 2.7**
432
+
433
+ Previously, using `add_method_tracer` with Ruby 2.7 to trace a method that included keyword arguments resulted in warning messages:
434
+ `warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call`. These messages no
435
+ longer appear.
436
+
437
+ Thanks to Harm de Wit and Atsuo Fukaya for reporting the issue!
438
+
439
+ ## v6.10.0
440
+
441
+ * **Error attributes now added to each span that exits with an error or exception**
442
+
443
+ Error attributes `error.class` and `error.message` are now included on the span event in which an error
444
+ or exception was noticed, and, in the case of unhandled exceptions, on any ancestor spans that also exit with an error.
445
+ The public API method `notice_error` now attaches these error attributes to the currently executing span.
446
+
447
+ <a href="https://docs.newrelic.com/docs/apm/distributed-tracing/ui-data/understand-use-distributed-tracing-data#rules-limits">Spans with error details are now highlighted red in the Distributed Tracing UI</a>, and error details will expose the associated
448
+ `error.class` and `error.message`. It is also now possible to see when an exception leaves the boundary of the span,
449
+ and if it is caught in an ancestor span without reaching the entry span. NOTE: This “bubbling up” of exceptions will impact
450
+ the error count when compared to prior behavior for the same trace. It is possible to have a trace that now has span errors
451
+ without the trace level showing an error.
452
+
453
+ If multiple errors occur on the same span, only the most recent error information is added to the attributes. Prior errors on the same span are overwritten.
454
+
455
+ These span event attributes conform to <a href="https://docs.newrelic.com/docs/agents/manage-apm-agents/agent-data/manage-errors-apm-collect-ignore-or-mark-expected#ignore">ignored errors</a> and <a href="https://docs.newrelic.com/docs/agents/manage-apm-agents/agent-data/manage-errors-apm-collect-ignore-or-mark-expected#expected">expected errors</a>.
456
+
457
+ * **Added tests for latest Grape / Rack combination**
458
+
459
+ For a short period of time, the latest versions of Grape and Rack had compatibility issues.
460
+ Generally, Rack 2.1.0 should be avoided in all cases due to breaking changes in many gems
461
+ reliant on Rack. We recommend using either Rack <= 2.0.9, or using latest Rack when using Grape
462
+ (2.2.2 at the time of this writing).
463
+
464
+ * **Bugfix: Calculate Content-Length in bytes**
465
+
466
+ Previously, the Content-Length HTTP header would be incorrect after injecting the Browser Monitoring
467
+ JS when the response contained Unicode characters because the value was not calculated in bytes.
468
+ The Content-Length is now correctly updated.
469
+
470
+ Thanks to thaim for the contribution!
471
+
472
+ * **Bugfix: Fix Content-Length calculation when response is nil**
473
+
474
+ Previously, calculating the Content-Length HTTP header would result in a `NoMethodError` in the case of
475
+ a nil response. These errors will no longer occur in such a case.
476
+
477
+ Thanks to Johan Van Ryseghem for the contribution!
478
+
479
+ * **Bugfix: DecoratingFormatter now logs timestamps as millisecond Integers**
480
+
481
+ Previously the agent sent timestamps as a Float with milliseconds as part of the
482
+ fractional value. Logs in Context was changed to only accept Integer values and this
483
+ release changes DecoratingFormatter to match.
484
+
485
+ * **Added --force option to `newrelic install` cli command to allow overwriting newrelic.yml**
486
+
487
+ * **Bugfix: The fully qualified hostname now works correctly for BSD and Solaris**
488
+
489
+ Previously, when running on systems such as BSD and Solaris, the agent was unable to determine the fully
490
+ qualified domain name, which is used to help link Ruby agent data with data from New Relic Infrastructure.
491
+ This information is now successfully collected on various BSD distros and Solaris.
492
+
493
+
494
+ ## v6.9.0
495
+
496
+ * **Added support for W3C Trace Context, with easy upgrade from New Relic trace context**
497
+
498
+ * [Distributed Tracing now supports W3C Trace Context headers](https://docs.newrelic.com/docs/understand-dependencies/distributed-tracing/get-started/introduction-distributed-tracing#w3c-support) for HTTP protocols when distributed tracing is enabled. Our implementation can accept and emit both
499
+ the W3C trace header format and the New Relic trace header format. This simplifies
500
+ agent upgrades, allowing trace context to be propagated between services with older
501
+ and newer releases of New Relic agents. W3C trace header format will always be
502
+ accepted and emitted. New Relic trace header format will be accepted, and you can
503
+ optionally disable emission of the New Relic trace header format.
504
+
505
+ * When distributed tracing is enabled by setting `distributed_tracing.enabled` to `true`,
506
+ the Ruby agent will now accept W3C's `traceparent` and `tracestate` headers when
507
+ calling `DistributedTracing.accept_distributed_trace_headers` or automatically via
508
+ `http` instrumentation. When calling `DistributedTracing.insert_distributed_trace_headers`,
509
+ or automatically via `http` instrumentation, the Ruby agent will include the W3C
510
+ headers along with the New Relic distributed tracing header, unless the New Relic
511
+ trace header format is disabled by setting `exclude_newrelic_header` setting to `true`.
512
+
513
+ * Added `DistributedTracing.accept_distributed_trace_headers` API for accepting both
514
+ New Relic and W3C TraceContext distributed traces.
515
+
516
+ * Deprecated `DistributedTracing.accept_distributed_trace_payload` which will be removed
517
+ in a future major release.
518
+
519
+ * Added `DistributedTracing.insert_distributed_trace_headers` API for adding outbound
520
+ distributed trace headers. Both W3C TraceContext and New Relic formats will be
521
+ included unless `distributed_tracing.exclude_newrelic_header: true`.
522
+
523
+ * Deprecated `DistributedTracing.create_distributed_trace_payload` which will be removed
524
+ in a future major release.
525
+
526
+ Known Issues and Workarounds
527
+
528
+ * If a .NET agent is initiating traces as the root service, do not upgrade your
529
+ downstream Ruby New Relic agents to this agent release.
530
+
531
+ * **Official Ruby 2.7 support**
532
+
533
+ The Ruby agent has been verified to run with Ruby 2.7.0.
534
+
535
+ * **Reduced allocations when tracing transactions using API calls**
536
+
537
+ Default empty hashes for `options` parameter were not frozen, leading to
538
+ excessive and unnecessary allocations when calling APIs for tracing transactions.
539
+
540
+ Thanks to Joel Turkel (jturkel) for the contribution!
541
+
542
+ * **Bugfix for Resque worker thread race conditions**
543
+
544
+ Recent changes in Rack surfaced issues marshalling data for resque, surfaced a potential race-condition with closing out the worker-threads before flushing the data pipe. This
545
+ is now fixed.
546
+
547
+ Thanks to Bertrand Paquet (bpaquet) for the contribution!
548
+
549
+ * **Bugfix for Content-Length when injecting Browser Monitoring JS**
550
+
551
+ The Content-Length HTTP header would be incorrect after injecting the Browser Monitoring
552
+ JS into the HEAD tag of the HTML source with Content-Length and lead to the HTML BODY content
553
+ being truncated in some cases. The Content-Length is now correctly updated after injecting the
554
+ Browser Monitoring JS script.
555
+
556
+ Thanks to Slava Kardakov (ojab) for the contribution!
557
+
558
+ ## v6.8.0
559
+
560
+ * **Initial Ruby 2.7 support**
561
+
562
+ The Ruby agent has been verified to run with Ruby 2.7.0-preview1.
563
+
564
+ * **New API method to add custom attributes to Spans**
565
+
566
+ New API method for adding custom attributes to spans. Previously, custom
567
+ attributes were only available at the Transaction level. Now, with Span
568
+ level custom attributes, more granular tagging of events is possible for
569
+ easier isolation and review of trace events. For more information:
570
+
571
+ * [`Agent#add_custom_span_attributes`](https://www.rubydoc.info/github/newrelic/newrelic-ruby-agent/NewRelic/Agent#add_custom_span_attributes)
572
+
573
+ * **Enables ability to migrate to Configurable Security Policies (CSP) on a per agent
574
+ basis for accounts already using High Security Mode (HSM).**
575
+
576
+ When both [HSM](https://docs.newrelic.com/docs/agents/manage-apm-agents/configuration/high-security-mode) and [CSP](https://docs.newrelic.com/docs/agents/manage-apm-agents/configuration/enable-configurable-security-policies) are enabled for an account, an agent (this version or later)
577
+ can successfully connect with either `high_security: true` or the appropriate
578
+ `security_policies_token` configured. `high_security` has been added as part of
579
+ the preconnect payload.
580
+
581
+ * **Bugfix for Logs in Context combined with act-fluent-logger-rails**
582
+
583
+ Previously, when using the Ruby agent's Logs in Context logger
584
+ to link logging data with trace and entity metadata for an
585
+ improved experience in the UI, customers who were also using
586
+ the `act-fluent-logger-rails` gem would see a `NoMethodError`
587
+ for `clear_tags!` that would interfere with the use of this
588
+ feature. This error no longer appears, allowing customers to
589
+ combine the use of Logs in Context with the use of this gem.
590
+
591
+ Please note that the Logs in Context logger does not support
592
+ tagged logging; if you are initializing your logger with a
593
+ `log_tags` argument, your custom tags may not appear on the
594
+ final version of your logs.
595
+
596
+ * **Bugfix for parsing invalid newrelic.yml**
597
+
598
+ Previously, if the newrelic.yml configuration file was invalid, and the agent
599
+ could not start as a result, the agent would not log any indication of
600
+ the problem.
601
+
602
+ This version of the agent will emit a FATAL message to STDOUT when this scenario
603
+ occurs so that customers can address issues with newrelic.yml that prevent startup.
604
+
605
+ * **Configuration options containing the terms "whitelist" and "blacklist" deprecated**
606
+
607
+ The following local configuration settings have been deprecated:
608
+
609
+ * `autostart.blacklisted_constants`: use `autostart.denylisted_constants` instead.
610
+ * `autostart.blacklisted_executables`: use `autostart.denylisted_executables` instead.
611
+ * `autostart.blacklisted_rake_tasks`: use `autostart.denylisted_rake_tasks` instead.
612
+ * `strip_exception_messages.whitelist`: use `strip_exception_messages.allowed_classes` instead.
613
+
614
+ * **Bugfix for module loading and constant resolution in Rails**
615
+
616
+ Starting in version 6.3, the Ruby agent has caused module loading and constant
617
+ resolution to sometimes fail, which caused errors in some Rails applications.
618
+ These errors were generally `NoMethodError` exceptions or I18n errors
619
+ `translation missing` or `invalid locale`. These errors would not appear if the agent
620
+ was removed from the application's Gemfile.
621
+ This version of the agent fixes these issues with module loading and constant
622
+ resolution, so these errors no longer occur.
623
+
624
+ * **Bugfix: failed to get urandom**
625
+
626
+ Previous versions of the agent would fail unexpectedly when the Ruby process used
627
+ every available file descriptor. The failures would include this message:
628
+ ```
629
+ ERROR : RuntimeError: failed to get urandom
630
+ ```
631
+ This version of the agent uses a different strategy for generating random IDs, and
632
+ will not fail in the same way when no file descriptors are available.
633
+
634
+ ## v6.7.0
635
+
636
+ * **Trace and Entity Metadata API**
637
+
638
+ Several new API methods have been added to the agent:
639
+ * [`Agent#linking_metadata`](https://www.rubydoc.info/github/newrelic/newrelic-ruby-agent/NewRelic/Agent#linking_metadata-instance_method)
640
+ * [`Tracer#trace_id`](https://www.rubydoc.info/github/newrelic/newrelic-ruby-agent/NewRelic/Agent/Tracer#trace_id-class_method)
641
+ * [`Tracer#span_id`](https://www.rubydoc.info/github/newrelic/newrelic-ruby-agent/NewRelic/Agent/Tracer#span_id-class_method)
642
+ * [`Tracer#sampled?`](https://www.rubydoc.info/github/newrelic/newrelic-ruby-agent/NewRelic/Agent/Tracer#sampled?-class_method)
643
+
644
+ These API methods allow you to access information that can be used to link data of your choosing to a trace or entity.
645
+
646
+ * **Logs in Context**
647
+
648
+ This version of the agent includes a logger, which can be used in place of `::Logger`
649
+ from the standard library, or `ActiveSupport::Logger` from Rails. This logger
650
+ leverages the new trace and entity metadata API to decorate log statements with entity
651
+ and trace metadata, so they can be correlated together in the New Relic UI.
652
+
653
+ For more information on how to use logs in context, see https://docs.newrelic.com/docs/enable-logs-context-ruby
654
+
655
+ * **Project metadata in Gemspec**
656
+
657
+ Project metadata has been added to the gemspec file. This means our Rubygems page will allow users to more easily
658
+ access the agent's source code, raise issues, and read the changelog.
659
+
660
+ Thanks to Orien Madgwick for the contribution!
661
+
662
+ ## v6.6.0
663
+
664
+ * **Bugfix for ActionCable Instrumentation**
665
+
666
+ Previous versions of the agent sometimes caused application crashes with some versions
667
+ of ActionCable. The application would exit quickly after startup with the error:
668
+ `uninitialized constant ActionCable::Engine`.
669
+
670
+ Version 6.6.0 of the agent no longer crashes in this way.
671
+
672
+
673
+ * **Handling of disabling Error Collection**
674
+
675
+ When the agent first starts, it begins collecting Error Events and Traces before
676
+ fetching configuration from New Relic. In previous versions of the agent, those
677
+ events or traces would be sent to New Relic, even if _Error Collection_ is disabled in
678
+ the application's server-side configuration.
679
+
680
+ Version 6.6.0 of the agent drops all collected Error Events and Traces if the
681
+ configuration from the server disables _Error Collection_.
682
+
683
+ ## v6.5.0
684
+
685
+ * **Change to default setting for ActiveRecord connection resolution**
686
+
687
+ Due to incompatibilities between the faster ActiveRecord connection resolution
688
+ released in v6.3.0 of the agent and other gems which patch ActiveRecord,
689
+ `backport_fast_active_record_connection_lookup` will now be set to `false` by default.
690
+ Because it results in a significant performance improvement, we recommend customers
691
+ whose environments include ActiveRecord change this setting to `true`
692
+ _unless_ they are using other gems which measure ActiveRecord performance, which may
693
+ lose functionality when combined with this setting. If unsure whether to enable
694
+ `backport_fast_active_record_connection_lookup`, we recommend enabling it in a
695
+ development environment to make sure other gems which patch ActiveRecord are still
696
+ working as expected.
697
+
698
+ * **Bugfix for ActiveStorage instrumentation error**
699
+
700
+ Version 6.4.0 of the agent introduced a bug that interfered with ActiveStorage
701
+ callbacks, resulting in the agent being unable to instrument ActiveStorage operations.
702
+ ActiveStorage segments are now correctly recorded.
703
+
704
+ * **Bugfix for ActiveRecord 4.1 and 4.2 exception logging**
705
+
706
+ Version 6.3.0 of the agent introduced a bug that prevented ActiveRecord versions 4.1
707
+ and 4.2 from logging exceptions that occurred within a database transaction. This
708
+ version of the agent restores the exception logging functionality from previous agent
709
+ versions.
710
+ Thanks to Oleksiy Kovyrin for the contribution!
711
+
712
+ ## v6.4.0
713
+
714
+ * **Custom Metadata Collection**
715
+
716
+ The agent now collects environment variables prefixed by `NEW_RELIC_METADATA_`. These
717
+ may be added to transaction events to provide context between your Kubernetes cluster
718
+ and your services. For details on the behavior, see
719
+ [this blog post](https://blog.newrelic.com/engineering/monitoring-application-performance-in-kubernetes/).
720
+
721
+ * **Bugfix for faster ActiveRecord connection resolution**
722
+
723
+ Version 6.3.0 of the agent backported the faster ActiveRecord connection resolution
724
+ from Rails 6.0 to previous versions, but the implementation caused certain other gems
725
+ which measured ActiveRecord performance to stop working. This version of the agent
726
+ changes the implementation of this performance improvement so no such conflicts occur.
727
+
728
+ * **Bugfix for Grape instrumentation error**
729
+
730
+ Previous versions of the agent would fail to install Grape instrumentation in Grape
731
+ versions 1.2.0 and up if the API being instrumented subclassed `Grape::API::Instance`
732
+ rather than `Grape::API`. A warning would also print to the newrelic_agent log:
733
+ ```
734
+ WARN : Error in Grape instrumentation
735
+ WARN : NoMethodError: undefined method `name' for nil:NilClass
736
+ ```
737
+
738
+ This version of the agent successfully installs instrumentation for subclasses
739
+ of `Grape::API::Instance`, and these log messages should no longer appear.
740
+
741
+ * **Bugfix for streaming responses**
742
+
743
+ Previous versions of the agent would attempt to insert JavaScript instrumentation into
744
+ any streaming response that did not make use of `ActionController::Live`. This resulted
745
+ in an empty, non-streamed response being sent to the client.
746
+
747
+ This version of the agent will not attempt to insert JavaScript instrumentation into
748
+ a response which includes the header `Transfer-Encoding=chunked`, which indicates a
749
+ streaming response.
750
+
751
+ This should exclude JavaScript instrumentation for all streamed responses. To include
752
+ this instrumentation manually, see
753
+ [Manually instrument via agent API](https://docs.newrelic.com/docs/agents/ruby-agent/features/new-relic-browser-ruby-agent#manual_instrumentation)
754
+ in our documentation.
755
+
756
+ ## v6.3.0
757
+
758
+ * **Official Rails 6.0 support**
759
+
760
+ This version of the agent has been verified against the Rails 6.0.0 release.
761
+
762
+ As ActiveRecord 4, 5, and 6 use the same New Relic instrumentation, the
763
+ `disable_active_record_4` and `disable_active_record_5` settings in NewRelic.yml are being
764
+ deprecated in favor of the new `disable_active_record_notifications`. This new
765
+ setting will affect the instrumentation of ActiveRecord 4, 5, and 6. The deprecated settings
766
+ will be removed in a future release.
767
+
768
+ * **Bugfix for `newrelic deployments` script**
769
+
770
+ For applications housed in the EU, the `newrelic deployments` script included with previous
771
+ versions of the agent would fail with the following message: `Deployment not recorded:
772
+ Application does not exist.` This is because the script would attempt to send the deployment
773
+ notification to the US region. The deployment script now sends deployments to the correct region.
774
+
775
+ * **Faster ActiveRecord connection resolution**
776
+
777
+ This version of the agent uses the faster ActiveRecord connection resolution that Rails 6.0 uses, even on previous versions of Rails.
778
+ Thanks to Callum Jones for the contribution!
779
+
780
+ * **Support non-ascii characters in hostnames**
781
+
782
+ Previous versions of the agent would frequently log warnings like: `log writing failed. "\xE2" from ASCII-8BIT to UTF-8` if the hostname contained a non-ascii character. This version of the agent will no longer log these warnings.
783
+ Thanks to Rafael Petry for the contribution!
784
+
785
+ ## v6.2.0
786
+
787
+ * Bugfix for superfluous `Empty JSON response` error messages
788
+
789
+ Version 6.1.0 of the agent frequently logged error messages about an empty
790
+ JSON response, when no error had occurred. These logs no longer appear.
791
+
792
+ * Bugfix for `Unable to calculate elapsed transaction time` warning messages
793
+
794
+ Ruby Agent versions 5.4 through 6.1, when running in jruby without
795
+ ObjectSpace enabled, would occasionally log a warning indicating that the
796
+ agent was unable to calculate the elapsed transaction time. When this log
797
+ statement appeared, the affected transactions would not be included in the
798
+ data displayed on the capacity analysis page. These transactions are now
799
+ correctly recorded.
800
+
801
+ ## v6.1.0
802
+
803
+ * Performance monitoring on Kubernetes
804
+
805
+ This release adds Transaction event attributes that provide
806
+ context between your Kubernetes cluster and services. For details
807
+ on the benefits, see this [blog
808
+ post](https://blog.newrelic.com/engineering/monitoring-application-performance-in-kubernetes/).
809
+
810
+ * Bugfix for Bunny instrumentation when popping empty queues
811
+
812
+ When a customer calls `Bunny::Queue#pop` on an empty queue, Bunny
813
+ returns a `nil` value. Previous Ruby Agent versions raised a
814
+ `NoMethodError` when trying to process this result. Now, the
815
+ agent correctly skips processing for `nil` values. Thanks to
816
+ Matt Campbell for the contribution.
817
+
818
+ ## v6.0.0
819
+
820
+ * Tracer API for flexible custom instrumentation
821
+
822
+ With agent version 6.0, we are introducing the `Tracer` class, an
823
+ officially supported public API for more flexible custom
824
+ instrumentation. By calling its `in_transaction` method, you can
825
+ instrument an arbitrary section of Ruby code without needing to
826
+ juggle any explicit state. Behind the scenes, the agent will
827
+ make sure that the measured code results in an APM segment inside
828
+ a transaction.
829
+
830
+ The same API contains additional methods for creating
831
+ transactions and segments, and for interacting with the current
832
+ transaction. For more details, see the [custom instrumentation
833
+ documentation](https://docs.newrelic.com/docs/agents/ruby-agent/api-guides/ruby-custom-instrumentation).
834
+
835
+ If you were previously using any of the agent's private,
836
+ undocumented APIs, such as `Transaction.wrap` or
837
+ `Transaction.start/stop`, you will need to update your code to
838
+ use the Tracer API.
839
+
840
+ The full list of APIs that were removed or deprecated are:
841
+ * `External.start_segment`
842
+ * `Transaction.create_segment`
843
+ * `Transaction.start`
844
+ * `Transaction.stop`
845
+ * `Transaction.start_datastore_segment`
846
+ * `Transaction.start_segment`
847
+ * `Transaction.wrap`
848
+ * `TransactionState.current_transaction`
849
+
850
+ If are you using any of these APIs, please see the [upgrade guide](https://docs.newrelic.com/docs/agents/ruby-agent/troubleshooting/update-private-api-calls-public-tracer-api) for a list of replacements.
851
+
852
+ * Agent detects Rails 6.0
853
+
854
+ The agent properly detects Rails 6.0 and no longer logs an error when
855
+ started in a Rails 6.0 environment. This does not include full Rails 6.0
856
+ support, which will be coming in a future release. Thanks to Jacob Bednarz
857
+ for the contribution.
858
+
859
+ ## v5.7.0
860
+
861
+ * Ruby 2.6 support
862
+
863
+ We have tested the agent with the official release of Ruby 2.6.0
864
+ made on December 25, 2018, and it looks great! Feel free to use
865
+ agent v5.7 to measure the performance of your Ruby 2.6
866
+ applications.
867
+
868
+ * Support for loading Sequel core standalone
869
+
870
+ Earlier versions of the agent required users of the Sequel data
871
+ mapping library to load the _entire_ library. The agent will now
872
+ enable Sequel instrumentation when an application loads Sequel's
873
+ core standalone; i.e., without the `Sequel::Model` class. Thanks
874
+ to Vasily Kolesnikov for the contribution!
875
+
876
+ * Grape 1.2 support
877
+
878
+ With agent versions 5.6 and earlier, Grape 1.2 apps reported
879
+ their transactions under the name `Proc#call` instead of the name
880
+ of the API endpoint. Starting with agent version 5.7, all
881
+ existing versions of Grape will report the correct transaction
882
+ name. Thanks to Masato Ohba for the contribution!
883
+
884
+ ## v5.6.0
885
+
886
+ * Bugfix for transactions with `ActionController::Live`
887
+
888
+ Previously, transactions containing `ActionController::Live` resulted in
889
+ incorrect calculations of capacity analysis as well as error backtraces
890
+ appearing in agent logs in agent versions 5.4 and later. The agent now
891
+ correctly calculates capacity for transactions with `ActionController::Live`.
892
+
893
+ * Add ability to exclude attributes from span events and transaction
894
+ segments
895
+
896
+ Agent versions 5.5 and lower could selectively exclude attributes
897
+ from page views, error traces, transaction traces, and
898
+ transaction events. With agent version 5.6 and higher, you can
899
+ also exclude attributes from span events (via the
900
+ `span_events.include/exclude` options) and from transaction
901
+ segments (via the `transaction_segments.include/exclude` options).
902
+
903
+ As with other attribute destinations, these new options will
904
+ inherit values from the top-level `attributes.include/exclude`
905
+ settings. See the
906
+ [documentation](https://docs.newrelic.com/docs/agents/ruby-agent/attributes/enabling-disabling-attributes-ruby)
907
+ for more information.
908
+
909
+ * Increasing backoff sequence on failing to connect to New Relic
910
+
911
+ If the agent cannot reach New Relic, it will now wait for an
912
+ increasing amount of time after each failed attempt. We are also
913
+ starting with a shorter delay initially, which will help customer
914
+ apps bounce back more quickly from transient network errors.
915
+
916
+ * Truncation of long stack traces
917
+
918
+ Previous versions of the agent would truncate long stack traces to
919
+ 50 frames. To give customers more flexibility, we have added the
920
+ `error_collector.max_backtrace_frames` configuration option.
921
+ Thanks to Patrick Tulskie for the contribution!
922
+
923
+ * Update link in documentation
924
+
925
+ The community forum link in `README.md` now goes to the updated
926
+ location. Thanks to Sam Killgallon for the contribution!
927
+
928
+ * Active Storage instrumentation
929
+
930
+ The agent now provides instrumentation for Active Storage, introduced in
931
+ Rails 5.2. Customers will see Active Storage operations represented as
932
+ segments within transaction traces.
933
+
3
934
  ## v5.5.0
4
935
 
5
936
  * Bugfix for `perform` instrumentation with curb gem