ddtrace 0.49.0 → 0.50.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (377) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +49 -73
  3. data/.circleci/images/primary/{Dockerfile-truffleruby-21.0.0 → Dockerfile-truffleruby-21.1.0} +1 -1
  4. data/.gitignore +0 -2
  5. data/.rubocop.yml +0 -8
  6. data/.rubocop_todo.yml +7 -7
  7. data/Appraisals +1 -107
  8. data/CHANGELOG.md +47 -0
  9. data/Rakefile +278 -333
  10. data/benchmarks/data/profiler-submission-marshal.gz +0 -0
  11. data/benchmarks/profiler_submission.rb +93 -0
  12. data/ddtrace.gemspec +1 -1
  13. data/docker-compose.yml +4 -34
  14. data/docs/GettingStarted.md +24 -9
  15. data/gemfiles/jruby_9.2.0.0_contrib.gemfile.lock +1 -1
  16. data/gemfiles/jruby_9.2.0.0_contrib_old.gemfile.lock +1 -1
  17. data/gemfiles/jruby_9.2.0.0_core_old.gemfile.lock +1 -1
  18. data/gemfiles/jruby_9.2.0.0_cucumber3.gemfile.lock +1 -1
  19. data/gemfiles/jruby_9.2.0.0_cucumber4.gemfile.lock +1 -1
  20. data/gemfiles/jruby_9.2.0.0_cucumber5.gemfile.lock +1 -1
  21. data/gemfiles/jruby_9.2.0.0_rails5_mysql2.gemfile.lock +1 -1
  22. data/gemfiles/jruby_9.2.0.0_rails5_postgres.gemfile.lock +1 -1
  23. data/gemfiles/jruby_9.2.0.0_rails5_postgres_redis.gemfile.lock +1 -1
  24. data/gemfiles/jruby_9.2.0.0_rails5_postgres_redis_activesupport.gemfile.lock +1 -1
  25. data/gemfiles/jruby_9.2.0.0_rails5_postgres_sidekiq.gemfile.lock +1 -1
  26. data/gemfiles/jruby_9.2.0.0_rails61_mysql2.gemfile.lock +1 -1
  27. data/gemfiles/jruby_9.2.0.0_rails61_postgres.gemfile.lock +1 -1
  28. data/gemfiles/jruby_9.2.0.0_rails61_postgres_redis.gemfile.lock +1 -1
  29. data/gemfiles/jruby_9.2.0.0_rails61_postgres_sidekiq.gemfile.lock +1 -1
  30. data/gemfiles/jruby_9.2.0.0_rails6_mysql2.gemfile.lock +1 -1
  31. data/gemfiles/jruby_9.2.0.0_rails6_postgres.gemfile.lock +1 -1
  32. data/gemfiles/jruby_9.2.0.0_rails6_postgres_redis.gemfile.lock +1 -1
  33. data/gemfiles/jruby_9.2.0.0_rails6_postgres_redis_activesupport.gemfile.lock +1 -1
  34. data/gemfiles/jruby_9.2.0.0_rails6_postgres_sidekiq.gemfile.lock +1 -1
  35. data/gemfiles/jruby_9.2.0.0_resque2_redis3.gemfile.lock +1 -1
  36. data/gemfiles/jruby_9.2.0.0_resque2_redis4.gemfile.lock +1 -1
  37. data/gemfiles/jruby_9.2.11.1_contrib.gemfile.lock +1 -1
  38. data/gemfiles/jruby_9.2.11.1_contrib_old.gemfile.lock +1 -1
  39. data/gemfiles/jruby_9.2.11.1_core_old.gemfile.lock +1 -1
  40. data/gemfiles/jruby_9.2.11.1_cucumber3.gemfile.lock +1 -1
  41. data/gemfiles/jruby_9.2.11.1_cucumber4.gemfile.lock +1 -1
  42. data/gemfiles/jruby_9.2.11.1_cucumber5.gemfile.lock +1 -1
  43. data/gemfiles/jruby_9.2.11.1_rails5_mysql2.gemfile.lock +1 -1
  44. data/gemfiles/jruby_9.2.11.1_rails5_postgres.gemfile.lock +1 -1
  45. data/gemfiles/jruby_9.2.11.1_rails5_postgres_redis.gemfile.lock +1 -1
  46. data/gemfiles/jruby_9.2.11.1_rails5_postgres_redis_activesupport.gemfile.lock +1 -1
  47. data/gemfiles/jruby_9.2.11.1_rails5_postgres_sidekiq.gemfile.lock +1 -1
  48. data/gemfiles/jruby_9.2.11.1_rails61_mysql2.gemfile.lock +1 -1
  49. data/gemfiles/jruby_9.2.11.1_rails61_postgres.gemfile.lock +1 -1
  50. data/gemfiles/jruby_9.2.11.1_rails61_postgres_redis.gemfile.lock +1 -1
  51. data/gemfiles/jruby_9.2.11.1_rails61_postgres_sidekiq.gemfile.lock +1 -1
  52. data/gemfiles/jruby_9.2.11.1_rails6_mysql2.gemfile.lock +1 -1
  53. data/gemfiles/jruby_9.2.11.1_rails6_postgres.gemfile.lock +1 -1
  54. data/gemfiles/jruby_9.2.11.1_rails6_postgres_redis.gemfile.lock +1 -1
  55. data/gemfiles/jruby_9.2.11.1_rails6_postgres_redis_activesupport.gemfile.lock +1 -1
  56. data/gemfiles/jruby_9.2.11.1_rails6_postgres_sidekiq.gemfile.lock +1 -1
  57. data/gemfiles/jruby_9.2.11.1_resque2_redis3.gemfile.lock +1 -1
  58. data/gemfiles/jruby_9.2.11.1_resque2_redis4.gemfile.lock +1 -1
  59. data/gemfiles/ruby_2.1.10_contrib_old.gemfile.lock +1 -1
  60. data/gemfiles/ruby_2.1.10_core_old.gemfile.lock +1 -1
  61. data/gemfiles/ruby_2.1.10_rails30_postgres.gemfile.lock +1 -1
  62. data/gemfiles/ruby_2.1.10_rails30_postgres_sidekiq.gemfile.lock +1 -1
  63. data/gemfiles/ruby_2.1.10_rails32_mysql2.gemfile.lock +1 -1
  64. data/gemfiles/ruby_2.1.10_rails32_postgres.gemfile.lock +1 -1
  65. data/gemfiles/ruby_2.1.10_rails32_postgres_redis.gemfile.lock +1 -1
  66. data/gemfiles/ruby_2.1.10_rails32_postgres_sidekiq.gemfile.lock +1 -1
  67. data/gemfiles/ruby_2.1.10_rails4_mysql2.gemfile.lock +1 -1
  68. data/gemfiles/ruby_2.1.10_rails4_postgres.gemfile.lock +1 -1
  69. data/gemfiles/ruby_2.1.10_rails4_postgres_redis.gemfile.lock +1 -1
  70. data/gemfiles/ruby_2.2.10_contrib.gemfile.lock +1 -1
  71. data/gemfiles/ruby_2.2.10_core_old.gemfile.lock +1 -1
  72. data/gemfiles/ruby_2.2.10_rails30_postgres.gemfile.lock +1 -1
  73. data/gemfiles/ruby_2.2.10_rails30_postgres_sidekiq.gemfile.lock +1 -1
  74. data/gemfiles/ruby_2.2.10_rails32_mysql2.gemfile.lock +1 -1
  75. data/gemfiles/ruby_2.2.10_rails32_postgres.gemfile.lock +1 -1
  76. data/gemfiles/ruby_2.2.10_rails32_postgres_redis.gemfile.lock +1 -1
  77. data/gemfiles/ruby_2.2.10_rails32_postgres_sidekiq.gemfile.lock +1 -1
  78. data/gemfiles/ruby_2.2.10_rails4_mysql2.gemfile.lock +1 -1
  79. data/gemfiles/ruby_2.2.10_rails4_postgres.gemfile.lock +1 -1
  80. data/gemfiles/ruby_2.2.10_rails4_postgres_redis.gemfile.lock +1 -1
  81. data/gemfiles/ruby_2.2.10_rails4_postgres_sidekiq.gemfile.lock +1 -1
  82. data/gemfiles/ruby_2.2.10_rails5_mysql2.gemfile.lock +1 -1
  83. data/gemfiles/ruby_2.2.10_rails5_postgres.gemfile.lock +1 -1
  84. data/gemfiles/ruby_2.2.10_rails5_postgres_redis.gemfile.lock +1 -1
  85. data/gemfiles/ruby_2.2.10_rails5_postgres_redis_activesupport.gemfile.lock +1 -1
  86. data/gemfiles/ruby_2.2.10_rails5_postgres_sidekiq.gemfile.lock +1 -1
  87. data/gemfiles/ruby_2.3.8_contrib.gemfile.lock +1 -1
  88. data/gemfiles/ruby_2.3.8_contrib_old.gemfile.lock +1 -1
  89. data/gemfiles/ruby_2.3.8_core_old.gemfile.lock +1 -1
  90. data/gemfiles/ruby_2.3.8_cucumber3.gemfile.lock +1 -1
  91. data/gemfiles/ruby_2.3.8_cucumber4.gemfile.lock +1 -1
  92. data/gemfiles/ruby_2.3.8_rails30_postgres.gemfile.lock +1 -1
  93. data/gemfiles/ruby_2.3.8_rails30_postgres_sidekiq.gemfile.lock +1 -1
  94. data/gemfiles/ruby_2.3.8_rails32_mysql2.gemfile.lock +1 -1
  95. data/gemfiles/ruby_2.3.8_rails32_postgres.gemfile.lock +1 -1
  96. data/gemfiles/ruby_2.3.8_rails32_postgres_redis.gemfile.lock +1 -1
  97. data/gemfiles/ruby_2.3.8_rails32_postgres_sidekiq.gemfile.lock +1 -1
  98. data/gemfiles/ruby_2.3.8_rails4_mysql2.gemfile.lock +1 -1
  99. data/gemfiles/ruby_2.3.8_rails4_postgres.gemfile.lock +1 -1
  100. data/gemfiles/ruby_2.3.8_rails4_postgres_redis.gemfile.lock +1 -1
  101. data/gemfiles/ruby_2.3.8_rails4_postgres_sidekiq.gemfile.lock +1 -1
  102. data/gemfiles/ruby_2.3.8_rails5_mysql2.gemfile.lock +1 -1
  103. data/gemfiles/ruby_2.3.8_rails5_postgres.gemfile.lock +1 -1
  104. data/gemfiles/ruby_2.3.8_rails5_postgres_redis.gemfile.lock +1 -1
  105. data/gemfiles/ruby_2.3.8_rails5_postgres_redis_activesupport.gemfile.lock +1 -1
  106. data/gemfiles/ruby_2.3.8_rails5_postgres_sidekiq.gemfile.lock +1 -1
  107. data/gemfiles/ruby_2.3.8_resque2_redis3.gemfile.lock +1 -1
  108. data/gemfiles/ruby_2.3.8_resque2_redis4.gemfile.lock +1 -1
  109. data/gemfiles/ruby_2.4.6_contrib.gemfile.lock +1 -1
  110. data/gemfiles/ruby_2.4.6_contrib_old.gemfile.lock +1 -1
  111. data/gemfiles/ruby_2.4.6_core_old.gemfile.lock +1 -1
  112. data/gemfiles/ruby_2.4.6_cucumber3.gemfile.lock +1 -1
  113. data/gemfiles/ruby_2.4.6_cucumber4.gemfile.lock +1 -1
  114. data/gemfiles/ruby_2.4.6_rails5_mysql2.gemfile.lock +1 -1
  115. data/gemfiles/ruby_2.4.6_rails5_postgres.gemfile.lock +1 -1
  116. data/gemfiles/ruby_2.4.6_rails5_postgres_redis.gemfile.lock +1 -1
  117. data/gemfiles/ruby_2.4.6_rails5_postgres_redis_activesupport.gemfile.lock +1 -1
  118. data/gemfiles/ruby_2.4.6_rails5_postgres_sidekiq.gemfile.lock +1 -1
  119. data/gemfiles/ruby_2.4.6_resque2_redis3.gemfile.lock +1 -1
  120. data/gemfiles/ruby_2.4.6_resque2_redis4.gemfile.lock +1 -1
  121. data/gemfiles/ruby_2.5.6_contrib.gemfile.lock +1 -1
  122. data/gemfiles/ruby_2.5.6_contrib_old.gemfile.lock +1 -1
  123. data/gemfiles/ruby_2.5.6_core_old.gemfile.lock +1 -1
  124. data/gemfiles/ruby_2.5.6_cucumber3.gemfile.lock +1 -1
  125. data/gemfiles/ruby_2.5.6_cucumber4.gemfile.lock +1 -1
  126. data/gemfiles/ruby_2.5.6_cucumber5.gemfile.lock +1 -1
  127. data/gemfiles/ruby_2.5.6_rails5_mysql2.gemfile.lock +1 -1
  128. data/gemfiles/ruby_2.5.6_rails5_postgres.gemfile.lock +1 -1
  129. data/gemfiles/ruby_2.5.6_rails5_postgres_redis.gemfile.lock +1 -1
  130. data/gemfiles/ruby_2.5.6_rails5_postgres_redis_activesupport.gemfile.lock +1 -1
  131. data/gemfiles/ruby_2.5.6_rails5_postgres_sidekiq.gemfile.lock +1 -1
  132. data/gemfiles/ruby_2.5.6_rails61_mysql2.gemfile.lock +1 -1
  133. data/gemfiles/ruby_2.5.6_rails61_postgres.gemfile.lock +1 -1
  134. data/gemfiles/ruby_2.5.6_rails61_postgres_redis.gemfile.lock +1 -1
  135. data/gemfiles/ruby_2.5.6_rails61_postgres_sidekiq.gemfile.lock +1 -1
  136. data/gemfiles/ruby_2.5.6_rails6_mysql2.gemfile.lock +1 -1
  137. data/gemfiles/ruby_2.5.6_rails6_postgres.gemfile.lock +1 -1
  138. data/gemfiles/ruby_2.5.6_rails6_postgres_redis.gemfile.lock +1 -1
  139. data/gemfiles/ruby_2.5.6_rails6_postgres_redis_activesupport.gemfile.lock +1 -1
  140. data/gemfiles/ruby_2.5.6_rails6_postgres_sidekiq.gemfile.lock +1 -1
  141. data/gemfiles/ruby_2.5.6_resque2_redis3.gemfile.lock +1 -1
  142. data/gemfiles/ruby_2.5.6_resque2_redis4.gemfile.lock +1 -1
  143. data/gemfiles/ruby_2.6.4_contrib.gemfile.lock +1 -1
  144. data/gemfiles/ruby_2.6.4_contrib_old.gemfile.lock +1 -1
  145. data/gemfiles/ruby_2.6.4_core_old.gemfile.lock +1 -1
  146. data/gemfiles/ruby_2.6.4_cucumber3.gemfile.lock +1 -1
  147. data/gemfiles/ruby_2.6.4_cucumber4.gemfile.lock +1 -1
  148. data/gemfiles/ruby_2.6.4_cucumber5.gemfile.lock +1 -1
  149. data/gemfiles/ruby_2.6.4_rails5_mysql2.gemfile.lock +1 -1
  150. data/gemfiles/ruby_2.6.4_rails5_postgres.gemfile.lock +1 -1
  151. data/gemfiles/ruby_2.6.4_rails5_postgres_redis.gemfile.lock +1 -1
  152. data/gemfiles/ruby_2.6.4_rails5_postgres_redis_activesupport.gemfile.lock +1 -1
  153. data/gemfiles/ruby_2.6.4_rails5_postgres_sidekiq.gemfile.lock +1 -1
  154. data/gemfiles/ruby_2.6.4_rails61_mysql2.gemfile.lock +1 -1
  155. data/gemfiles/ruby_2.6.4_rails61_postgres.gemfile.lock +1 -1
  156. data/gemfiles/ruby_2.6.4_rails61_postgres_redis.gemfile.lock +1 -1
  157. data/gemfiles/ruby_2.6.4_rails61_postgres_sidekiq.gemfile.lock +1 -1
  158. data/gemfiles/ruby_2.6.4_rails6_mysql2.gemfile.lock +1 -1
  159. data/gemfiles/ruby_2.6.4_rails6_postgres.gemfile.lock +1 -1
  160. data/gemfiles/ruby_2.6.4_rails6_postgres_redis.gemfile.lock +1 -1
  161. data/gemfiles/ruby_2.6.4_rails6_postgres_redis_activesupport.gemfile.lock +1 -1
  162. data/gemfiles/ruby_2.6.4_rails6_postgres_sidekiq.gemfile.lock +1 -1
  163. data/gemfiles/ruby_2.6.4_resque2_redis3.gemfile.lock +1 -1
  164. data/gemfiles/ruby_2.6.4_resque2_redis4.gemfile.lock +1 -1
  165. data/gemfiles/ruby_2.7.0_contrib.gemfile.lock +1 -1
  166. data/gemfiles/ruby_2.7.0_contrib_old.gemfile.lock +1 -1
  167. data/gemfiles/ruby_2.7.0_core_old.gemfile.lock +1 -1
  168. data/gemfiles/ruby_2.7.0_cucumber3.gemfile.lock +1 -1
  169. data/gemfiles/ruby_2.7.0_cucumber4.gemfile.lock +1 -1
  170. data/gemfiles/ruby_2.7.0_cucumber5.gemfile.lock +1 -1
  171. data/gemfiles/ruby_2.7.0_rails5_mysql2.gemfile.lock +1 -1
  172. data/gemfiles/ruby_2.7.0_rails5_postgres.gemfile.lock +1 -1
  173. data/gemfiles/ruby_2.7.0_rails5_postgres_redis.gemfile.lock +1 -1
  174. data/gemfiles/ruby_2.7.0_rails5_postgres_redis_activesupport.gemfile.lock +1 -1
  175. data/gemfiles/ruby_2.7.0_rails5_postgres_sidekiq.gemfile.lock +1 -1
  176. data/gemfiles/ruby_2.7.0_rails61_mysql2.gemfile.lock +1 -1
  177. data/gemfiles/ruby_2.7.0_rails61_postgres.gemfile.lock +1 -1
  178. data/gemfiles/ruby_2.7.0_rails61_postgres_redis.gemfile.lock +1 -1
  179. data/gemfiles/ruby_2.7.0_rails61_postgres_sidekiq.gemfile.lock +1 -1
  180. data/gemfiles/ruby_2.7.0_rails6_mysql2.gemfile.lock +1 -1
  181. data/gemfiles/ruby_2.7.0_rails6_postgres.gemfile.lock +1 -1
  182. data/gemfiles/ruby_2.7.0_rails6_postgres_redis.gemfile.lock +1 -1
  183. data/gemfiles/ruby_2.7.0_rails6_postgres_redis_activesupport.gemfile.lock +1 -1
  184. data/gemfiles/ruby_2.7.0_rails6_postgres_sidekiq.gemfile.lock +1 -1
  185. data/gemfiles/ruby_2.7.0_resque2_redis3.gemfile.lock +1 -1
  186. data/gemfiles/ruby_2.7.0_resque2_redis4.gemfile.lock +1 -1
  187. data/gemfiles/ruby_3.0.0_contrib.gemfile +1 -0
  188. data/gemfiles/ruby_3.0.0_contrib.gemfile.lock +7 -1
  189. data/gemfiles/ruby_3.0.0_core_old.gemfile.lock +1 -1
  190. data/gemfiles/ruby_3.0.0_cucumber3.gemfile.lock +1 -1
  191. data/gemfiles/ruby_3.0.0_cucumber4.gemfile.lock +1 -1
  192. data/gemfiles/ruby_3.0.0_cucumber5.gemfile.lock +1 -1
  193. data/gemfiles/ruby_3.0.0_rails61_mysql2.gemfile.lock +1 -1
  194. data/gemfiles/ruby_3.0.0_rails61_postgres.gemfile.lock +1 -1
  195. data/gemfiles/ruby_3.0.0_rails61_postgres_redis.gemfile.lock +1 -1
  196. data/gemfiles/ruby_3.0.0_rails61_postgres_sidekiq.gemfile.lock +1 -1
  197. data/gemfiles/ruby_3.0.0_resque2_redis3.gemfile.lock +1 -1
  198. data/gemfiles/ruby_3.0.0_resque2_redis4.gemfile.lock +1 -1
  199. data/integration/apps/rack/README.md +2 -2
  200. data/integration/apps/rack/script/ci +2 -1
  201. data/integration/apps/rails-five/README.md +2 -2
  202. data/integration/apps/rails-five/script/ci +2 -1
  203. data/integration/apps/rspec/.dockerignore +1 -0
  204. data/integration/apps/rspec/.envrc.sample +1 -0
  205. data/integration/apps/rspec/.gitignore +2 -0
  206. data/integration/apps/rspec/.rspec +1 -0
  207. data/integration/apps/rspec/Dockerfile +25 -0
  208. data/integration/apps/rspec/Dockerfile-ci +11 -0
  209. data/integration/apps/rspec/Gemfile +14 -0
  210. data/integration/apps/rspec/README.md +70 -0
  211. data/integration/apps/rspec/agent.yaml +3 -0
  212. data/integration/apps/rspec/app/datadog.rb +13 -0
  213. data/integration/apps/rspec/app/fibonacci.rb +30 -0
  214. data/integration/apps/rspec/bin/run +20 -0
  215. data/integration/apps/rspec/bin/setup +17 -0
  216. data/integration/apps/rspec/bin/test +21 -0
  217. data/integration/apps/rspec/docker-compose.ci.yml +51 -0
  218. data/integration/apps/rspec/docker-compose.yml +63 -0
  219. data/integration/apps/rspec/script/build-images +37 -0
  220. data/integration/apps/rspec/script/ci +53 -0
  221. data/integration/apps/rspec/spec/fibonacci_spec.rb +16 -0
  222. data/integration/apps/rspec/spec/rspec_spec.rb +58 -0
  223. data/integration/apps/rspec/spec/spec_helper.rb +24 -0
  224. data/integration/apps/ruby/README.md +2 -2
  225. data/integration/apps/ruby/script/ci +2 -1
  226. data/lib/datadog/ci.rb +16 -0
  227. data/lib/datadog/ci/configuration/components.rb +30 -0
  228. data/lib/datadog/ci/configuration/settings.rb +36 -0
  229. data/lib/datadog/ci/context_flush.rb +28 -0
  230. data/lib/datadog/ci/contrib/cucumber/configuration/settings.rb +30 -0
  231. data/lib/datadog/ci/contrib/cucumber/ext.rb +19 -0
  232. data/lib/datadog/ci/contrib/cucumber/formatter.rb +97 -0
  233. data/lib/datadog/ci/contrib/cucumber/instrumentation.rb +26 -0
  234. data/lib/datadog/ci/contrib/cucumber/integration.rb +47 -0
  235. data/lib/datadog/ci/contrib/cucumber/patcher.rb +25 -0
  236. data/lib/datadog/ci/contrib/rspec/configuration/settings.rb +30 -0
  237. data/lib/datadog/ci/contrib/rspec/example.rb +73 -0
  238. data/lib/datadog/ci/contrib/rspec/ext.rb +18 -0
  239. data/lib/datadog/ci/contrib/rspec/integration.rb +48 -0
  240. data/lib/datadog/ci/contrib/rspec/patcher.rb +25 -0
  241. data/lib/datadog/ci/ext/app_types.rb +9 -0
  242. data/lib/datadog/ci/ext/environment.rb +303 -0
  243. data/lib/datadog/ci/ext/settings.rb +10 -0
  244. data/lib/datadog/ci/ext/test.rb +28 -0
  245. data/lib/datadog/ci/extensions.rb +17 -0
  246. data/lib/datadog/ci/test.rb +63 -0
  247. data/lib/ddtrace.rb +0 -2
  248. data/lib/ddtrace/configuration.rb +1 -23
  249. data/lib/ddtrace/configuration/agent_settings_resolver.rb +8 -19
  250. data/lib/ddtrace/configuration/base.rb +6 -9
  251. data/lib/ddtrace/configuration/components.rb +33 -10
  252. data/lib/ddtrace/configuration/options.rb +2 -2
  253. data/lib/ddtrace/configuration/settings.rb +49 -1
  254. data/lib/ddtrace/context.rb +17 -14
  255. data/lib/ddtrace/context_flush.rb +14 -2
  256. data/lib/ddtrace/contrib/action_cable/event.rb +4 -4
  257. data/lib/ddtrace/contrib/action_pack/action_controller/patcher.rb +1 -1
  258. data/lib/ddtrace/contrib/action_view/event.rb +2 -2
  259. data/lib/ddtrace/contrib/action_view/patcher.rb +4 -4
  260. data/lib/ddtrace/contrib/active_model_serializers/event.rb +2 -2
  261. data/lib/ddtrace/contrib/active_record/event.rb +2 -2
  262. data/lib/ddtrace/contrib/active_support/cache/patcher.rb +7 -7
  263. data/lib/ddtrace/contrib/active_support/cache/redis.rb +1 -5
  264. data/lib/ddtrace/contrib/active_support/notifications/event.rb +2 -2
  265. data/lib/ddtrace/contrib/active_support/notifications/subscriber.rb +1 -1
  266. data/lib/ddtrace/contrib/auto_instrument.rb +1 -1
  267. data/lib/ddtrace/contrib/aws/instrumentation.rb +29 -0
  268. data/lib/ddtrace/contrib/aws/patcher.rb +4 -0
  269. data/lib/ddtrace/contrib/concurrent_ruby/patcher.rb +1 -1
  270. data/lib/ddtrace/contrib/configurable.rb +1 -1
  271. data/lib/ddtrace/contrib/dalli/instrumentation.rb +1 -1
  272. data/lib/ddtrace/contrib/dalli/patcher.rb +1 -1
  273. data/lib/ddtrace/contrib/ethon/easy_patch.rb +1 -1
  274. data/lib/ddtrace/contrib/ethon/multi_patch.rb +1 -1
  275. data/lib/ddtrace/contrib/ethon/patcher.rb +2 -2
  276. data/lib/ddtrace/contrib/extensions.rb +3 -3
  277. data/lib/ddtrace/contrib/faraday/patcher.rb +2 -2
  278. data/lib/ddtrace/contrib/grape/instrumentation.rb +2 -2
  279. data/lib/ddtrace/contrib/grape/patcher.rb +1 -1
  280. data/lib/ddtrace/contrib/grpc/patcher.rb +1 -1
  281. data/lib/ddtrace/contrib/http/instrumentation.rb +1 -1
  282. data/lib/ddtrace/contrib/http/patcher.rb +1 -1
  283. data/lib/ddtrace/contrib/httpclient/instrumentation.rb +1 -1
  284. data/lib/ddtrace/contrib/httpclient/patcher.rb +1 -1
  285. data/lib/ddtrace/contrib/httprb/instrumentation.rb +1 -1
  286. data/lib/ddtrace/contrib/httprb/patcher.rb +1 -1
  287. data/lib/ddtrace/contrib/integration.rb +3 -3
  288. data/lib/ddtrace/contrib/kafka/event.rb +2 -2
  289. data/lib/ddtrace/contrib/mongodb/instrumentation.rb +2 -2
  290. data/lib/ddtrace/contrib/mongodb/patcher.rb +2 -2
  291. data/lib/ddtrace/contrib/mysql2/instrumentation.rb +1 -1
  292. data/lib/ddtrace/contrib/mysql2/patcher.rb +1 -1
  293. data/lib/ddtrace/contrib/patchable.rb +2 -2
  294. data/lib/ddtrace/contrib/patcher.rb +2 -2
  295. data/lib/ddtrace/contrib/presto/instrumentation.rb +1 -1
  296. data/lib/ddtrace/contrib/presto/patcher.rb +1 -1
  297. data/lib/ddtrace/contrib/qless/patcher.rb +3 -5
  298. data/lib/ddtrace/contrib/racecar/event.rb +2 -2
  299. data/lib/ddtrace/contrib/rake/instrumentation.rb +1 -1
  300. data/lib/ddtrace/contrib/rake/patcher.rb +1 -1
  301. data/lib/ddtrace/contrib/registerable.rb +2 -2
  302. data/lib/ddtrace/contrib/resque/patcher.rb +1 -1
  303. data/lib/ddtrace/contrib/rest_client/patcher.rb +1 -1
  304. data/lib/ddtrace/contrib/rest_client/request_patch.rb +1 -1
  305. data/lib/ddtrace/contrib/sequel/database.rb +1 -1
  306. data/lib/ddtrace/contrib/sequel/dataset.rb +1 -1
  307. data/lib/ddtrace/contrib/sequel/patcher.rb +2 -2
  308. data/lib/ddtrace/contrib/sinatra/patcher.rb +1 -1
  309. data/lib/ddtrace/contrib/sucker_punch/exception_handler.rb +4 -6
  310. data/lib/ddtrace/diagnostics/environment_logger.rb +2 -2
  311. data/lib/ddtrace/error.rb +52 -61
  312. data/lib/ddtrace/ext/app_types.rb +0 -1
  313. data/lib/ddtrace/ext/test.rb +2 -18
  314. data/lib/ddtrace/metrics.rb +28 -3
  315. data/lib/ddtrace/opentelemetry/extensions.rb +1 -1
  316. data/lib/ddtrace/opentracer.rb +20 -39
  317. data/lib/ddtrace/patcher.rb +2 -2
  318. data/lib/ddtrace/profiling.rb +11 -9
  319. data/lib/ddtrace/profiling/collectors/stack.rb +5 -2
  320. data/lib/ddtrace/profiling/encoding/profile.rb +6 -0
  321. data/lib/ddtrace/profiling/ext/cpu.rb +2 -2
  322. data/lib/ddtrace/profiling/ext/cthread.rb +9 -11
  323. data/lib/ddtrace/profiling/ext/forking.rb +7 -7
  324. data/lib/ddtrace/profiling/flush.rb +3 -1
  325. data/lib/ddtrace/profiling/pprof/builder.rb +26 -28
  326. data/lib/ddtrace/profiling/pprof/converter.rb +4 -0
  327. data/lib/ddtrace/profiling/pprof/stack_sample.rb +17 -1
  328. data/lib/ddtrace/profiling/pprof/template.rb +4 -0
  329. data/lib/ddtrace/profiling/scheduler.rb +12 -1
  330. data/lib/ddtrace/profiling/tasks/setup.rb +13 -13
  331. data/lib/ddtrace/profiling/transport/http/api/endpoint.rb +11 -2
  332. data/lib/ddtrace/runtime/metrics.rb +3 -5
  333. data/lib/ddtrace/sync_writer.rb +2 -1
  334. data/lib/ddtrace/tracer.rb +8 -4
  335. data/lib/ddtrace/transport/http/statistics.rb +2 -2
  336. data/lib/ddtrace/transport/http/traces.rb +3 -3
  337. data/lib/ddtrace/transport/io/traces.rb +1 -1
  338. data/lib/ddtrace/utils/forking.rb +1 -1
  339. data/lib/ddtrace/utils/object_set.rb +3 -5
  340. data/lib/ddtrace/utils/time.rb +1 -3
  341. data/lib/ddtrace/version.rb +2 -4
  342. data/lib/ddtrace/workers.rb +1 -1
  343. data/lib/ddtrace/workers/async.rb +3 -2
  344. data/lib/ddtrace/workers/loop.rb +1 -1
  345. data/lib/ddtrace/workers/polling.rb +11 -5
  346. data/lib/ddtrace/workers/queue.rb +1 -1
  347. metadata +48 -34
  348. data/.circleci/images/primary/Dockerfile-2.0.0 +0 -83
  349. data/gemfiles/ruby_2.0.0_contrib_old.gemfile +0 -64
  350. data/gemfiles/ruby_2.0.0_contrib_old.gemfile.lock +0 -290
  351. data/gemfiles/ruby_2.0.0_core_old.gemfile +0 -33
  352. data/gemfiles/ruby_2.0.0_core_old.gemfile.lock +0 -118
  353. data/gemfiles/ruby_2.0.0_rails30_postgres.gemfile +0 -39
  354. data/gemfiles/ruby_2.0.0_rails30_postgres.gemfile.lock +0 -196
  355. data/gemfiles/ruby_2.0.0_rails30_postgres_sidekiq.gemfile +0 -40
  356. data/gemfiles/ruby_2.0.0_rails30_postgres_sidekiq.gemfile.lock +0 -205
  357. data/gemfiles/ruby_2.0.0_rails32_mysql2.gemfile +0 -43
  358. data/gemfiles/ruby_2.0.0_rails32_mysql2.gemfile.lock +0 -217
  359. data/gemfiles/ruby_2.0.0_rails32_postgres.gemfile +0 -39
  360. data/gemfiles/ruby_2.0.0_rails32_postgres.gemfile.lock +0 -204
  361. data/gemfiles/ruby_2.0.0_rails32_postgres_redis.gemfile +0 -41
  362. data/gemfiles/ruby_2.0.0_rails32_postgres_redis.gemfile.lock +0 -223
  363. data/gemfiles/ruby_2.0.0_rails32_postgres_sidekiq.gemfile +0 -40
  364. data/gemfiles/ruby_2.0.0_rails32_postgres_sidekiq.gemfile.lock +0 -213
  365. data/integration/images/ruby/2.0/Dockerfile +0 -54
  366. data/lib/ddtrace/contrib/cucumber/configuration/settings.rb +0 -28
  367. data/lib/ddtrace/contrib/cucumber/ext.rb +0 -17
  368. data/lib/ddtrace/contrib/cucumber/formatter.rb +0 -98
  369. data/lib/ddtrace/contrib/cucumber/instrumentation.rb +0 -24
  370. data/lib/ddtrace/contrib/cucumber/integration.rb +0 -45
  371. data/lib/ddtrace/contrib/cucumber/patcher.rb +0 -23
  372. data/lib/ddtrace/contrib/rspec/configuration/settings.rb +0 -28
  373. data/lib/ddtrace/contrib/rspec/example.rb +0 -75
  374. data/lib/ddtrace/contrib/rspec/ext.rb +0 -16
  375. data/lib/ddtrace/contrib/rspec/integration.rb +0 -46
  376. data/lib/ddtrace/contrib/rspec/patcher.rb +0 -23
  377. data/lib/ddtrace/ext/ci.rb +0 -297
