ddtrace 0.49.0 → 0.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -62,6 +62,10 @@ module Datadog
62
62
  Array.new(@sample_type_mappings.length, Datadog::Ext::Profiling::Pprof::SAMPLE_VALUE_NO_VALUE)
63
63
  end
64
64
 
65
+ def debug_statistics
66
+ # Empty; can be used by subclasses to report a string containing debug statistics to be logged
67
+ end
68
+
65
69
  # Represents a grouped event
66
70
  # 'sample' is an example event object from the group.
67
71
  # 'values' is the the summation of the group's sample values
@@ -7,6 +7,9 @@ module Datadog
7
7
  module Profiling
8
8
  module Pprof
9
9
  # Builds a profile from a StackSample
10
+ #
11
+ # NOTE: This class may appear stateless but is in fact stateful; a new instance should be created for every
12
+ # encoded profile.
10
13
  class StackSample < Converter
11
14
  SAMPLE_TYPES = {
12
15
  cpu_time_ns: [
@@ -23,6 +26,13 @@ module Datadog
23
26
  SAMPLE_TYPES
24
27
  end
25
28
 
29
+ def initialize(*_)
30
+ super
31
+
32
+ @processed_unique_stacks = 0
33
+ @processed_with_trace_ids = 0
34
+ end
35
+
26
36
  def add_events!(stack_samples)
27
37
  new_samples = build_samples(stack_samples)
28
38
  builder.samples.concat(new_samples)
@@ -35,6 +45,7 @@ module Datadog
35
45
  def build_samples(stack_samples)
36
46
  groups = group_events(stack_samples, &method(:stack_sample_group_key))
37
47
  groups.collect do |_group_key, group|
48
+ @processed_unique_stacks += 1
38
49
  build_sample(group.sample, group.values)
39
50
  end
40
51
  end
@@ -46,7 +57,7 @@ module Datadog
46
57
  )
47
58
 
48
59
  Perftools::Profiles::Sample.new(
49
- location_id: locations.collect(&:id),
60
+ location_id: locations.collect { |location| location['id'.freeze] },
50
61
  value: values,
51
62
  label: build_sample_labels(stack_sample)
52
63
  )
@@ -69,6 +80,7 @@ module Datadog
69
80
  ]
70
81
 
71
82
  unless stack_sample.trace_id.nil? || stack_sample.trace_id.zero?
83
+ @processed_with_trace_ids += 1
72
84
  labels << Perftools::Profiles::Label.new(
73
85
  key: builder.string_table.fetch(Datadog::Ext::Profiling::Pprof::LABEL_KEY_TRACE_ID),
74
86
  str: builder.string_table.fetch(stack_sample.trace_id.to_s)
@@ -84,6 +96,10 @@ module Datadog
84
96
 
85
97
  labels
86
98
  end
99
+
100
+ def debug_statistics
101
+ "unique stacks: #{@processed_unique_stacks}, of which had active traces: #{@processed_with_trace_ids}"
102
+ end
87
103
  end
88
104
  end
89
105
  end
@@ -75,6 +75,10 @@ module Datadog
75
75
  converters[event_class].add_events!(events)
76
76
  end
77
77
 
78
+ def debug_statistics
79
+ converters.values.map(&:debug_statistics).join(', ')
80
+ end
81
+
78
82
  def to_pprof
79
83
  profile = builder.build_profile
80
84
  data = builder.encode_profile(profile)
@@ -42,7 +42,18 @@ module Datadog
42
42
  end
43
43
 
44
44
  def perform
45
- flush_and_wait
45
+ # A profiling flush may be called while the VM is shutting down, to report the last profile. When we do so,
46
+ # we impose a strict timeout. This means this last profile may or may not be sent, depending on if the flush can
47
+ # successfully finish in the strict timeout.
48
+ # This can be somewhat confusing (why did it not get reported?), so let's at least log what happened.
49
+ interrupted = true
50
+
51
+ begin
52
+ flush_and_wait
53
+ interrupted = false
54
+ ensure
55
+ Datadog.logger.debug('#flush was interrupted or failed before it could complete') if interrupted
56
+ end
46
57
  end
47
58
 
48
59
  def loop_back_off?
@@ -18,7 +18,7 @@ module Datadog
18
18
  activate_cpu_extensions
19
19
  setup_at_fork_hooks
20
20
  rescue StandardError, ScriptError => e
21
- log "[DDTRACE] Main extensions unavailable. Cause: #{e.message} Location: #{e.backtrace.first}"
21
+ Datadog.logger.warn { "Profiler extensions unavailable. Cause: #{e.message} Location: #{e.backtrace.first}" }
22
22
  end
23
23
  end
24
24
  end
@@ -29,22 +29,27 @@ module Datadog
29
29
  if Ext::Forking.supported?
30
30
  Ext::Forking.apply!
31
31
  elsif Datadog.configuration.profiling.enabled
32
- # Log warning if profiling was supposed to be activated.
33
- log '[DDTRACE] Forking extensions skipped; forking not supported.'
32
+ Datadog.logger.debug('Profiler forking extensions skipped; forking not supported.')
34
33
  end
35
34
  rescue StandardError, ScriptError => e
36
- log "[DDTRACE] Forking extensions unavailable. Cause: #{e.message} Location: #{e.backtrace.first}"
35
+ Datadog.logger.warn do
36
+ "Profiler forking extensions unavailable. Cause: #{e.message} Location: #{e.backtrace.first}"
37
+ end
37
38
  end
38
39
 
39
40
  def activate_cpu_extensions
40
41
  if Ext::CPU.supported?
41
42
  Ext::CPU.apply!
42
43
  elsif Datadog.configuration.profiling.enabled
43
- # Log warning if profiling was supposed to be activated.
44
- log "[DDTRACE] CPU profiling skipped because native CPU time is not supported: #{Ext::CPU.unsupported_reason}."
44
+ Datadog.logger.info do
45
+ 'CPU time profiling skipped because native CPU time is not supported: ' \
46
+ "#{Ext::CPU.unsupported_reason}. Profiles containing Wall time will still be reported."
47
+ end
45
48
  end
46
49
  rescue StandardError, ScriptError => e
47
- log "[DDTRACE] CPU profiling unavailable. Cause: #{e.message} Location: #{e.backtrace.first}"
50
+ Datadog.logger.warn do
51
+ "Profiler CPU profiling extensions unavailable. Cause: #{e.message} Location: #{e.backtrace.first}"
52
+ end
48
53
  end
49
54
 
50
55
  def setup_at_fork_hooks
@@ -61,16 +66,11 @@ module Datadog
61
66
  # Restart profiler, if enabled
62
67
  Datadog.profiler.start if Datadog.profiler
63
68
  rescue StandardError => e
64
- log "[DDTRACE] Error during post-fork hooks. Cause: #{e.message} Location: #{e.backtrace.first}"
69
+ Datadog.logger.warn { "Error during post-fork hooks. Cause: #{e.message} Location: #{e.backtrace.first}" }
65
70
  end
66
71
  end
67
72
  end
68
73
  end
69
-
70
- def log(message)
71
- # Print to STDOUT for now because logging may not be setup yet...
72
- puts message
73
- end
74
74
  end
75
75
  end
76
76
  end
@@ -14,10 +14,15 @@ module Datadog
14
14
  class Endpoint < Datadog::Transport::HTTP::API::Endpoint
15
15
  include Datadog::Ext::Profiling::Transport::HTTP
16
16
 
17
+ # These tags are read from the flush object (see below) directly and so we ignore any extra copies that
18
+ # may come in the tags hash to avoid duplicates.
19
+ TAGS_TO_IGNORE_IN_TAGS_HASH = %w[service env version].freeze
20
+ private_constant :TAGS_TO_IGNORE_IN_TAGS_HASH
21
+
17
22
  attr_reader \
18
23
  :encoder
19
24
 
20
- def initialize(path, encoder, options = {})
25
+ def initialize(path, encoder)
21
26
  super(:post, path)
22
27
  @encoder = encoder
23
28
  end
@@ -52,7 +57,11 @@ module Datadog
52
57
  "#{FORM_FIELD_TAG_PROFILER_VERSION}:#{flush.profiler_version}",
53
58
  # NOTE: Redundant w/ 'runtime'; may want to remove this later.
54
59
  "#{FORM_FIELD_TAG_LANGUAGE}:#{flush.language}",
55
- "#{FORM_FIELD_TAG_HOST}:#{flush.host}"
60
+ "#{FORM_FIELD_TAG_HOST}:#{flush.host}",
61
+ *flush
62
+ .tags
63
+ .reject { |tag_key| TAGS_TO_IGNORE_IN_TAGS_HASH.include?(tag_key) }
64
+ .map { |tag_key, tag_value| "#{tag_key}:#{tag_value}" }
56
65
  ],