@@ -24,7 +24,7 @@ module Datadog
24
24
 
25
25
  def prepend_interceptor
26
26
  ::GRPC::InterceptionContext
27
- .send(:prepend, Datadog::Contrib::GRPC::InterceptWithDatadog)
27
+ .prepend(Datadog::Contrib::GRPC::InterceptWithDatadog)
28
28
  end
29
29
  end
30
30
  end
@@ -14,7 +14,7 @@ module Datadog
14
14
  # Instrumentation for Net::HTTP
15
15
  module Instrumentation
16
16
  def self.included(base)
17
- base.send(:prepend, InstanceMethods)
17
+ base.prepend(InstanceMethods)
18
18
  end
19
19
 
20
20
  # Span hook invoked after request is completed.
@@ -18,7 +18,7 @@ module Datadog
18
18
 
19
19
  # patch applies our patch if needed
20
20
  def patch
21
- ::Net::HTTP.send(:include, Instrumentation)
21
+ ::Net::HTTP.include(Instrumentation)
22
22
  end
23
23
  end
24
24
  end
@@ -12,7 +12,7 @@ module Datadog
12
12
  # Instrumentation for Httpclient
13
13
  module Instrumentation
14
14
  def self.included(base)
15
- base.send(:prepend, InstanceMethods)
15
+ base.prepend(InstanceMethods)
16
16
  end