57
66
  FORM_FIELD_DATA => pprof_file,
58
67
  FORM_FIELD_RUNTIME => flush.language,
@@ -58,11 +58,9 @@ module Datadog
58
58
  end
59
59
 
60
60
  def gc_metrics
61
- Hash[
62
- GC.stat.flat_map do |k, v|
63
- nested_gc_metric(Ext::Runtime::Metrics::METRIC_GC_PREFIX, k, v)
64
- end
65
- ]
61
+ GC.stat.flat_map do |k, v|
62
+ nested_gc_metric(Ext::Runtime::Metrics::METRIC_GC_PREFIX, k, v)
63
+ end.to_h
66
64
  end
67
65
 
68
66
  def try_flush
@@ -20,7 +20,8 @@ module Datadog
20
20
  def initialize(options = {})
21
21
  @transport = options.fetch(:transport) do
22
22
  transport_options = options.fetch(:transport_options, {})
23
- Transport::HTTP.default(transport_options)
23
+ transport_options[:agent_settings] = options[:agent_settings] if options.key?(:agent_settings)
24
+ Transport::HTTP.default(**transport_options)
24
25
  end
25
26
 
26
27
  @priority_sampler = options.fetch(:priority_sampler, nil)
@@ -74,7 +74,9 @@ module Datadog
74
74
  # by default.
75
75
  def initialize(options = {})
76
76
  # Configurable options
77
- @context_flush = if options[:partial_flush]
77
+ @context_flush = if options[:context_flush]
78
+ options[:context_flush]
79
+ elsif options[:partial_flush]
78
80
  Datadog::ContextFlush::Partial.new(options)
79
81
  else
80
82
  Datadog::ContextFlush::Finished.new
@@ -118,8 +120,10 @@ module Datadog
118
120
 
119
121
  configure_writer(options)
120
122
 
121
- if options.key?(:partial_flush)
122
- @context_flush = if options[:partial_flush]
123
+ if options.key?(:context_flush) || options.key?(:partial_flush)
124
+ @context_flush = if options[:context_flush]
125
+ options[:context_flush]
126
+ elsif options[:partial_flush]
123
127
  Datadog::ContextFlush::Partial.new(options)
124
128
  else
125
129
  Datadog::ContextFlush::Finished.new
@@ -162,7 +166,7 @@ module Datadog
162
166
  #
163
167
  # tracer.set_tags('env' => 'prod', 'component' => 'core')
164
168
  def set_tags(tags)
165
- string_tags = Hash[tags.collect { |k, v| [k.to_s, v] }]
169
+ string_tags = tags.collect { |k, v| [k.to_s, v] }.to_h
166
170
  @tags = @tags.merge(string_tags)
167
171
  end
168
172
 
@@ -6,8 +6,8 @@ module Datadog
6
6
  # Tracks statistics for HTTP transports
7
7
  module Statistics
8
8
  def self.included(base)
9
- base.send(:include, Datadog::Transport::Statistics)
10
- base.send(:include, InstanceMethods)
9
+ base.include(Datadog::Transport::Statistics)
10
+ base.include(InstanceMethods)
11
11
  end
12
12
 
13
13
  # Instance methods for HTTP statistics
@@ -133,9 +133,9 @@ module Datadog
133
133
  end
134
134
 
135
135
  # Add traces behavior to transport components
136
- HTTP::Client.send(:include, Traces::Client)
137
- HTTP::API::Spec.send(:include, Traces::API::Spec)
138
- HTTP::API::Instance.send(:include, Traces::API::Instance)
136
+ HTTP::Client.include(Traces::Client)
137
+ HTTP::API::Spec.include(Traces::API::Spec)
138
+ HTTP::API::Instance.include(Traces::API::Instance)
139
139
  end