17
17
 
18
18
  # Instance methods for configuration
@@ -26,7 +26,7 @@ module Datadog
26
26
  def patch
27
27
  PATCH_ONLY_ONCE.run do
28
28
  begin
29
- ::HTTPClient.send(:include, Instrumentation)
29
+ ::HTTPClient.include(Instrumentation)
30
30
  rescue StandardError => e
31
31
  Datadog::Logger.error("Unable to apply httpclient integration: #{e}")
32
32
  end
@@ -12,7 +12,7 @@ module Datadog
12
12
  # Instrumentation for Httprb
13
13
  module Instrumentation
14
14
  def self.included(base)
15
- base.send(:prepend, InstanceMethods)
15
+ base.prepend(InstanceMethods)
16
16
  end
17
17
 
18
18
  # Instance methods for configuration
@@ -26,7 +26,7 @@ module Datadog
26
26
  def patch
27
27
  PATCH_ONLY_ONCE.run do
28
28
  begin
29
- ::HTTP::Client.send(:include, Instrumentation)
29
+ ::HTTP::Client.include(Instrumentation)
30
30
  rescue StandardError => e
31
31
  Datadog::Logger.error("Unable to apply httprb integration: #{e}")
32
32
  end
@@ -7,9 +7,9 @@ module Datadog
7
7
  # Base provides features that are shared across all integrations
8
8
  module Integration
9
9
  def self.included(base)
10
- base.send(:include, Configurable)
11
- base.send(:include, Patchable)
12
- base.send(:include, Registerable)
10
+ base.include(Configurable)
11
+ base.include(Patchable)
12
+ base.include(Registerable)
13
13
  end
14
14
  end
15
15
  end
@@ -8,8 +8,8 @@ module Datadog
8
8
  # Defines basic behaviors for an ActiveSupport event.
9
9
  module Event
10
10
  def self.included(base)
11
- base.send(:include, ActiveSupport::Notifications::Event)
12
- base.send(:extend, ClassMethods)
11
+ base.include(ActiveSupport::Notifications::Event)
12
+ base.extend(ClassMethods)
13
13
  end
14
14
 
15
15
  # Class methods for Kafka events.
@@ -13,7 +13,7 @@ module Datadog
13
13
  # Instrumentation for Mongo::Client
14
14
  module Client
15
15
  def self.included(base)
16
- base.send(:include, InstanceMethods)
16
+ base.include(InstanceMethods)
17
17
  end
18
18
 
19
19
  # Instance methods for Mongo::Client
@@ -44,7 +44,7 @@ module Datadog
44
44
  # Instrumentation for Mongo::Address
45
45
  module Address
46
46
  def self.included(base)