140
140
  end
141
141
  end
@@ -90,7 +90,7 @@ module Datadog
90
90
  end
91
91
 
92
92
  # Add traces behavior to transport components
93
- IO::Client.send(:include, Traces::Client)
93
+ IO::Client.include(Traces::Client)
94
94
  end
95
95
  end
96
96
  end
@@ -3,7 +3,7 @@ module Datadog
3
3
  # Helper methods for managing forking behavior
4
4
  module Forking
5
5
  def self.included(base)
6
- base.send(:prepend, ClassExtensions) if base.is_a?(Class)
6
+ base.prepend(ClassExtensions) if base.is_a?(Class)
7
7
  end
8
8
 
9
9
  def self.extended(base)
@@ -16,12 +16,10 @@ module Datadog
16
16
  # If they match an existing message, it will return the
17
17
  # matching object. If it doesn't match, it will yield to
18
18
  # the block with the next ID & args given.
19
- def fetch(*args, &block)
19
+ def fetch(*args)
20
+ # TODO: Array hashing is **really** expensive, we probably want to get rid of it in the future
20
21
  key = @key_block ? @key_block.call(*args) : args.hash
21
- # TODO: Ruby 2.0 doesn't like yielding here... switch when 2.0 is dropped.
22
- # rubocop:disable Performance/RedundantBlockCall
23
- @items[key] ||= block.call(@sequence.next, *args)
24
- # rubocop:enable Performance/RedundantBlockCall
22
+ @items[key] ||= yield(@sequence.next, *args)
25
23
  end
26
24
 
27
25
  def length
@@ -2,8 +2,6 @@ module Datadog
2
2
  module Utils
3
3
  # Common database-related utility functions.
4
4
  module Time
5
- PROCESS_TIME_SUPPORTED = Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.1.0')
6
-
7
5
  module_function
8
6
 
9
7
  # Current monotonic time.
@@ -12,7 +10,7 @@ module Datadog
12
10
  #
13
11
  # @return [Float] in seconds, since some unspecified starting point
14
12
  def get_time
15
- PROCESS_TIME_SUPPORTED ? Process.clock_gettime(Process::CLOCK_MONOTONIC) : now.to_f
13
+ Process.clock_gettime(Process::CLOCK_MONOTONIC)
16
14
  end
17
15
 
18
16
  # Current wall time.
@@ -1,15 +1,13 @@
1
1
  module Datadog
2
2
  module VERSION
3
3
  MAJOR = 0
4
- MINOR = 49
4
+ MINOR = 50
5
5
  PATCH = 0
6
6
  PRE = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.')
9
9
 
10
- # Support for Ruby < 2.1 is currently deprecated in the tracer.
11
- # Support will be dropped in the near future.
12
- MINIMUM_RUBY_VERSION = '2.0.0'.freeze
10
+ MINIMUM_RUBY_VERSION = '2.1.0'.freeze
13
11
 
14
12
  # Ruby 3.2 is not supported: Ruby 3.x support as implemented using *args
15
13
  # needs ruby2_keywords to continue working, yet the scheduled removal of
@@ -69,7 +69,7 @@ module Datadog
69
69
  return if @run
70
70
 
71
71
  @run = true
72
- Datadog.logger.debug("Starting thread in the process: #{Process.pid}")
72
+ Datadog.logger.debug { "Starting thread for: #{self}" }
73
73
  @worker = Thread.new { perform }
74
74
  @worker.name = self.class.name unless Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3')
75
75
 
@@ -12,7 +12,7 @@ module Datadog
12
12
  SHUTDOWN_TIMEOUT = 1
13
13
 
14
14
  def self.included(base)
15
- base.send(:prepend, PrependedMethods)
15
+ base.prepend(PrependedMethods)
16
16
  end
17
17
 
18
18
  # Methods that must be prepended
@@ -39,6 +39,7 @@ module Datadog
39
39
  return false unless running?
40
40
 
41
41
  @run_async = false
42
+ Datadog.logger.debug { "Forcibly terminating worker thread for: #{self}" }
42
43
  worker.terminate
43
44
  true
44
45
  end
@@ -126,7 +127,7 @@ module Datadog
126
127
  @run_async = true
127
128
  @pid = Process.pid
128
129
  @error = nil
129
- Datadog.logger.debug("Starting thread in the process: #{Process.pid} for: #{self}")
130
+ Datadog.logger.debug { "Starting thread for: #{self}" }
130
131
 
131
132
  @worker = ::Thread.new do
132
133
  begin
@@ -8,7 +8,7 @@ module Datadog
8
8
  BASE_INTERVAL = 1
9
9
 
10
10
  def self.included(base)
11
- base.send(:prepend, PrependedMethods)
11
+ base.prepend(PrependedMethods)
12
12
  end
13
13
 
14
14
  # Methods that must be prepended
@@ -8,9 +8,9 @@ module Datadog
8
8
  SHUTDOWN_TIMEOUT = 1
9
9
 
10
10
  def self.included(base)
11
- base.send(:include, Workers::IntervalLoop)
12
- base.send(:include, Workers::Async::Thread)
13
- base.send(:prepend, PrependedMethods)
11
+ base.include(Workers::IntervalLoop)
12
+ base.include(Workers::Async::Thread)
13
+ base.prepend(PrependedMethods)
14
14
  end
15
15
 
16
16
  # Methods that must be prepended
@@ -26,8 +26,14 @@ module Datadog
26
26
  stop_loop
27
27
  graceful = join(timeout)
28
28
 
29
- # If timeout and force stop...
30
- !graceful && force_stop ? terminate : graceful
29
+ if !graceful && force_stop
30
+ Datadog.logger.debug do
31
+ "Timeout while waiting for worker to finish gracefully, forcing termination for: #{self}"
32
+ end
33
+ terminate
34
+ else
35
+ graceful
36
+ end
31
37
  else
32
38
  false
33
39
  end
@@ -4,7 +4,7 @@ module Datadog
4
4
  # to which items can be queued then dequeued.
5
5
  module Queue
6
6
  def self.included(base)
7
- base.send(:prepend, PrependedMethods)
7
+ base.prepend(PrependedMethods)
8
8
  end
9
9
 
10
10
  # Methods that must be prepended
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ddtrace
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.49.0
4
+ version: 0.50.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Datadog, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-12 00:00:00.000000000 Z
11
+ date: 2021-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack
@@ -50,7 +50,6 @@ extensions: []
50
50
  extra_rdoc_files: []
51
51
  files:
52
52
  - ".circleci/config.yml"
53
- - ".circleci/images/primary/Dockerfile-2.0.0"
54
53
  - ".circleci/images/primary/Dockerfile-2.1.10"
55
54
  - ".circleci/images/primary/Dockerfile-2.2.10"
56
55
  - ".circleci/images/primary/Dockerfile-2.3.8"
@@ -61,7 +60,7 @@ files:
61
60
  - ".circleci/images/primary/Dockerfile-3.0.0"
62
61
  - ".circleci/images/primary/Dockerfile-jruby-9.2-latest"
63
62
  - ".circleci/images/primary/Dockerfile-jruby-9.2.0.0"
64
- - ".circleci/images/primary/Dockerfile-truffleruby-21.0.0"
63
+ - ".circleci/images/primary/Dockerfile-truffleruby-21.1.0"
65
64
  - ".dockerignore"
66
65
  - ".env"
67
66
  - ".github/CODEOWNERS"
@@ -85,8 +84,10 @@ files:
85
84
  - NOTICE
86
85
  - README.md
87
86
  - Rakefile
87
+ - benchmarks/data/profiler-submission-marshal.gz
88
88
  - benchmarks/postgres_database.yml
89
89
  - benchmarks/profiler_sample_loop.rb
90
+ - benchmarks/profiler_submission.rb
90
91
  - benchmarks/sidekiq_test.rb
91
92
  - bin/ddtracerb
92
93
  - ddtrace.gemspec
@@ -182,22 +183,6 @@ files:
182
183
  - gemfiles/jruby_9.2.11.1_resque2_redis3.gemfile.lock
183
184
  - gemfiles/jruby_9.2.11.1_resque2_redis4.gemfile