47
- base.send(:include, InstanceMethods)
47
+ base.include(InstanceMethods)
48
48
  end
49
49
 
50
50
  # Instance methods for Mongo::Address
@@ -16,8 +16,8 @@ module Datadog
16
16
  end
17
17
 
18
18
  def patch
19
- ::Mongo::Address.send(:include, Instrumentation::Address)
20
- ::Mongo::Client.send(:include, Instrumentation::Client)
19
+ ::Mongo::Address.include(Instrumentation::Address)
20
+ ::Mongo::Client.include(Instrumentation::Client)
21
21
  add_mongo_monitoring
22
22
  end
23
23
 
@@ -11,7 +11,7 @@ module Datadog
11
11
  # Mysql2::Client patch module
12
12
  module Instrumentation
13
13
  def self.included(base)
14
- base.send(:prepend, InstanceMethods)
14
+ base.prepend(InstanceMethods)
15
15
  end
16
16
 
17
17
  # Mysql2::Client patch instance methods
@@ -19,7 +19,7 @@ module Datadog
19
19
  end
20
20
 
21
21
  def patch_mysql2_client
22
- ::Mysql2::Client.send(:include, Instrumentation)
22
+ ::Mysql2::Client.include(Instrumentation)
23
23
  end
24
24
  end
25
25
  end