184
185
  - gemfiles/jruby_9.2.11.1_resque2_redis4.gemfile.lock
185
- - gemfiles/ruby_2.0.0_contrib_old.gemfile
186
- - gemfiles/ruby_2.0.0_contrib_old.gemfile.lock
187
- - gemfiles/ruby_2.0.0_core_old.gemfile
188
- - gemfiles/ruby_2.0.0_core_old.gemfile.lock
189
- - gemfiles/ruby_2.0.0_rails30_postgres.gemfile
190
- - gemfiles/ruby_2.0.0_rails30_postgres.gemfile.lock
191
- - gemfiles/ruby_2.0.0_rails30_postgres_sidekiq.gemfile
192
- - gemfiles/ruby_2.0.0_rails30_postgres_sidekiq.gemfile.lock
193
- - gemfiles/ruby_2.0.0_rails32_mysql2.gemfile
194
- - gemfiles/ruby_2.0.0_rails32_mysql2.gemfile.lock
195
- - gemfiles/ruby_2.0.0_rails32_postgres.gemfile
196
- - gemfiles/ruby_2.0.0_rails32_postgres.gemfile.lock
197
- - gemfiles/ruby_2.0.0_rails32_postgres_redis.gemfile
198
- - gemfiles/ruby_2.0.0_rails32_postgres_redis.gemfile.lock
199
- - gemfiles/ruby_2.0.0_rails32_postgres_sidekiq.gemfile
200
- - gemfiles/ruby_2.0.0_rails32_postgres_sidekiq.gemfile.lock
201
186
  - gemfiles/ruby_2.1.10_contrib_old.gemfile
202
187
  - gemfiles/ruby_2.1.10_contrib_old.gemfile.lock
203
188
  - gemfiles/ruby_2.1.10_core_old.gemfile
@@ -568,6 +553,27 @@ files:
568
553
  - integration/apps/rails-five/storage/.keep
569
554
  - integration/apps/rails-five/tmp/.keep
570
555
  - integration/apps/rails-five/vendor/.keep
556
+ - integration/apps/rspec/.dockerignore
557
+ - integration/apps/rspec/.envrc.sample
558
+ - integration/apps/rspec/.gitignore
559
+ - integration/apps/rspec/.rspec
560
+ - integration/apps/rspec/Dockerfile
561
+ - integration/apps/rspec/Dockerfile-ci
562
+ - integration/apps/rspec/Gemfile
563
+ - integration/apps/rspec/README.md
564
+ - integration/apps/rspec/agent.yaml
565
+ - integration/apps/rspec/app/datadog.rb
566
+ - integration/apps/rspec/app/fibonacci.rb
567
+ - integration/apps/rspec/bin/run
568
+ - integration/apps/rspec/bin/setup
569
+ - integration/apps/rspec/bin/test
570
+ - integration/apps/rspec/docker-compose.ci.yml
571
+ - integration/apps/rspec/docker-compose.yml
572
+ - integration/apps/rspec/script/build-images
573
+ - integration/apps/rspec/script/ci
574
+ - integration/apps/rspec/spec/fibonacci_spec.rb
575
+ - integration/apps/rspec/spec/rspec_spec.rb
576
+ - integration/apps/rspec/spec/spec_helper.rb
571
577
  - integration/apps/ruby/.dockerignore
572
578
  - integration/apps/ruby/.envrc.sample
573
579
  - integration/apps/ruby/.gitignore
@@ -590,7 +596,6 @@ files:
590
596
  - integration/images/include/datadog/analyzer.rb
591
597
  - integration/images/include/datadog/demo_env.rb
592
598
  - integration/images/include/http-health-check
593
- - integration/images/ruby/2.0/Dockerfile
594
599
  - integration/images/ruby/2.1/Dockerfile
595
600
  - integration/images/ruby/2.2/Dockerfile
596
601
  - integration/images/ruby/2.3/Dockerfile
@@ -604,6 +609,27 @@ files:
604
609
  - integration/images/wrk/scripts/scenarios/basic/default.lua
605
610
  - integration/images/wrk/scripts/scenarios/basic/fibonacci.lua
606
611
  - integration/script/build-images