@@ -3,8 +3,8 @@ module Datadog
3
3
  # Base provides features that are shared across all integrations
4
4
  module Patchable
5
5
  def self.included(base)
6
- base.send(:extend, ClassMethods)
7
- base.send(:include, InstanceMethods)
6
+ base.extend(ClassMethods)
7
+ base.include(InstanceMethods)
8
8
  end
9
9
 
10
10
  # Class methods for integrations
@@ -5,8 +5,8 @@ module Datadog
5
5
  # Common behavior for patcher modules
6
6
  module Patcher
7
7
  def self.included(base)
8
- base.singleton_class.send(:prepend, CommonMethods)
9
- base.send(:prepend, CommonMethods) if base.instance_of?(Class)
8
+ base.singleton_class.prepend(CommonMethods)
9
+ base.prepend(CommonMethods) if base.instance_of?(Class)
10
10
  end
11
11
 
12
12
  # Prepended instance methods for all patchers
@@ -11,7 +11,7 @@ module Datadog
11
11
  # Instrumentation for Presto::Client::Client
12
12
  module Client
13
13
  def self.included(base)
14
- base.send(:prepend, InstanceMethods)
14
+ base.prepend(InstanceMethods)
15
15
  end
16
16
 
17
17
  # Instance methods for Presto::Client