612
+ - lib/datadog/ci.rb
613
+ - lib/datadog/ci/configuration/components.rb
614
+ - lib/datadog/ci/configuration/settings.rb
615
+ - lib/datadog/ci/context_flush.rb
616
+ - lib/datadog/ci/contrib/cucumber/configuration/settings.rb
617
+ - lib/datadog/ci/contrib/cucumber/ext.rb
618
+ - lib/datadog/ci/contrib/cucumber/formatter.rb
619
+ - lib/datadog/ci/contrib/cucumber/instrumentation.rb
620
+ - lib/datadog/ci/contrib/cucumber/integration.rb
621
+ - lib/datadog/ci/contrib/cucumber/patcher.rb
622
+ - lib/datadog/ci/contrib/rspec/configuration/settings.rb
623
+ - lib/datadog/ci/contrib/rspec/example.rb
624
+ - lib/datadog/ci/contrib/rspec/ext.rb
625
+ - lib/datadog/ci/contrib/rspec/integration.rb
626
+ - lib/datadog/ci/contrib/rspec/patcher.rb
627
+ - lib/datadog/ci/ext/app_types.rb
628
+ - lib/datadog/ci/ext/environment.rb
629
+ - lib/datadog/ci/ext/settings.rb
630
+ - lib/datadog/ci/ext/test.rb
631
+ - lib/datadog/ci/extensions.rb
632
+ - lib/datadog/ci/test.rb
607
633
  - lib/ddtrace.rb
608
634
  - lib/ddtrace/analytics.rb
609
635
  - lib/ddtrace/auto_instrument.rb
@@ -701,12 +727,6 @@ files:
701
727
  - lib/ddtrace/contrib/configuration/resolver.rb
702
728
  - lib/ddtrace/contrib/configuration/resolvers/pattern_resolver.rb
703
729
  - lib/ddtrace/contrib/configuration/settings.rb
704
- - lib/ddtrace/contrib/cucumber/configuration/settings.rb
705
- - lib/ddtrace/contrib/cucumber/ext.rb
706
- - lib/ddtrace/contrib/cucumber/formatter.rb
707
- - lib/ddtrace/contrib/cucumber/instrumentation.rb
708
- - lib/ddtrace/contrib/cucumber/integration.rb
709
- - lib/ddtrace/contrib/cucumber/patcher.rb
710
730
  - lib/ddtrace/contrib/dalli/configuration/settings.rb
711
731
  - lib/ddtrace/contrib/dalli/ext.rb
712
732
  - lib/ddtrace/contrib/dalli/instrumentation.rb
@@ -876,11 +896,6 @@ files:
876
896
  - lib/ddtrace/contrib/rest_client/integration.rb
877
897
  - lib/ddtrace/contrib/rest_client/patcher.rb
878
898
  - lib/ddtrace/contrib/rest_client/request_patch.rb
879
- - lib/ddtrace/contrib/rspec/configuration/settings.rb
880
- - lib/ddtrace/contrib/rspec/example.rb
881
- - lib/ddtrace/contrib/rspec/ext.rb
882
- - lib/ddtrace/contrib/rspec/integration.rb
883
- - lib/ddtrace/contrib/rspec/patcher.rb
884
899
  - lib/ddtrace/contrib/sequel/configuration/settings.rb
885
900
  - lib/ddtrace/contrib/sequel/database.rb
886
901
  - lib/ddtrace/contrib/sequel/dataset.rb
@@ -934,7 +949,6 @@ files:
934
949
  - lib/ddtrace/event.rb
935
950
  - lib/ddtrace/ext/analytics.rb
936
951
  - lib/ddtrace/ext/app_types.rb
937
- - lib/ddtrace/ext/ci.rb
938
952
  - lib/ddtrace/ext/correlation.rb
939
953
  - lib/ddtrace/ext/diagnostics.rb
940
954
  - lib/ddtrace/ext/distributed.rb
@@ -1114,7 +1128,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
1114
1128
  requirements:
1115
1129
  - - ">="
1116
1130
  - !ruby/object:Gem::Version
1117
- version: 2.0.0
1131
+ version: 2.1.0
1118
1132
  - - "<"
1119
1133
  - !ruby/object:Gem::Version
1120
1134
  version: '3.2'