@@ -21,7 +21,7 @@ module Datadog
21
21
  def patch
22
22
  PATCH_ONLY_ONCE.run do
23
23
  begin
24
- ::Presto::Client::Client.send(:include, Instrumentation::Client)
24
+ ::Presto::Client::Client.include(Instrumentation::Client)
25
25
  rescue StandardError => e
26
26
  Datadog.logger.error("Unable to apply Presto integration: #{e}")
27
27
  end
@@ -19,11 +19,9 @@ module Datadog
19
19
  require_relative 'tracer_cleaner'
20
20
 
21
21
  # Instrument all Qless Workers
22
- ::Qless::Workers::BaseWorker.class_eval do
23
- # These are executed in inverse order of listing here
24
- include QlessJob
25
- include TracerCleaner
26
- end
22
+ # These are executed in inverse order of listing here
23
+ ::Qless::Workers::BaseWorker.include(QlessJob)
24
+ ::Qless::Workers::BaseWorker.include(TracerCleaner)
27
25
  end
28
26
 
29
27
  def get_option(option)
@@ -9,8 +9,8 @@ module Datadog
9
9
  # Defines basic behaviors for an ActiveRecord event.
10
10
  module Event
11
11
  def self.included(base)
12
- base.send(:include, ActiveSupport::Notifications::Event)
13
- base.send(:extend, ClassMethods)
12
+ base.include(ActiveSupport::Notifications::Event)
13
+ base.extend(ClassMethods)
14
14
  end
15
15
 
16
16
  # Class methods for Racecar events.
@@ -7,7 +7,7 @@ module Datadog
7
7
  # Instrumentation for Rake tasks
8
8
  module Instrumentation
9
9
  def self.included(base)
10
- base.send(:prepend, InstanceMethods)
10
+ base.prepend(InstanceMethods)
11
11
  end
12
12
 
13
13
  # Instance methods for Rake instrumentation
@@ -18,7 +18,7 @@ module Datadog
18
18
 
19
19
  def patch
20
20
  # Add instrumentation patch to Rake task
21
- ::Rake::Task.send(:include, Instrumentation)
21
+ ::Rake::Task.include(Instrumentation)
22
22
  end
23
23
 
24
24
  def get_option(option)
@@ -5,8 +5,8 @@ module Datadog
5
5
  # Defines registerable behavior for integrations
6
6
  module Registerable
7
7
  def self.included(base)
8
- base.send(:extend, ClassMethods)
9
- base.send(:include, InstanceMethods)
8
+ base.extend(ClassMethods)
9
+ base.include(InstanceMethods)
10
10
  end
11
11
 
12
12
  # Class methods for registerable behavior
@@ -18,7 +18,7 @@ module Datadog
18
18
  def patch
19
19
  require_relative 'resque_job'
20
20
 
21
- ::Resque::Job.send(:prepend, Resque::Job)
21
+ ::Resque::Job.prepend(Resque::Job)
22
22
 
23
23
  workers = Datadog.configuration[:resque][:workers] || []
24
24
  workers.each { |worker| worker.extend(ResqueJob) }
@@ -15,7 +15,7 @@ module Datadog
15
15
  require 'ddtrace/ext/app_types'
16
16
  require 'ddtrace/contrib/rest_client/request_patch'
17
17
 
18
- ::RestClient::Request.send(:include, RequestPatch)
18
+ ::RestClient::Request.include(RequestPatch)
19
19
  end
20
20
  end
21
21
  end
@@ -10,7 +10,7 @@ module Datadog
10
10
  # RestClient RequestPatch
11
11
  module RequestPatch
12
12
  def self.included(base)
13
- base.send(:prepend, InstanceMethods)
13
+ base.prepend(InstanceMethods)
14
14
  end
15
15
 
16
16
  # InstanceMethods - implementing instrumentation
@@ -10,7 +10,7 @@ module Datadog
10
10
  # Adds instrumentation to Sequel::Database
11
11
  module Database
12
12
  def self.included(base)
13
- base.send(:prepend, InstanceMethods)
13
+ base.prepend(InstanceMethods)
14
14
  end
15
15
 
16
16
  # Instance methods for instrumenting Sequel::Database
@@ -10,7 +10,7 @@ module Datadog
10
10
  # Adds instrumentation to Sequel::Dataset
11
11
  module Dataset
12
12
  def self.included(base)
13
- base.send(:prepend, InstanceMethods)
13
+ base.prepend(InstanceMethods)
14
14
  end
15
15
 
16
16
  # Instance methods for instrumenting Sequel::Dataset
@@ -21,11 +21,11 @@ module Datadog
21
21
  end
22
22
 
23
23
  def patch_sequel_database
24
- ::Sequel::Database.send(:include, Database)
24
+ ::Sequel::Database.include(Database)
25
25
  end
26
26
 
27
27
  def patch_sequel_dataset
28
- ::Sequel::Dataset.send(:include, Dataset)
28
+ ::Sequel::Dataset.include(Dataset)
29
29
  end
30
30
  end
31
31
  end
@@ -20,7 +20,7 @@ module Datadog
20
20
 
21
21
  def register_tracer
22
22
  ::Sinatra.send(:register, Datadog::Contrib::Sinatra::Tracer)
23
- ::Sinatra::Base.send(:prepend, Sinatra::Tracer::Base)
23
+ ::Sinatra::Base.prepend(Sinatra::Tracer::Base)
24
24
  end
25
25
  end
26
26
  end
@@ -10,13 +10,11 @@ module Datadog
10
10
  module_function
11
11
 
12
12
  def patch!
13
- ::SuckerPunch.class_eval do
14
- class << self
15
- alias_method :__exception_handler, :exception_handler
13
+ ::SuckerPunch.singleton_class.class_eval do
14
+ alias_method :__exception_handler, :exception_handler
16
15
 
17
- def exception_handler
18
- ::Datadog::Contrib::SuckerPunch::ExceptionHandler::METHOD
19
- end
16
+ def exception_handler
17
+ ::Datadog::Contrib::SuckerPunch::ExceptionHandler::METHOD
20
18
  end
21
19
  end
22
20
  end
@@ -259,7 +259,7 @@ module Datadog
259
259
 
260
260
  # Capture all active integration settings into "integrationName_settingName: value" entries.
261
261
  def instrumented_integrations_settings
262
- Hash[instrumented_integrations.flat_map do |name, integration|
262
+ instrumented_integrations.flat_map do |name, integration|
263
263
  integration.configuration.to_h.flat_map do |setting, value|
264
264
  next [] if setting == :tracer # Skip internal Ruby objects
265
265
 
@@ -267,7 +267,7 @@ module Datadog
267
267
  # handlers possibly causing errors.
268
268
  [[:"integration_#{name}_#{setting}", value.to_s]]
269
269
  end
270
- end]
270
+ end.to_h
271
271
  end
272
272
 
273
273
  # Outputs "k1:v1,k2:v2,..."
data/lib/ddtrace/error.rb CHANGED
@@ -19,75 +19,66 @@ module Datadog
19
19
 
20
20
  private
21
21
 
22
- if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.1.0')
23
- # Ruby 2.0 exceptions don't have `cause`.
24
- # Only current exception stack trace is reported.
25
- # This is the same behavior as before.
26
- def full_backtrace(ex)
27
- backtrace = ex.backtrace
28
- backtrace.join("\n") if backtrace
29
- end
30
- else
31
- # Returns a stack trace with nested error causes and details.
32
- #
33
- # This manually implements Ruby >= 2.6 error output for two reasons:
34
- #
35
- # 1. It is not available in Ruby < 2.6.
36
- # 2. It's measurably faster to manually implement it in Ruby.
37
- #
38
- # This method mimics the exact output of
39
- # `ex.full_message(highlight: false, order: :top)`
40
- # but it's around 3x faster in our benchmark test
41
- # at `error_spec.rb`.
42
- def full_backtrace(ex)
43
- backtrace = String.new
44
- backtrace_for(ex, backtrace)
45
-
46
- # Avoid circular causes
47
- causes = {}
48
- causes[ex] = true
22
+ # Returns a stack trace with nested error causes and details.
23
+ #
24
+ # This manually implements Ruby >= 2.6 error output for two reasons:
25
+ #
26
+ # 1. It is not available in Ruby < 2.6.
27
+ # 2. It's measurably faster to manually implement it in Ruby.
28
+ #
29
+ # This method mimics the exact output of
30
+ # `ex.full_message(highlight: false, order: :top)`
31
+ # but it's around 3x faster in our benchmark test
32
+ # at `error_spec.rb`.
33
+ def full_backtrace(ex)
34
+ backtrace = String.new
35
+ backtrace_for(ex, backtrace)
49
36
 
50
- while (cause = ex.cause) && !causes.key?(cause)
51
- backtrace_for(cause, backtrace)
52
- causes[cause] = true
53
- end
37
+ # Avoid circular causes
38
+ causes = {}
39
+ causes[ex] = true
54
40
 
55
- backtrace
41
+ cause = ex
42
+ while (cause = cause.cause) && !causes.key?(cause)
43
+ backtrace_for(cause, backtrace)
44
+ causes[cause] = true
56
45
  end
57
46
 
58
- # Outputs the following format for exceptions:
59
- #
60
- # ```
61
- # error_spec.rb:55:in `wrapper': wrapper layer (RuntimeError)
62
- # from error_spec.rb:40:in `wrapper'
63
- # from error_spec.rb:61:in `caller'
64
- # ...
65
- # ```
66
- def backtrace_for(ex, backtrace)
67
- trace = ex.backtrace
68
- return unless trace
47
+ backtrace
48
+ end
69
49
 
70
- if trace[0]
71
- # Add Exception information to error line
72
- backtrace << trace[0]
73
- backtrace << ': '
74
- backtrace << ex.message
75
- backtrace << ' ('
76
- backtrace << ex.class.to_s
77
- backtrace << ')'
78
- end
50
+ # Outputs the following format for exceptions:
51
+ #
52
+ # ```
53
+ # error_spec.rb:55:in `wrapper': wrapper layer (RuntimeError)
54
+ # from error_spec.rb:40:in `wrapper'
55
+ # from error_spec.rb:61:in `caller'
56
+ # ...
57
+ # ```
58
+ def backtrace_for(ex, backtrace)
59
+ trace = ex.backtrace
60
+ return unless trace
79
61
 
80
- if trace[1]
81
- # Ident stack trace for caller lines, to separate
82
- # them from the main error lines.
83
- trace[1..-1].each do |line|
84
- backtrace << "\n\tfrom "
85
- backtrace << line
86
- end
87
- end
62
+ if trace[0]
63
+ # Add Exception information to error line
64
+ backtrace << trace[0]
65
+ backtrace << ': '
66
+ backtrace << ex.message.to_s
67
+ backtrace << ' ('
68
+ backtrace << ex.class.to_s
69
+ backtrace << ')'
70
+ end
88
71
 
89
- backtrace << "\n"
72
+ if trace[1]
73
+ # Ident stack trace for caller lines, to separate
74
+ # them from the main error lines.
75
+ trace[1..-1].each do |line|
76
+ backtrace << "\n\tfrom "
77
+ backtrace << line
78
+ end
90
79
  end
80
+
81
+ backtrace << "\n"
91
82
  end
92
83
  end
93
84