ddtrace 0.40.0 → 0.50.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (852) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +502 -180
  3. data/.circleci/images/primary/Dockerfile-2.1.10 +11 -1
  4. data/.circleci/images/primary/Dockerfile-2.2.10 +11 -1
  5. data/.circleci/images/primary/Dockerfile-2.3.8 +10 -0
  6. data/.circleci/images/primary/Dockerfile-2.4.6 +10 -0
  7. data/.circleci/images/primary/Dockerfile-2.5.6 +10 -0
  8. data/.circleci/images/primary/Dockerfile-2.6.4 +10 -0
  9. data/.circleci/images/primary/Dockerfile-2.7.0 +10 -0
  10. data/.circleci/images/primary/{Dockerfile-2.0.0 → Dockerfile-3.0.0} +8 -8
  11. data/.circleci/images/primary/Dockerfile-jruby-9.2-latest +88 -0
  12. data/.circleci/images/primary/{Dockerfile-jruby-9.2 → Dockerfile-jruby-9.2.0.0} +1 -5
  13. data/.circleci/images/primary/Dockerfile-truffleruby-21.1.0 +73 -0
  14. data/.dockerignore +0 -1
  15. data/.github/workflows/add-milestone-to-pull-requests.yml +42 -0
  16. data/.github/workflows/create-next-milestone.yml +20 -0
  17. data/.gitignore +0 -1
  18. data/.gitlab-ci.yml +18 -18
  19. data/.rubocop.yml +273 -7
  20. data/.rubocop_todo.yml +438 -0
  21. data/.simplecov +9 -0
  22. data/Appraisals +483 -231
  23. data/CHANGELOG.md +1386 -342
  24. data/CONTRIBUTING.md +2 -2
  25. data/Gemfile +65 -3
  26. data/LICENSE-3rdparty.csv +2 -0
  27. data/README.md +1 -0
  28. data/Rakefile +486 -338
  29. data/benchmarks/data/profiler-submission-marshal.gz +0 -0
  30. data/benchmarks/profiler_sample_loop.rb +69 -0
  31. data/benchmarks/profiler_submission.rb +93 -0
  32. data/bin/ddtracerb +15 -0
  33. data/ddtrace.gemspec +8 -36
  34. data/docker-compose.yml +93 -49
  35. data/docs/DevelopmentGuide.md +40 -2
  36. data/docs/GettingStarted.md +299 -78
  37. data/docs/ProfilingDevelopment.md +88 -0
  38. data/gemfiles/jruby_9.2.0.0_contrib.gemfile +79 -0
  39. data/gemfiles/jruby_9.2.0.0_contrib.gemfile.lock +1518 -0
  40. data/gemfiles/jruby_9.2.0.0_contrib_old.gemfile +35 -0
  41. data/gemfiles/jruby_9.2.0.0_contrib_old.gemfile.lock +157 -0
  42. data/gemfiles/jruby_9.2.0.0_core_old.gemfile +34 -0
  43. data/gemfiles/jruby_9.2.0.0_core_old.gemfile.lock +153 -0
  44. data/gemfiles/jruby_9.2.0.0_cucumber3.gemfile +35 -0
  45. data/gemfiles/jruby_9.2.0.0_cucumber3.gemfile.lock +174 -0
  46. data/gemfiles/jruby_9.2.0.0_cucumber4.gemfile +35 -0
  47. data/gemfiles/jruby_9.2.0.0_cucumber4.gemfile.lock +206 -0
  48. data/gemfiles/jruby_9.2.0.0_cucumber5.gemfile +35 -0
  49. data/gemfiles/jruby_9.2.0.0_cucumber5.gemfile.lock +206 -0
  50. data/gemfiles/jruby_9.2.0.0_rails5_mysql2.gemfile +40 -0
  51. data/gemfiles/jruby_9.2.0.0_rails5_mysql2.gemfile.lock +271 -0
  52. data/gemfiles/jruby_9.2.0.0_rails5_postgres.gemfile +40 -0
  53. data/gemfiles/jruby_9.2.0.0_rails5_postgres.gemfile.lock +271 -0
  54. data/gemfiles/jruby_9.2.0.0_rails5_postgres_redis.gemfile +41 -0
  55. data/gemfiles/jruby_9.2.0.0_rails5_postgres_redis.gemfile.lock +273 -0
  56. data/gemfiles/jruby_9.2.0.0_rails5_postgres_redis_activesupport.gemfile +41 -0
  57. data/gemfiles/jruby_9.2.0.0_rails5_postgres_redis_activesupport.gemfile.lock +273 -0
  58. data/gemfiles/jruby_9.2.0.0_rails5_postgres_sidekiq.gemfile +42 -0
  59. data/gemfiles/jruby_9.2.0.0_rails5_postgres_sidekiq.gemfile.lock +279 -0
  60. data/gemfiles/jruby_9.2.0.0_rails61_mysql2.gemfile +40 -0
  61. data/gemfiles/jruby_9.2.0.0_rails61_mysql2.gemfile.lock +290 -0
  62. data/gemfiles/jruby_9.2.0.0_rails61_postgres.gemfile +40 -0
  63. data/gemfiles/jruby_9.2.0.0_rails61_postgres.gemfile.lock +290 -0
  64. data/gemfiles/jruby_9.2.0.0_rails61_postgres_redis.gemfile +41 -0
  65. data/gemfiles/jruby_9.2.0.0_rails61_postgres_redis.gemfile.lock +292 -0
  66. data/gemfiles/jruby_9.2.0.0_rails61_postgres_sidekiq.gemfile +41 -0
  67. data/gemfiles/jruby_9.2.0.0_rails61_postgres_sidekiq.gemfile.lock +297 -0
  68. data/gemfiles/jruby_9.2.0.0_rails6_mysql2.gemfile +40 -0
  69. data/gemfiles/jruby_9.2.0.0_rails6_mysql2.gemfile.lock +287 -0
  70. data/gemfiles/jruby_9.2.0.0_rails6_postgres.gemfile +40 -0
  71. data/gemfiles/jruby_9.2.0.0_rails6_postgres.gemfile.lock +287 -0
  72. data/gemfiles/jruby_9.2.0.0_rails6_postgres_redis.gemfile +41 -0
  73. data/gemfiles/jruby_9.2.0.0_rails6_postgres_redis.gemfile.lock +289 -0
  74. data/gemfiles/jruby_9.2.0.0_rails6_postgres_redis_activesupport.gemfile +41 -0
  75. data/gemfiles/jruby_9.2.0.0_rails6_postgres_redis_activesupport.gemfile.lock +289 -0
  76. data/gemfiles/jruby_9.2.0.0_rails6_postgres_sidekiq.gemfile +42 -0
  77. data/gemfiles/jruby_9.2.0.0_rails6_postgres_sidekiq.gemfile.lock +295 -0
  78. data/gemfiles/jruby_9.2.0.0_resque2_redis3.gemfile +36 -0
  79. data/gemfiles/jruby_9.2.0.0_resque2_redis3.gemfile.lock +180 -0
  80. data/gemfiles/jruby_9.2.0.0_resque2_redis4.gemfile +36 -0
  81. data/gemfiles/jruby_9.2.0.0_resque2_redis4.gemfile.lock +180 -0
  82. data/gemfiles/jruby_9.2.11.1_contrib.gemfile +79 -0
  83. data/gemfiles/jruby_9.2.11.1_contrib.gemfile.lock +1518 -0
  84. data/gemfiles/jruby_9.2.11.1_contrib_old.gemfile +35 -0
  85. data/gemfiles/jruby_9.2.11.1_contrib_old.gemfile.lock +157 -0
  86. data/gemfiles/jruby_9.2.11.1_core_old.gemfile +34 -0
  87. data/gemfiles/jruby_9.2.11.1_core_old.gemfile.lock +153 -0
  88. data/gemfiles/jruby_9.2.11.1_cucumber3.gemfile +35 -0
  89. data/gemfiles/jruby_9.2.11.1_cucumber3.gemfile.lock +174 -0
  90. data/gemfiles/jruby_9.2.11.1_cucumber4.gemfile +35 -0
  91. data/gemfiles/jruby_9.2.11.1_cucumber4.gemfile.lock +206 -0
  92. data/gemfiles/jruby_9.2.11.1_cucumber5.gemfile +35 -0
  93. data/gemfiles/jruby_9.2.11.1_cucumber5.gemfile.lock +206 -0
  94. data/gemfiles/jruby_9.2.11.1_rails5_mysql2.gemfile +40 -0
  95. data/gemfiles/jruby_9.2.11.1_rails5_mysql2.gemfile.lock +271 -0
  96. data/gemfiles/jruby_9.2.11.1_rails5_postgres.gemfile +40 -0
  97. data/gemfiles/jruby_9.2.11.1_rails5_postgres.gemfile.lock +271 -0
  98. data/gemfiles/jruby_9.2.11.1_rails5_postgres_redis.gemfile +41 -0
  99. data/gemfiles/jruby_9.2.11.1_rails5_postgres_redis.gemfile.lock +273 -0
  100. data/gemfiles/jruby_9.2.11.1_rails5_postgres_redis_activesupport.gemfile +41 -0
  101. data/gemfiles/jruby_9.2.11.1_rails5_postgres_redis_activesupport.gemfile.lock +273 -0
  102. data/gemfiles/jruby_9.2.11.1_rails5_postgres_sidekiq.gemfile +42 -0
  103. data/gemfiles/jruby_9.2.11.1_rails5_postgres_sidekiq.gemfile.lock +279 -0
  104. data/gemfiles/jruby_9.2.11.1_rails61_mysql2.gemfile +40 -0
  105. data/gemfiles/jruby_9.2.11.1_rails61_mysql2.gemfile.lock +290 -0
  106. data/gemfiles/jruby_9.2.11.1_rails61_postgres.gemfile +40 -0
  107. data/gemfiles/jruby_9.2.11.1_rails61_postgres.gemfile.lock +290 -0
  108. data/gemfiles/jruby_9.2.11.1_rails61_postgres_redis.gemfile +41 -0
  109. data/gemfiles/jruby_9.2.11.1_rails61_postgres_redis.gemfile.lock +292 -0
  110. data/gemfiles/jruby_9.2.11.1_rails61_postgres_sidekiq.gemfile +41 -0
  111. data/gemfiles/jruby_9.2.11.1_rails61_postgres_sidekiq.gemfile.lock +297 -0
  112. data/gemfiles/jruby_9.2.11.1_rails6_mysql2.gemfile +40 -0
  113. data/gemfiles/jruby_9.2.11.1_rails6_mysql2.gemfile.lock +287 -0
  114. data/gemfiles/jruby_9.2.11.1_rails6_postgres.gemfile +40 -0
  115. data/gemfiles/jruby_9.2.11.1_rails6_postgres.gemfile.lock +287 -0
  116. data/gemfiles/jruby_9.2.11.1_rails6_postgres_redis.gemfile +41 -0
  117. data/gemfiles/jruby_9.2.11.1_rails6_postgres_redis.gemfile.lock +289 -0
  118. data/gemfiles/jruby_9.2.11.1_rails6_postgres_redis_activesupport.gemfile +41 -0
  119. data/gemfiles/jruby_9.2.11.1_rails6_postgres_redis_activesupport.gemfile.lock +289 -0
  120. data/gemfiles/jruby_9.2.11.1_rails6_postgres_sidekiq.gemfile +42 -0
  121. data/gemfiles/jruby_9.2.11.1_rails6_postgres_sidekiq.gemfile.lock +295 -0
  122. data/gemfiles/jruby_9.2.11.1_resque2_redis3.gemfile +36 -0
  123. data/gemfiles/jruby_9.2.11.1_resque2_redis3.gemfile.lock +180 -0
  124. data/gemfiles/jruby_9.2.11.1_resque2_redis4.gemfile +36 -0
  125. data/gemfiles/jruby_9.2.11.1_resque2_redis4.gemfile.lock +180 -0
  126. data/gemfiles/ruby_2.1.10_contrib_old.gemfile +66 -0
  127. data/gemfiles/ruby_2.1.10_contrib_old.gemfile.lock +305 -0
  128. data/gemfiles/ruby_2.1.10_core_old.gemfile +33 -0
  129. data/gemfiles/ruby_2.1.10_core_old.gemfile.lock +118 -0
  130. data/gemfiles/ruby_2.1.10_rails30_postgres.gemfile +39 -0
  131. data/gemfiles/ruby_2.1.10_rails30_postgres.gemfile.lock +196 -0
  132. data/gemfiles/ruby_2.1.10_rails30_postgres_sidekiq.gemfile +40 -0
  133. data/gemfiles/ruby_2.1.10_rails30_postgres_sidekiq.gemfile.lock +205 -0
  134. data/gemfiles/ruby_2.1.10_rails32_mysql2.gemfile +42 -0
  135. data/gemfiles/ruby_2.1.10_rails32_mysql2.gemfile.lock +215 -0
  136. data/gemfiles/ruby_2.1.10_rails32_postgres.gemfile +39 -0
  137. data/gemfiles/ruby_2.1.10_rails32_postgres.gemfile.lock +204 -0
  138. data/gemfiles/ruby_2.1.10_rails32_postgres_redis.gemfile +41 -0
  139. data/gemfiles/ruby_2.1.10_rails32_postgres_redis.gemfile.lock +223 -0
  140. data/gemfiles/ruby_2.1.10_rails32_postgres_sidekiq.gemfile +40 -0
  141. data/gemfiles/ruby_2.1.10_rails32_postgres_sidekiq.gemfile.lock +213 -0
  142. data/gemfiles/ruby_2.1.10_rails4_mysql2.gemfile +38 -0
  143. data/gemfiles/ruby_2.1.10_rails4_mysql2.gemfile.lock +218 -0
  144. data/gemfiles/ruby_2.1.10_rails4_postgres.gemfile +38 -0
  145. data/gemfiles/ruby_2.1.10_rails4_postgres.gemfile.lock +218 -0
  146. data/gemfiles/ruby_2.1.10_rails4_postgres_redis.gemfile +40 -0
  147. data/gemfiles/ruby_2.1.10_rails4_postgres_redis.gemfile.lock +237 -0
  148. data/gemfiles/ruby_2.2.10_contrib.gemfile +73 -0
  149. data/gemfiles/ruby_2.2.10_contrib.gemfile.lock +1450 -0
  150. data/gemfiles/ruby_2.2.10_core_old.gemfile +33 -0
  151. data/gemfiles/ruby_2.2.10_core_old.gemfile.lock +118 -0
  152. data/gemfiles/ruby_2.2.10_rails30_postgres.gemfile +39 -0
  153. data/gemfiles/ruby_2.2.10_rails30_postgres.gemfile.lock +196 -0
  154. data/gemfiles/ruby_2.2.10_rails30_postgres_sidekiq.gemfile +40 -0
  155. data/gemfiles/ruby_2.2.10_rails30_postgres_sidekiq.gemfile.lock +205 -0
  156. data/gemfiles/ruby_2.2.10_rails32_mysql2.gemfile +41 -0
  157. data/gemfiles/ruby_2.2.10_rails32_mysql2.gemfile.lock +212 -0
  158. data/gemfiles/ruby_2.2.10_rails32_postgres.gemfile +39 -0
  159. data/gemfiles/ruby_2.2.10_rails32_postgres.gemfile.lock +204 -0
  160. data/gemfiles/ruby_2.2.10_rails32_postgres_redis.gemfile +41 -0
  161. data/gemfiles/ruby_2.2.10_rails32_postgres_redis.gemfile.lock +223 -0
  162. data/gemfiles/ruby_2.2.10_rails32_postgres_sidekiq.gemfile +40 -0
  163. data/gemfiles/ruby_2.2.10_rails32_postgres_sidekiq.gemfile.lock +213 -0
  164. data/gemfiles/ruby_2.2.10_rails4_mysql2.gemfile +38 -0
  165. data/gemfiles/ruby_2.2.10_rails4_mysql2.gemfile.lock +218 -0
  166. data/gemfiles/ruby_2.2.10_rails4_postgres.gemfile +38 -0
  167. data/gemfiles/ruby_2.2.10_rails4_postgres.gemfile.lock +218 -0
  168. data/gemfiles/ruby_2.2.10_rails4_postgres_redis.gemfile +40 -0
  169. data/gemfiles/ruby_2.2.10_rails4_postgres_redis.gemfile.lock +237 -0
  170. data/gemfiles/ruby_2.2.10_rails4_postgres_sidekiq.gemfile +40 -0
  171. data/gemfiles/ruby_2.2.10_rails4_postgres_sidekiq.gemfile.lock +229 -0
  172. data/gemfiles/ruby_2.2.10_rails5_mysql2.gemfile +38 -0
  173. data/gemfiles/ruby_2.2.10_rails5_mysql2.gemfile.lock +234 -0
  174. data/gemfiles/ruby_2.2.10_rails5_postgres.gemfile +38 -0
  175. data/gemfiles/ruby_2.2.10_rails5_postgres.gemfile.lock +234 -0
  176. data/gemfiles/ruby_2.2.10_rails5_postgres_redis.gemfile +39 -0
  177. data/gemfiles/ruby_2.2.10_rails5_postgres_redis.gemfile.lock +236 -0
  178. data/gemfiles/ruby_2.2.10_rails5_postgres_redis_activesupport.gemfile +39 -0
  179. data/gemfiles/ruby_2.2.10_rails5_postgres_redis_activesupport.gemfile.lock +236 -0
  180. data/gemfiles/ruby_2.2.10_rails5_postgres_sidekiq.gemfile +40 -0
  181. data/gemfiles/ruby_2.2.10_rails5_postgres_sidekiq.gemfile.lock +245 -0
  182. data/gemfiles/ruby_2.3.8_contrib.gemfile +73 -0
  183. data/gemfiles/ruby_2.3.8_contrib.gemfile.lock +1459 -0
  184. data/gemfiles/ruby_2.3.8_contrib_old.gemfile +34 -0
  185. data/gemfiles/ruby_2.3.8_contrib_old.gemfile.lock +127 -0
  186. data/gemfiles/ruby_2.3.8_core_old.gemfile +33 -0
  187. data/gemfiles/ruby_2.3.8_core_old.gemfile.lock +123 -0
  188. data/gemfiles/ruby_2.3.8_cucumber3.gemfile +34 -0
  189. data/gemfiles/ruby_2.3.8_cucumber3.gemfile.lock +144 -0
  190. data/gemfiles/ruby_2.3.8_cucumber4.gemfile +34 -0
  191. data/gemfiles/ruby_2.3.8_cucumber4.gemfile.lock +174 -0
  192. data/gemfiles/ruby_2.3.8_rails30_postgres.gemfile +39 -0
  193. data/gemfiles/ruby_2.3.8_rails30_postgres.gemfile.lock +201 -0
  194. data/gemfiles/ruby_2.3.8_rails30_postgres_sidekiq.gemfile +40 -0
  195. data/gemfiles/ruby_2.3.8_rails30_postgres_sidekiq.gemfile.lock +210 -0
  196. data/gemfiles/ruby_2.3.8_rails32_mysql2.gemfile +41 -0
  197. data/gemfiles/ruby_2.3.8_rails32_mysql2.gemfile.lock +217 -0
  198. data/gemfiles/ruby_2.3.8_rails32_postgres.gemfile +39 -0
  199. data/gemfiles/ruby_2.3.8_rails32_postgres.gemfile.lock +209 -0
  200. data/gemfiles/ruby_2.3.8_rails32_postgres_redis.gemfile +41 -0
  201. data/gemfiles/ruby_2.3.8_rails32_postgres_redis.gemfile.lock +228 -0
  202. data/gemfiles/ruby_2.3.8_rails32_postgres_sidekiq.gemfile +40 -0
  203. data/gemfiles/ruby_2.3.8_rails32_postgres_sidekiq.gemfile.lock +218 -0
  204. data/gemfiles/ruby_2.3.8_rails4_mysql2.gemfile +38 -0
  205. data/gemfiles/ruby_2.3.8_rails4_mysql2.gemfile.lock +223 -0
  206. data/gemfiles/ruby_2.3.8_rails4_postgres.gemfile +38 -0
  207. data/gemfiles/ruby_2.3.8_rails4_postgres.gemfile.lock +223 -0
  208. data/gemfiles/ruby_2.3.8_rails4_postgres_redis.gemfile +40 -0
  209. data/gemfiles/ruby_2.3.8_rails4_postgres_redis.gemfile.lock +242 -0
  210. data/gemfiles/ruby_2.3.8_rails4_postgres_sidekiq.gemfile +40 -0
  211. data/gemfiles/ruby_2.3.8_rails4_postgres_sidekiq.gemfile.lock +234 -0
  212. data/gemfiles/ruby_2.3.8_rails5_mysql2.gemfile +37 -0
  213. data/gemfiles/ruby_2.3.8_rails5_mysql2.gemfile.lock +234 -0
  214. data/gemfiles/ruby_2.3.8_rails5_postgres.gemfile +37 -0
  215. data/gemfiles/ruby_2.3.8_rails5_postgres.gemfile.lock +234 -0
  216. data/gemfiles/ruby_2.3.8_rails5_postgres_redis.gemfile +38 -0
  217. data/gemfiles/ruby_2.3.8_rails5_postgres_redis.gemfile.lock +236 -0
  218. data/gemfiles/ruby_2.3.8_rails5_postgres_redis_activesupport.gemfile +38 -0
  219. data/gemfiles/ruby_2.3.8_rails5_postgres_redis_activesupport.gemfile.lock +236 -0
  220. data/gemfiles/ruby_2.3.8_rails5_postgres_sidekiq.gemfile +39 -0
  221. data/gemfiles/ruby_2.3.8_rails5_postgres_sidekiq.gemfile.lock +245 -0
  222. data/gemfiles/ruby_2.3.8_resque2_redis3.gemfile +35 -0
  223. data/gemfiles/ruby_2.3.8_resque2_redis3.gemfile.lock +150 -0
  224. data/gemfiles/ruby_2.3.8_resque2_redis4.gemfile +35 -0
  225. data/gemfiles/ruby_2.3.8_resque2_redis4.gemfile.lock +150 -0
  226. data/gemfiles/ruby_2.4.6_contrib.gemfile +78 -0
  227. data/gemfiles/ruby_2.4.6_contrib.gemfile.lock +1513 -0
  228. data/gemfiles/ruby_2.4.6_contrib_old.gemfile +38 -0
  229. data/gemfiles/ruby_2.4.6_contrib_old.gemfile.lock +155 -0
  230. data/gemfiles/ruby_2.4.6_core_old.gemfile +37 -0
  231. data/gemfiles/ruby_2.4.6_core_old.gemfile.lock +151 -0
  232. data/gemfiles/ruby_2.4.6_cucumber3.gemfile +38 -0
  233. data/gemfiles/ruby_2.4.6_cucumber3.gemfile.lock +172 -0
  234. data/gemfiles/ruby_2.4.6_cucumber4.gemfile +38 -0
  235. data/gemfiles/ruby_2.4.6_cucumber4.gemfile.lock +202 -0
  236. data/gemfiles/ruby_2.4.6_rails5_mysql2.gemfile +41 -0
  237. data/gemfiles/ruby_2.4.6_rails5_mysql2.gemfile.lock +262 -0
  238. data/gemfiles/ruby_2.4.6_rails5_postgres.gemfile +41 -0
  239. data/gemfiles/ruby_2.4.6_rails5_postgres.gemfile.lock +262 -0
  240. data/gemfiles/ruby_2.4.6_rails5_postgres_redis.gemfile +42 -0
  241. data/gemfiles/ruby_2.4.6_rails5_postgres_redis.gemfile.lock +264 -0
  242. data/gemfiles/ruby_2.4.6_rails5_postgres_redis_activesupport.gemfile +42 -0
  243. data/gemfiles/ruby_2.4.6_rails5_postgres_redis_activesupport.gemfile.lock +264 -0
  244. data/gemfiles/ruby_2.4.6_rails5_postgres_sidekiq.gemfile +43 -0
  245. data/gemfiles/ruby_2.4.6_rails5_postgres_sidekiq.gemfile.lock +273 -0
  246. data/gemfiles/ruby_2.4.6_resque2_redis3.gemfile +39 -0
  247. data/gemfiles/ruby_2.4.6_resque2_redis3.gemfile.lock +178 -0
  248. data/gemfiles/ruby_2.4.6_resque2_redis4.gemfile +39 -0
  249. data/gemfiles/ruby_2.4.6_resque2_redis4.gemfile.lock +178 -0
  250. data/gemfiles/ruby_2.5.6_contrib.gemfile +83 -0
  251. data/gemfiles/ruby_2.5.6_contrib.gemfile.lock +1526 -0
  252. data/gemfiles/ruby_2.5.6_contrib_old.gemfile +39 -0
  253. data/gemfiles/ruby_2.5.6_contrib_old.gemfile.lock +165 -0
  254. data/gemfiles/ruby_2.5.6_core_old.gemfile +38 -0
  255. data/gemfiles/ruby_2.5.6_core_old.gemfile.lock +161 -0
  256. data/gemfiles/ruby_2.5.6_cucumber3.gemfile +39 -0
  257. data/gemfiles/ruby_2.5.6_cucumber3.gemfile.lock +182 -0
  258. data/gemfiles/ruby_2.5.6_cucumber4.gemfile +39 -0
  259. data/gemfiles/ruby_2.5.6_cucumber4.gemfile.lock +214 -0
  260. data/gemfiles/ruby_2.5.6_cucumber5.gemfile +39 -0
  261. data/gemfiles/ruby_2.5.6_cucumber5.gemfile.lock +214 -0
  262. data/gemfiles/ruby_2.5.6_rails5_mysql2.gemfile +44 -0
  263. data/gemfiles/ruby_2.5.6_rails5_mysql2.gemfile.lock +276 -0
  264. data/gemfiles/ruby_2.5.6_rails5_postgres.gemfile +44 -0
  265. data/gemfiles/ruby_2.5.6_rails5_postgres.gemfile.lock +276 -0
  266. data/gemfiles/ruby_2.5.6_rails5_postgres_redis.gemfile +45 -0
  267. data/gemfiles/ruby_2.5.6_rails5_postgres_redis.gemfile.lock +278 -0
  268. data/gemfiles/ruby_2.5.6_rails5_postgres_redis_activesupport.gemfile +45 -0
  269. data/gemfiles/ruby_2.5.6_rails5_postgres_redis_activesupport.gemfile.lock +278 -0
  270. data/gemfiles/ruby_2.5.6_rails5_postgres_sidekiq.gemfile +46 -0
  271. data/gemfiles/ruby_2.5.6_rails5_postgres_sidekiq.gemfile.lock +284 -0
  272. data/gemfiles/ruby_2.5.6_rails61_mysql2.gemfile +44 -0
  273. data/gemfiles/ruby_2.5.6_rails61_mysql2.gemfile.lock +295 -0
  274. data/gemfiles/ruby_2.5.6_rails61_postgres.gemfile +44 -0
  275. data/gemfiles/ruby_2.5.6_rails61_postgres.gemfile.lock +295 -0
  276. data/gemfiles/ruby_2.5.6_rails61_postgres_redis.gemfile +45 -0
  277. data/gemfiles/ruby_2.5.6_rails61_postgres_redis.gemfile.lock +297 -0
  278. data/gemfiles/ruby_2.5.6_rails61_postgres_sidekiq.gemfile +45 -0
  279. data/gemfiles/ruby_2.5.6_rails61_postgres_sidekiq.gemfile.lock +302 -0
  280. data/gemfiles/ruby_2.5.6_rails6_mysql2.gemfile +44 -0
  281. data/gemfiles/ruby_2.5.6_rails6_mysql2.gemfile.lock +292 -0
  282. data/gemfiles/ruby_2.5.6_rails6_postgres.gemfile +44 -0
  283. data/gemfiles/ruby_2.5.6_rails6_postgres.gemfile.lock +292 -0
  284. data/gemfiles/ruby_2.5.6_rails6_postgres_redis.gemfile +45 -0
  285. data/gemfiles/ruby_2.5.6_rails6_postgres_redis.gemfile.lock +294 -0
  286. data/gemfiles/ruby_2.5.6_rails6_postgres_redis_activesupport.gemfile +45 -0
  287. data/gemfiles/ruby_2.5.6_rails6_postgres_redis_activesupport.gemfile.lock +294 -0
  288. data/gemfiles/ruby_2.5.6_rails6_postgres_sidekiq.gemfile +46 -0
  289. data/gemfiles/ruby_2.5.6_rails6_postgres_sidekiq.gemfile.lock +300 -0
  290. data/gemfiles/ruby_2.5.6_resque2_redis3.gemfile +40 -0
  291. data/gemfiles/ruby_2.5.6_resque2_redis3.gemfile.lock +188 -0
  292. data/gemfiles/ruby_2.5.6_resque2_redis4.gemfile +40 -0
  293. data/gemfiles/ruby_2.5.6_resque2_redis4.gemfile.lock +188 -0
  294. data/gemfiles/ruby_2.6.4_contrib.gemfile +79 -0
  295. data/gemfiles/ruby_2.6.4_contrib.gemfile.lock +1524 -0
  296. data/gemfiles/ruby_2.6.4_contrib_old.gemfile +39 -0
  297. data/gemfiles/ruby_2.6.4_contrib_old.gemfile.lock +167 -0
  298. data/gemfiles/ruby_2.6.4_core_old.gemfile +38 -0
  299. data/gemfiles/ruby_2.6.4_core_old.gemfile.lock +163 -0
  300. data/gemfiles/ruby_2.6.4_cucumber3.gemfile +39 -0
  301. data/gemfiles/ruby_2.6.4_cucumber3.gemfile.lock +184 -0
  302. data/gemfiles/ruby_2.6.4_cucumber4.gemfile +39 -0
  303. data/gemfiles/ruby_2.6.4_cucumber4.gemfile.lock +216 -0
  304. data/gemfiles/ruby_2.6.4_cucumber5.gemfile +39 -0
  305. data/gemfiles/ruby_2.6.4_cucumber5.gemfile.lock +216 -0
  306. data/gemfiles/ruby_2.6.4_rails5_mysql2.gemfile +42 -0
  307. data/gemfiles/ruby_2.6.4_rails5_mysql2.gemfile.lock +276 -0
  308. data/gemfiles/ruby_2.6.4_rails5_postgres.gemfile +42 -0
  309. data/gemfiles/ruby_2.6.4_rails5_postgres.gemfile.lock +276 -0
  310. data/gemfiles/ruby_2.6.4_rails5_postgres_redis.gemfile +43 -0
  311. data/gemfiles/ruby_2.6.4_rails5_postgres_redis.gemfile.lock +278 -0
  312. data/gemfiles/ruby_2.6.4_rails5_postgres_redis_activesupport.gemfile +43 -0
  313. data/gemfiles/ruby_2.6.4_rails5_postgres_redis_activesupport.gemfile.lock +278 -0
  314. data/gemfiles/ruby_2.6.4_rails5_postgres_sidekiq.gemfile +44 -0
  315. data/gemfiles/ruby_2.6.4_rails5_postgres_sidekiq.gemfile.lock +284 -0
  316. data/gemfiles/ruby_2.6.4_rails61_mysql2.gemfile +42 -0
  317. data/gemfiles/ruby_2.6.4_rails61_mysql2.gemfile.lock +295 -0
  318. data/gemfiles/ruby_2.6.4_rails61_postgres.gemfile +42 -0
  319. data/gemfiles/ruby_2.6.4_rails61_postgres.gemfile.lock +295 -0
  320. data/gemfiles/ruby_2.6.4_rails61_postgres_redis.gemfile +43 -0
  321. data/gemfiles/ruby_2.6.4_rails61_postgres_redis.gemfile.lock +297 -0
  322. data/gemfiles/ruby_2.6.4_rails61_postgres_sidekiq.gemfile +43 -0
  323. data/gemfiles/ruby_2.6.4_rails61_postgres_sidekiq.gemfile.lock +302 -0
  324. data/gemfiles/ruby_2.6.4_rails6_mysql2.gemfile +42 -0
  325. data/gemfiles/ruby_2.6.4_rails6_mysql2.gemfile.lock +292 -0
  326. data/gemfiles/ruby_2.6.4_rails6_postgres.gemfile +42 -0
  327. data/gemfiles/ruby_2.6.4_rails6_postgres.gemfile.lock +292 -0
  328. data/gemfiles/ruby_2.6.4_rails6_postgres_redis.gemfile +43 -0
  329. data/gemfiles/ruby_2.6.4_rails6_postgres_redis.gemfile.lock +294 -0
  330. data/gemfiles/ruby_2.6.4_rails6_postgres_redis_activesupport.gemfile +43 -0
  331. data/gemfiles/ruby_2.6.4_rails6_postgres_redis_activesupport.gemfile.lock +294 -0
  332. data/gemfiles/ruby_2.6.4_rails6_postgres_sidekiq.gemfile +44 -0
  333. data/gemfiles/ruby_2.6.4_rails6_postgres_sidekiq.gemfile.lock +300 -0
  334. data/gemfiles/ruby_2.6.4_resque2_redis3.gemfile +40 -0
  335. data/gemfiles/ruby_2.6.4_resque2_redis3.gemfile.lock +190 -0
  336. data/gemfiles/ruby_2.6.4_resque2_redis4.gemfile +40 -0
  337. data/gemfiles/ruby_2.6.4_resque2_redis4.gemfile.lock +190 -0
  338. data/gemfiles/ruby_2.7.0_contrib.gemfile +78 -0
  339. data/gemfiles/ruby_2.7.0_contrib.gemfile.lock +1523 -0
  340. data/gemfiles/ruby_2.7.0_contrib_old.gemfile +39 -0
  341. data/gemfiles/ruby_2.7.0_contrib_old.gemfile.lock +167 -0
  342. data/gemfiles/ruby_2.7.0_core_old.gemfile +38 -0
  343. data/gemfiles/ruby_2.7.0_core_old.gemfile.lock +163 -0
  344. data/gemfiles/ruby_2.7.0_cucumber3.gemfile +39 -0
  345. data/gemfiles/ruby_2.7.0_cucumber3.gemfile.lock +184 -0
  346. data/gemfiles/ruby_2.7.0_cucumber4.gemfile +39 -0
  347. data/gemfiles/ruby_2.7.0_cucumber4.gemfile.lock +216 -0
  348. data/gemfiles/ruby_2.7.0_cucumber5.gemfile +39 -0
  349. data/gemfiles/ruby_2.7.0_cucumber5.gemfile.lock +216 -0
  350. data/gemfiles/ruby_2.7.0_rails5_mysql2.gemfile +42 -0
  351. data/gemfiles/ruby_2.7.0_rails5_mysql2.gemfile.lock +276 -0
  352. data/gemfiles/ruby_2.7.0_rails5_postgres.gemfile +42 -0
  353. data/gemfiles/ruby_2.7.0_rails5_postgres.gemfile.lock +276 -0
  354. data/gemfiles/ruby_2.7.0_rails5_postgres_redis.gemfile +44 -0
  355. data/gemfiles/ruby_2.7.0_rails5_postgres_redis.gemfile.lock +295 -0
  356. data/gemfiles/ruby_2.7.0_rails5_postgres_redis_activesupport.gemfile +44 -0
  357. data/gemfiles/ruby_2.7.0_rails5_postgres_redis_activesupport.gemfile.lock +295 -0
  358. data/gemfiles/ruby_2.7.0_rails5_postgres_sidekiq.gemfile +44 -0
  359. data/gemfiles/ruby_2.7.0_rails5_postgres_sidekiq.gemfile.lock +284 -0
  360. data/gemfiles/ruby_2.7.0_rails61_mysql2.gemfile +42 -0
  361. data/gemfiles/ruby_2.7.0_rails61_mysql2.gemfile.lock +295 -0
  362. data/gemfiles/ruby_2.7.0_rails61_postgres.gemfile +42 -0
  363. data/gemfiles/ruby_2.7.0_rails61_postgres.gemfile.lock +295 -0
  364. data/gemfiles/ruby_2.7.0_rails61_postgres_redis.gemfile +43 -0
  365. data/gemfiles/ruby_2.7.0_rails61_postgres_redis.gemfile.lock +297 -0
  366. data/gemfiles/ruby_2.7.0_rails61_postgres_sidekiq.gemfile +43 -0
  367. data/gemfiles/ruby_2.7.0_rails61_postgres_sidekiq.gemfile.lock +302 -0
  368. data/gemfiles/ruby_2.7.0_rails6_mysql2.gemfile +42 -0
  369. data/gemfiles/ruby_2.7.0_rails6_mysql2.gemfile.lock +292 -0
  370. data/gemfiles/ruby_2.7.0_rails6_postgres.gemfile +42 -0
  371. data/gemfiles/ruby_2.7.0_rails6_postgres.gemfile.lock +292 -0
  372. data/gemfiles/ruby_2.7.0_rails6_postgres_redis.gemfile +44 -0
  373. data/gemfiles/ruby_2.7.0_rails6_postgres_redis.gemfile.lock +311 -0
  374. data/gemfiles/ruby_2.7.0_rails6_postgres_redis_activesupport.gemfile +44 -0
  375. data/gemfiles/ruby_2.7.0_rails6_postgres_redis_activesupport.gemfile.lock +311 -0
  376. data/gemfiles/ruby_2.7.0_rails6_postgres_sidekiq.gemfile +44 -0
  377. data/gemfiles/ruby_2.7.0_rails6_postgres_sidekiq.gemfile.lock +300 -0
  378. data/gemfiles/ruby_2.7.0_resque2_redis3.gemfile +40 -0
  379. data/gemfiles/ruby_2.7.0_resque2_redis3.gemfile.lock +190 -0
  380. data/gemfiles/ruby_2.7.0_resque2_redis4.gemfile +40 -0
  381. data/gemfiles/ruby_2.7.0_resque2_redis4.gemfile.lock +190 -0
  382. data/gemfiles/ruby_3.0.0_contrib.gemfile +78 -0
  383. data/gemfiles/ruby_3.0.0_contrib.gemfile.lock +1540 -0
  384. data/gemfiles/ruby_3.0.0_core_old.gemfile +39 -0
  385. data/gemfiles/ruby_3.0.0_core_old.gemfile.lock +165 -0
  386. data/gemfiles/ruby_3.0.0_cucumber3.gemfile +40 -0
  387. data/gemfiles/ruby_3.0.0_cucumber3.gemfile.lock +186 -0
  388. data/gemfiles/ruby_3.0.0_cucumber4.gemfile +40 -0
  389. data/gemfiles/ruby_3.0.0_cucumber4.gemfile.lock +218 -0
  390. data/gemfiles/ruby_3.0.0_cucumber5.gemfile +40 -0
  391. data/gemfiles/ruby_3.0.0_cucumber5.gemfile.lock +218 -0
  392. data/gemfiles/ruby_3.0.0_rails61_mysql2.gemfile +43 -0
  393. data/gemfiles/ruby_3.0.0_rails61_mysql2.gemfile.lock +295 -0
  394. data/gemfiles/ruby_3.0.0_rails61_postgres.gemfile +43 -0
  395. data/gemfiles/ruby_3.0.0_rails61_postgres.gemfile.lock +295 -0
  396. data/gemfiles/ruby_3.0.0_rails61_postgres_redis.gemfile +44 -0
  397. data/gemfiles/ruby_3.0.0_rails61_postgres_redis.gemfile.lock +297 -0
  398. data/gemfiles/ruby_3.0.0_rails61_postgres_sidekiq.gemfile +44 -0
  399. data/gemfiles/ruby_3.0.0_rails61_postgres_sidekiq.gemfile.lock +302 -0
  400. data/gemfiles/ruby_3.0.0_resque2_redis3.gemfile +41 -0
  401. data/gemfiles/ruby_3.0.0_resque2_redis3.gemfile.lock +192 -0
  402. data/gemfiles/ruby_3.0.0_resque2_redis4.gemfile +41 -0
  403. data/gemfiles/ruby_3.0.0_resque2_redis4.gemfile.lock +192 -0
  404. data/integration/README.md +67 -0
  405. data/integration/apps/rack/.dockerignore +1 -0
  406. data/integration/apps/rack/.envrc.sample +1 -0
  407. data/integration/apps/rack/.gitignore +4 -0
  408. data/integration/apps/rack/.rspec +1 -0
  409. data/integration/apps/rack/Dockerfile +28 -0
  410. data/integration/apps/rack/Dockerfile-ci +11 -0
  411. data/integration/apps/rack/Gemfile +24 -0
  412. data/integration/apps/rack/README.md +93 -0
  413. data/integration/apps/rack/app/acme.rb +80 -0
  414. data/integration/apps/rack/app/datadog.rb +17 -0
  415. data/integration/apps/rack/bin/run +22 -0
  416. data/integration/apps/rack/bin/setup +17 -0
  417. data/integration/apps/rack/bin/test +24 -0
  418. data/integration/apps/rack/config.ru +6 -0
  419. data/integration/apps/rack/config/puma.rb +14 -0
  420. data/integration/apps/rack/config/unicorn.rb +23 -0
  421. data/integration/apps/rack/docker-compose.ci.yml +62 -0
  422. data/integration/apps/rack/docker-compose.yml +78 -0
  423. data/integration/apps/rack/script/build-images +38 -0
  424. data/integration/apps/rack/script/ci +51 -0
  425. data/integration/apps/rack/spec/integration/basic_spec.rb +10 -0
  426. data/integration/apps/rack/spec/spec_helper.rb +16 -0
  427. data/integration/apps/rack/spec/support/integration_helper.rb +22 -0
  428. data/integration/apps/rails-five/.dockerignore +1 -0
  429. data/integration/apps/rails-five/.env +3 -0
  430. data/integration/apps/rails-five/.envrc.sample +1 -0
  431. data/integration/apps/rails-five/.gitignore +30 -0
  432. data/integration/apps/rails-five/Dockerfile +25 -0
  433. data/integration/apps/rails-five/Dockerfile-ci +11 -0
  434. data/integration/apps/rails-five/Gemfile +104 -0
  435. data/integration/apps/rails-five/README.md +94 -0
  436. data/integration/apps/rails-five/Rakefile +6 -0
  437. data/integration/apps/rails-five/app/channels/application_cable/channel.rb +4 -0
  438. data/integration/apps/rails-five/app/channels/application_cable/connection.rb +4 -0
  439. data/integration/apps/rails-five/app/controllers/application_controller.rb +2 -0
  440. data/integration/apps/rails-five/app/controllers/basic_controller.rb +36 -0
  441. data/integration/apps/rails-five/app/controllers/concerns/.keep +0 -0
  442. data/integration/apps/rails-five/app/controllers/health_controller.rb +9 -0
  443. data/integration/apps/rails-five/app/controllers/jobs_controller.rb +12 -0
  444. data/integration/apps/rails-five/app/jobs/application_job.rb +2 -0
  445. data/integration/apps/rails-five/app/jobs/test_job.rb +12 -0
  446. data/integration/apps/rails-five/app/mailers/application_mailer.rb +4 -0
  447. data/integration/apps/rails-five/app/models/application_record.rb +3 -0
  448. data/integration/apps/rails-five/app/models/concerns/.keep +0 -0
  449. data/integration/apps/rails-five/app/models/test.rb +2 -0
  450. data/integration/apps/rails-five/app/views/layouts/mailer.html.erb +13 -0
  451. data/integration/apps/rails-five/app/views/layouts/mailer.text.erb +1 -0
  452. data/integration/apps/rails-five/bin/bundle +3 -0
  453. data/integration/apps/rails-five/bin/rails +9 -0
  454. data/integration/apps/rails-five/bin/rake +9 -0
  455. data/integration/apps/rails-five/bin/run +24 -0
  456. data/integration/apps/rails-five/bin/setup +27 -0
  457. data/integration/apps/rails-five/bin/spring +17 -0
  458. data/integration/apps/rails-five/bin/test +21 -0
  459. data/integration/apps/rails-five/bin/update +28 -0
  460. data/integration/apps/rails-five/config.ru +5 -0
  461. data/integration/apps/rails-five/config/application.rb +97 -0
  462. data/integration/apps/rails-five/config/boot.rb +4 -0
  463. data/integration/apps/rails-five/config/cable.yml +10 -0
  464. data/integration/apps/rails-five/config/credentials.yml.enc +1 -0
  465. data/integration/apps/rails-five/config/database.yml +28 -0
  466. data/integration/apps/rails-five/config/environment.rb +5 -0
  467. data/integration/apps/rails-five/config/environments/development.rb +51 -0
  468. data/integration/apps/rails-five/config/environments/production.rb +82 -0
  469. data/integration/apps/rails-five/config/environments/test.rb +43 -0
  470. data/integration/apps/rails-five/config/initializers/datadog.rb +18 -0
  471. data/integration/apps/rails-five/config/initializers/filter_parameter_logging.rb +4 -0
  472. data/integration/apps/rails-five/config/initializers/resque.rb +4 -0
  473. data/integration/apps/rails-five/config/initializers/rollbar.rb +5 -0
  474. data/integration/apps/rails-five/config/initializers/wrap_parameters.rb +14 -0
  475. data/integration/apps/rails-five/config/locales/en.yml +33 -0
  476. data/integration/apps/rails-five/config/puma.rb +24 -0
  477. data/integration/apps/rails-five/config/routes.rb +11 -0
  478. data/integration/apps/rails-five/config/spring.rb +6 -0
  479. data/integration/apps/rails-five/config/unicorn.rb +29 -0
  480. data/integration/apps/rails-five/db/migrate/20190927215052_create_tests.rb +11 -0
  481. data/integration/apps/rails-five/db/schema.rb +23 -0
  482. data/integration/apps/rails-five/db/seeds.rb +7 -0
  483. data/integration/apps/rails-five/docker-compose.ci.yml +98 -0
  484. data/integration/apps/rails-five/docker-compose.yml +100 -0
  485. data/integration/apps/rails-five/lib/tasks/.keep +0 -0
  486. data/integration/apps/rails-five/log/.keep +0 -0
  487. data/integration/apps/rails-five/public/robots.txt +1 -0
  488. data/integration/apps/rails-five/script/build-images +35 -0
  489. data/integration/apps/rails-five/script/ci +51 -0
  490. data/integration/apps/rails-five/spec/integration/basic_spec.rb +10 -0
  491. data/integration/apps/rails-five/spec/spec_helper.rb +16 -0
  492. data/integration/apps/rails-five/spec/support/integration_helper.rb +22 -0
  493. data/integration/apps/rails-five/storage/.keep +0 -0
  494. data/integration/apps/rails-five/tmp/.keep +0 -0
  495. data/integration/apps/rails-five/vendor/.keep +0 -0
  496. data/integration/apps/rspec/.dockerignore +1 -0
  497. data/integration/apps/rspec/.envrc.sample +1 -0
  498. data/integration/apps/rspec/.gitignore +2 -0
  499. data/integration/apps/rspec/.rspec +1 -0
  500. data/integration/apps/rspec/Dockerfile +25 -0
  501. data/integration/apps/rspec/Dockerfile-ci +11 -0
  502. data/integration/apps/rspec/Gemfile +14 -0
  503. data/integration/apps/rspec/README.md +70 -0
  504. data/integration/apps/rspec/agent.yaml +3 -0
  505. data/integration/apps/rspec/app/datadog.rb +13 -0
  506. data/integration/apps/rspec/app/fibonacci.rb +30 -0
  507. data/integration/apps/rspec/bin/run +20 -0
  508. data/integration/apps/rspec/bin/setup +17 -0
  509. data/integration/apps/rspec/bin/test +21 -0
  510. data/integration/apps/rspec/docker-compose.ci.yml +51 -0
  511. data/integration/apps/rspec/docker-compose.yml +63 -0
  512. data/integration/apps/rspec/script/build-images +37 -0
  513. data/integration/apps/rspec/script/ci +53 -0
  514. data/integration/apps/rspec/spec/fibonacci_spec.rb +16 -0
  515. data/integration/apps/rspec/spec/rspec_spec.rb +58 -0
  516. data/integration/apps/rspec/spec/spec_helper.rb +24 -0
  517. data/integration/apps/ruby/.dockerignore +1 -0
  518. data/integration/apps/ruby/.envrc.sample +1 -0
  519. data/integration/apps/ruby/.gitignore +2 -0
  520. data/integration/apps/ruby/Dockerfile +25 -0
  521. data/integration/apps/ruby/Dockerfile-ci +11 -0
  522. data/integration/apps/ruby/Gemfile +11 -0
  523. data/integration/apps/ruby/README.md +70 -0
  524. data/integration/apps/ruby/agent.yaml +3 -0
  525. data/integration/apps/ruby/app/datadog.rb +13 -0
  526. data/integration/apps/ruby/app/fibonacci.rb +58 -0
  527. data/integration/apps/ruby/bin/run +20 -0
  528. data/integration/apps/ruby/bin/setup +17 -0
  529. data/integration/apps/ruby/bin/test +21 -0
  530. data/integration/apps/ruby/docker-compose.ci.yml +51 -0
  531. data/integration/apps/ruby/docker-compose.yml +63 -0
  532. data/integration/apps/ruby/script/build-images +38 -0
  533. data/integration/apps/ruby/script/ci +51 -0
  534. data/integration/images/agent/Dockerfile +2 -0
  535. data/integration/images/agent/agent.yaml +3 -0
  536. data/integration/images/include/datadog/analyzer.rb +71 -0
  537. data/integration/images/include/datadog/demo_env.rb +101 -0
  538. data/integration/images/include/http-health-check +33 -0
  539. data/integration/images/ruby/2.1/Dockerfile +54 -0
  540. data/integration/images/ruby/2.2/Dockerfile +54 -0
  541. data/integration/images/ruby/2.3/Dockerfile +70 -0
  542. data/integration/images/ruby/2.4/Dockerfile +54 -0
  543. data/integration/images/ruby/2.5/Dockerfile +54 -0
  544. data/integration/images/ruby/2.6/Dockerfile +54 -0
  545. data/integration/images/ruby/2.7/Dockerfile +54 -0
  546. data/integration/images/ruby/3.0/Dockerfile +54 -0
  547. data/integration/images/wrk/Dockerfile +33 -0
  548. data/integration/images/wrk/scripts/entrypoint.sh +17 -0
  549. data/integration/images/wrk/scripts/scenarios/basic/default.lua +1 -0
  550. data/integration/images/wrk/scripts/scenarios/basic/fibonacci.lua +1 -0
  551. data/integration/script/build-images +43 -0
  552. data/lib/datadog/ci.rb +16 -0
  553. data/lib/datadog/ci/configuration/components.rb +30 -0
  554. data/lib/datadog/ci/configuration/settings.rb +36 -0
  555. data/lib/datadog/ci/context_flush.rb +28 -0
  556. data/lib/datadog/ci/contrib/cucumber/configuration/settings.rb +30 -0
  557. data/lib/datadog/ci/contrib/cucumber/ext.rb +19 -0
  558. data/lib/datadog/ci/contrib/cucumber/formatter.rb +97 -0
  559. data/lib/datadog/ci/contrib/cucumber/instrumentation.rb +26 -0
  560. data/lib/datadog/ci/contrib/cucumber/integration.rb +47 -0
  561. data/lib/datadog/ci/contrib/cucumber/patcher.rb +25 -0
  562. data/lib/datadog/ci/contrib/rspec/configuration/settings.rb +30 -0
  563. data/lib/datadog/ci/contrib/rspec/example.rb +73 -0
  564. data/lib/datadog/ci/contrib/rspec/ext.rb +18 -0
  565. data/lib/datadog/ci/contrib/rspec/integration.rb +48 -0
  566. data/lib/datadog/ci/contrib/rspec/patcher.rb +25 -0
  567. data/lib/datadog/ci/ext/app_types.rb +9 -0
  568. data/lib/datadog/ci/ext/environment.rb +303 -0
  569. data/lib/datadog/ci/ext/settings.rb +10 -0
  570. data/lib/datadog/ci/ext/test.rb +28 -0
  571. data/lib/datadog/ci/extensions.rb +17 -0
  572. data/lib/datadog/ci/test.rb +63 -0
  573. data/lib/ddtrace.rb +9 -5
  574. data/lib/ddtrace/analytics.rb +2 -0
  575. data/lib/ddtrace/auto_instrument.rb +3 -0
  576. data/lib/ddtrace/auto_instrument_base.rb +6 -0
  577. data/lib/ddtrace/buffer.rb +260 -53
  578. data/lib/ddtrace/configuration.rb +113 -21
  579. data/lib/ddtrace/configuration/agent_settings_resolver.rb +230 -0
  580. data/lib/ddtrace/configuration/base.rb +7 -10
  581. data/lib/ddtrace/configuration/components.rb +119 -21
  582. data/lib/ddtrace/configuration/option_definition.rb +1 -3
  583. data/lib/ddtrace/configuration/options.rb +9 -10
  584. data/lib/ddtrace/configuration/settings.rb +119 -10
  585. data/lib/ddtrace/context.rb +40 -20
  586. data/lib/ddtrace/context_flush.rb +14 -2
  587. data/lib/ddtrace/context_provider.rb +16 -5
  588. data/lib/ddtrace/contrib/action_cable/event.rb +5 -4
  589. data/lib/ddtrace/contrib/action_cable/integration.rb +7 -0
  590. data/lib/ddtrace/contrib/action_pack/action_controller/instrumentation.rb +2 -4
  591. data/lib/ddtrace/contrib/action_pack/action_controller/patcher.rb +1 -1
  592. data/lib/ddtrace/contrib/action_pack/integration.rb +7 -0
  593. data/lib/ddtrace/contrib/action_pack/utils.rb +1 -1
  594. data/lib/ddtrace/contrib/action_view/event.rb +3 -7
  595. data/lib/ddtrace/contrib/action_view/events/render_partial.rb +1 -0
  596. data/lib/ddtrace/contrib/action_view/events/render_template.rb +1 -0
  597. data/lib/ddtrace/contrib/action_view/integration.rb +7 -0
  598. data/lib/ddtrace/contrib/action_view/patcher.rb +4 -4
  599. data/lib/ddtrace/contrib/action_view/utils.rb +1 -1
  600. data/lib/ddtrace/contrib/active_model_serializers/event.rb +2 -2
  601. data/lib/ddtrace/contrib/active_record/configuration/makara_resolver.rb +30 -0
  602. data/lib/ddtrace/contrib/active_record/configuration/resolver.rb +107 -18
  603. data/lib/ddtrace/contrib/active_record/event.rb +2 -2
  604. data/lib/ddtrace/contrib/active_record/events/sql.rb +4 -0
  605. data/lib/ddtrace/contrib/active_record/integration.rb +7 -0
  606. data/lib/ddtrace/contrib/active_record/utils.rb +68 -21
  607. data/lib/ddtrace/contrib/active_support/cache/instrumentation.rb +104 -3
  608. data/lib/ddtrace/contrib/active_support/cache/patcher.rb +25 -4
  609. data/lib/ddtrace/contrib/active_support/cache/redis.rb +1 -5
  610. data/lib/ddtrace/contrib/active_support/ext.rb +3 -0
  611. data/lib/ddtrace/contrib/active_support/integration.rb +7 -1
  612. data/lib/ddtrace/contrib/active_support/notifications/event.rb +14 -3
  613. data/lib/ddtrace/contrib/active_support/notifications/subscriber.rb +2 -1
  614. data/lib/ddtrace/contrib/active_support/notifications/subscription.rb +11 -7
  615. data/lib/ddtrace/contrib/auto_instrument.rb +48 -0
  616. data/lib/ddtrace/contrib/aws/instrumentation.rb +35 -1
  617. data/lib/ddtrace/contrib/aws/patcher.rb +5 -1
  618. data/lib/ddtrace/contrib/aws/services.rb +3 -0
  619. data/lib/ddtrace/contrib/concurrent_ruby/patcher.rb +1 -1
  620. data/lib/ddtrace/contrib/configurable.rb +64 -38
  621. data/lib/ddtrace/contrib/configuration/resolver.rb +70 -5
  622. data/lib/ddtrace/contrib/configuration/resolvers/pattern_resolver.rb +20 -20
  623. data/lib/ddtrace/contrib/configuration/settings.rb +7 -6
  624. data/lib/ddtrace/contrib/dalli/instrumentation.rb +5 -1
  625. data/lib/ddtrace/contrib/dalli/patcher.rb +1 -39
  626. data/lib/ddtrace/contrib/delayed_job/configuration/settings.rb +2 -0
  627. data/lib/ddtrace/contrib/delayed_job/ext.rb +2 -0
  628. data/lib/ddtrace/contrib/delayed_job/plugin.rb +38 -15
  629. data/lib/ddtrace/contrib/elasticsearch/patcher.rb +5 -0
  630. data/lib/ddtrace/contrib/elasticsearch/quantize.rb +3 -2
  631. data/lib/ddtrace/contrib/ethon/easy_patch.rb +14 -11
  632. data/lib/ddtrace/contrib/ethon/ext.rb +1 -0
  633. data/lib/ddtrace/contrib/ethon/multi_patch.rb +5 -1
  634. data/lib/ddtrace/contrib/ethon/patcher.rb +2 -2
  635. data/lib/ddtrace/contrib/excon/middleware.rb +13 -7
  636. data/lib/ddtrace/contrib/extensions.rb +56 -6
  637. data/lib/ddtrace/contrib/faraday/middleware.rb +5 -3
  638. data/lib/ddtrace/contrib/faraday/patcher.rb +2 -38
  639. data/lib/ddtrace/contrib/grape/configuration/settings.rb +7 -0
  640. data/lib/ddtrace/contrib/grape/endpoint.rb +52 -24
  641. data/lib/ddtrace/contrib/grape/ext.rb +1 -0
  642. data/lib/ddtrace/contrib/grape/instrumentation.rb +2 -2
  643. data/lib/ddtrace/contrib/grape/patcher.rb +1 -43
  644. data/lib/ddtrace/contrib/grpc/datadog_interceptor.rb +8 -8
  645. data/lib/ddtrace/contrib/grpc/datadog_interceptor/client.rb +5 -1
  646. data/lib/ddtrace/contrib/grpc/datadog_interceptor/server.rb +5 -0
  647. data/lib/ddtrace/contrib/grpc/patcher.rb +1 -37
  648. data/lib/ddtrace/contrib/http/circuit_breaker.rb +1 -3
  649. data/lib/ddtrace/contrib/http/instrumentation.rb +12 -8
  650. data/lib/ddtrace/contrib/http/patcher.rb +1 -1
  651. data/lib/ddtrace/contrib/httpclient/configuration/settings.rb +32 -0
  652. data/lib/ddtrace/contrib/httpclient/ext.rb +17 -0
  653. data/lib/ddtrace/contrib/httpclient/instrumentation.rb +147 -0
  654. data/lib/ddtrace/contrib/httpclient/integration.rb +43 -0
  655. data/lib/ddtrace/contrib/httpclient/patcher.rb +38 -0
  656. data/lib/ddtrace/contrib/httprb/instrumentation.rb +19 -22
  657. data/lib/ddtrace/contrib/httprb/patcher.rb +6 -3
  658. data/lib/ddtrace/contrib/integration.rb +3 -3
  659. data/lib/ddtrace/contrib/kafka/event.rb +3 -3
  660. data/lib/ddtrace/contrib/mongodb/instrumentation.rb +4 -2
  661. data/lib/ddtrace/contrib/mongodb/patcher.rb +2 -2
  662. data/lib/ddtrace/contrib/mongodb/subscribers.rb +6 -3
  663. data/lib/ddtrace/contrib/mysql2/instrumentation.rb +5 -1
  664. data/lib/ddtrace/contrib/mysql2/patcher.rb +1 -1
  665. data/lib/ddtrace/contrib/patchable.rb +20 -9
  666. data/lib/ddtrace/contrib/patcher.rb +10 -7
  667. data/lib/ddtrace/contrib/presto/instrumentation.rb +4 -1
  668. data/lib/ddtrace/contrib/presto/patcher.rb +6 -3
  669. data/lib/ddtrace/contrib/qless/configuration/settings.rb +35 -0
  670. data/lib/ddtrace/contrib/qless/ext.rb +20 -0
  671. data/lib/ddtrace/contrib/qless/integration.rb +38 -0
  672. data/lib/ddtrace/contrib/qless/patcher.rb +33 -0
  673. data/lib/ddtrace/contrib/qless/qless_job.rb +73 -0
  674. data/lib/ddtrace/contrib/qless/tracer_cleaner.rb +33 -0
  675. data/lib/ddtrace/contrib/que/configuration/settings.rb +1 -0
  676. data/lib/ddtrace/contrib/que/ext.rb +19 -19
  677. data/lib/ddtrace/contrib/que/tracer.rb +3 -2
  678. data/lib/ddtrace/contrib/racecar/event.rb +7 -2
  679. data/lib/ddtrace/contrib/rack/configuration/settings.rb +3 -3
  680. data/lib/ddtrace/contrib/rack/integration.rb +7 -0
  681. data/lib/ddtrace/contrib/rack/middlewares.rb +6 -11
  682. data/lib/ddtrace/contrib/rack/patcher.rb +1 -3
  683. data/lib/ddtrace/contrib/rack/request_queue.rb +6 -1
  684. data/lib/ddtrace/contrib/rails/auto_instrument_railtie.rb +10 -0
  685. data/lib/ddtrace/contrib/rails/patcher.rb +25 -7
  686. data/lib/ddtrace/contrib/rails/utils.rb +4 -0
  687. data/lib/ddtrace/contrib/rake/instrumentation.rb +5 -3
  688. data/lib/ddtrace/contrib/rake/integration.rb +1 -1
  689. data/lib/ddtrace/contrib/rake/patcher.rb +1 -1
  690. data/lib/ddtrace/contrib/redis/configuration/resolver.rb +14 -5
  691. data/lib/ddtrace/contrib/redis/configuration/settings.rb +5 -0
  692. data/lib/ddtrace/contrib/redis/ext.rb +1 -0
  693. data/lib/ddtrace/contrib/redis/patcher.rb +20 -3
  694. data/lib/ddtrace/contrib/redis/quantize.rb +28 -0
  695. data/lib/ddtrace/contrib/redis/tags.rb +9 -1
  696. data/lib/ddtrace/contrib/redis/vendor/LICENSE +20 -0
  697. data/lib/ddtrace/contrib/redis/vendor/resolver.rb +6 -7
  698. data/lib/ddtrace/contrib/registerable.rb +2 -2
  699. data/lib/ddtrace/contrib/registry.rb +2 -2
  700. data/lib/ddtrace/contrib/resque/configuration/settings.rb +18 -1
  701. data/lib/ddtrace/contrib/resque/integration.rb +2 -2
  702. data/lib/ddtrace/contrib/resque/patcher.rb +4 -4
  703. data/lib/ddtrace/contrib/resque/resque_job.rb +25 -2
  704. data/lib/ddtrace/contrib/rest_client/patcher.rb +1 -1
  705. data/lib/ddtrace/contrib/rest_client/request_patch.rb +6 -4
  706. data/lib/ddtrace/contrib/sequel/database.rb +4 -2
  707. data/lib/ddtrace/contrib/sequel/dataset.rb +4 -3
  708. data/lib/ddtrace/contrib/sequel/ext.rb +1 -0
  709. data/lib/ddtrace/contrib/sequel/patcher.rb +2 -2
  710. data/lib/ddtrace/contrib/sequel/utils.rb +15 -5
  711. data/lib/ddtrace/contrib/shoryuken/configuration/settings.rb +2 -0
  712. data/lib/ddtrace/contrib/shoryuken/tracer.rb +8 -2
  713. data/lib/ddtrace/contrib/sidekiq/configuration/settings.rb +1 -0
  714. data/lib/ddtrace/contrib/sidekiq/server_tracer.rb +5 -7
  715. data/lib/ddtrace/contrib/sidekiq/tracing.rb +0 -1
  716. data/lib/ddtrace/contrib/sinatra/env.rb +1 -3
  717. data/lib/ddtrace/contrib/sinatra/headers.rb +1 -3
  718. data/lib/ddtrace/contrib/sinatra/patcher.rb +1 -1
  719. data/lib/ddtrace/contrib/sinatra/tracer.rb +1 -3
  720. data/lib/ddtrace/contrib/sinatra/tracer_middleware.rb +5 -5
  721. data/lib/ddtrace/contrib/sneakers/configuration/settings.rb +1 -0
  722. data/lib/ddtrace/contrib/sneakers/ext.rb +11 -11
  723. data/lib/ddtrace/contrib/sneakers/tracer.rb +16 -21
  724. data/lib/ddtrace/contrib/status_code_matcher.rb +69 -0
  725. data/lib/ddtrace/contrib/sucker_punch/exception_handler.rb +4 -6
  726. data/lib/ddtrace/contrib/sucker_punch/instrumentation.rb +4 -0
  727. data/lib/ddtrace/correlation.rb +1 -0
  728. data/lib/ddtrace/diagnostics/environment_logger.rb +5 -4
  729. data/lib/ddtrace/distributed_tracing/headers/headers.rb +1 -0
  730. data/lib/ddtrace/distributed_tracing/headers/helpers.rb +1 -3
  731. data/lib/ddtrace/error.rb +77 -8
  732. data/lib/ddtrace/ext/distributed.rb +8 -2
  733. data/lib/ddtrace/ext/git.rb +11 -0
  734. data/lib/ddtrace/ext/http.rb +1 -1
  735. data/lib/ddtrace/ext/integration.rb +8 -0
  736. data/lib/ddtrace/ext/profiling.rb +53 -0
  737. data/lib/ddtrace/ext/runtime.rb +5 -1
  738. data/lib/ddtrace/ext/test.rb +8 -0
  739. data/lib/ddtrace/ext/transport.rb +2 -0
  740. data/lib/ddtrace/forced_tracing.rb +2 -0
  741. data/lib/ddtrace/logger.rb +1 -1
  742. data/lib/ddtrace/metrics.rb +42 -9
  743. data/lib/ddtrace/opentelemetry/extensions.rb +1 -1
  744. data/lib/ddtrace/opentracer.rb +20 -39
  745. data/lib/ddtrace/opentracer/distributed_headers.rb +4 -1
  746. data/lib/ddtrace/opentracer/span.rb +2 -6
  747. data/lib/ddtrace/opentracer/thread_local_scope.rb +1 -0
  748. data/lib/ddtrace/patcher.rb +27 -6
  749. data/lib/ddtrace/pin.rb +8 -61
  750. data/lib/ddtrace/pipeline/span_filter.rb +1 -1
  751. data/lib/ddtrace/profiling.rb +107 -0
  752. data/lib/ddtrace/profiling/backtrace_location.rb +32 -0
  753. data/lib/ddtrace/profiling/buffer.rb +41 -0
  754. data/lib/ddtrace/profiling/collectors/stack.rb +262 -0
  755. data/lib/ddtrace/profiling/encoding/profile.rb +37 -0
  756. data/lib/ddtrace/profiling/event.rb +13 -0
  757. data/lib/ddtrace/profiling/events/stack.rb +102 -0
  758. data/lib/ddtrace/profiling/exporter.rb +23 -0
  759. data/lib/ddtrace/profiling/ext/cpu.rb +52 -0
  760. data/lib/ddtrace/profiling/ext/cthread.rb +155 -0
  761. data/lib/ddtrace/profiling/ext/forking.rb +97 -0
  762. data/lib/ddtrace/profiling/flush.rb +43 -0
  763. data/lib/ddtrace/profiling/pprof/builder.rb +119 -0
  764. data/lib/ddtrace/profiling/pprof/converter.rb +89 -0
  765. data/lib/ddtrace/profiling/pprof/message_set.rb +12 -0
  766. data/lib/ddtrace/profiling/pprof/payload.rb +18 -0
  767. data/lib/ddtrace/profiling/pprof/pprof.proto +212 -0
  768. data/lib/ddtrace/profiling/pprof/pprof_pb.rb +81 -0
  769. data/lib/ddtrace/profiling/pprof/stack_sample.rb +106 -0
  770. data/lib/ddtrace/profiling/pprof/string_table.rb +10 -0
  771. data/lib/ddtrace/profiling/pprof/template.rb +118 -0
  772. data/lib/ddtrace/profiling/preload.rb +3 -0
  773. data/lib/ddtrace/profiling/profiler.rb +30 -0
  774. data/lib/ddtrace/profiling/recorder.rb +95 -0
  775. data/lib/ddtrace/profiling/scheduler.rb +116 -0
  776. data/lib/ddtrace/profiling/tasks/setup.rb +77 -0
  777. data/lib/ddtrace/profiling/transport/client.rb +12 -0
  778. data/lib/ddtrace/profiling/transport/http.rb +118 -0
  779. data/lib/ddtrace/profiling/transport/http/api.rb +43 -0
  780. data/lib/ddtrace/profiling/transport/http/api/endpoint.rb +100 -0
  781. data/lib/ddtrace/profiling/transport/http/api/instance.rb +36 -0
  782. data/lib/ddtrace/profiling/transport/http/api/spec.rb +40 -0
  783. data/lib/ddtrace/profiling/transport/http/builder.rb +28 -0
  784. data/lib/ddtrace/profiling/transport/http/client.rb +33 -0
  785. data/lib/ddtrace/profiling/transport/http/response.rb +21 -0
  786. data/lib/ddtrace/profiling/transport/io.rb +30 -0
  787. data/lib/ddtrace/profiling/transport/io/client.rb +27 -0
  788. data/lib/ddtrace/profiling/transport/io/response.rb +16 -0
  789. data/lib/ddtrace/profiling/transport/parcel.rb +17 -0
  790. data/lib/ddtrace/profiling/transport/request.rb +15 -0
  791. data/lib/ddtrace/profiling/transport/response.rb +8 -0
  792. data/lib/ddtrace/propagation/grpc_propagator.rb +19 -6
  793. data/lib/ddtrace/propagation/http_propagator.rb +17 -2
  794. data/lib/ddtrace/quantization/http.rb +1 -0
  795. data/lib/ddtrace/runtime/cgroup.rb +2 -2
  796. data/lib/ddtrace/runtime/container.rb +43 -29
  797. data/lib/ddtrace/runtime/identity.rb +12 -5
  798. data/lib/ddtrace/runtime/metrics.rb +9 -7
  799. data/lib/ddtrace/sampler.rb +3 -3
  800. data/lib/ddtrace/sampling/rate_limiter.rb +65 -16
  801. data/lib/ddtrace/sampling/rule_sampler.rb +4 -9
  802. data/lib/ddtrace/span.rb +154 -29
  803. data/lib/ddtrace/sync_writer.rb +14 -13
  804. data/lib/ddtrace/tasks/exec.rb +48 -0
  805. data/lib/ddtrace/tasks/help.rb +14 -0
  806. data/lib/ddtrace/tracer.rb +68 -50
  807. data/lib/ddtrace/transport/http.rb +41 -31
  808. data/lib/ddtrace/transport/http/adapters/net.rb +34 -9
  809. data/lib/ddtrace/transport/http/adapters/registry.rb +1 -0
  810. data/lib/ddtrace/transport/http/adapters/unix_socket.rb +2 -4
  811. data/lib/ddtrace/transport/http/builder.rb +7 -1
  812. data/lib/ddtrace/transport/http/env.rb +8 -0
  813. data/lib/ddtrace/transport/http/statistics.rb +16 -3
  814. data/lib/ddtrace/transport/http/traces.rb +5 -6
  815. data/lib/ddtrace/transport/io.rb +1 -1
  816. data/lib/ddtrace/transport/io/client.rb +15 -8
  817. data/lib/ddtrace/transport/io/response.rb +1 -3
  818. data/lib/ddtrace/transport/io/traces.rb +7 -1
  819. data/lib/ddtrace/transport/parcel.rb +4 -0
  820. data/lib/ddtrace/transport/traces.rb +25 -3
  821. data/lib/ddtrace/utils.rb +16 -13
  822. data/lib/ddtrace/utils/compression.rb +27 -0
  823. data/lib/ddtrace/utils/forking.rb +52 -0
  824. data/lib/ddtrace/utils/object_set.rb +39 -0
  825. data/lib/ddtrace/utils/only_once.rb +40 -0
  826. data/lib/ddtrace/utils/sequence.rb +17 -0
  827. data/lib/ddtrace/utils/string_table.rb +45 -0
  828. data/lib/ddtrace/utils/time.rb +32 -3
  829. data/lib/ddtrace/vendor/active_record/MIT-LICENSE +20 -0
  830. data/lib/ddtrace/vendor/multipart-post/LICENSE +11 -0
  831. data/lib/ddtrace/vendor/multipart-post/multipart.rb +12 -0
  832. data/lib/ddtrace/vendor/multipart-post/multipart/post.rb +8 -0
  833. data/lib/ddtrace/vendor/multipart-post/multipart/post/composite_read_io.rb +116 -0
  834. data/lib/ddtrace/vendor/multipart-post/multipart/post/multipartable.rb +57 -0
  835. data/lib/ddtrace/vendor/multipart-post/multipart/post/parts.rb +135 -0
  836. data/lib/ddtrace/vendor/multipart-post/multipart/post/version.rb +9 -0
  837. data/lib/ddtrace/vendor/multipart-post/net/http/post/multipart.rb +32 -0
  838. data/lib/ddtrace/version.rb +14 -2
  839. data/lib/ddtrace/workers.rb +6 -1
  840. data/lib/ddtrace/workers/async.rb +13 -4
  841. data/lib/ddtrace/workers/loop.rb +31 -5
  842. data/lib/ddtrace/workers/polling.rb +12 -5
  843. data/lib/ddtrace/workers/queue.rb +2 -1
  844. data/lib/ddtrace/workers/runtime_metrics.rb +21 -4
  845. data/lib/ddtrace/workers/trace_writer.rb +11 -14
  846. data/lib/ddtrace/writer.rb +30 -6
  847. metadata +642 -338
  848. data/lib/ddtrace/augmentation.rb +0 -13
  849. data/lib/ddtrace/augmentation/method_wrapper.rb +0 -20
  850. data/lib/ddtrace/augmentation/method_wrapping.rb +0 -38
  851. data/lib/ddtrace/augmentation/shim.rb +0 -102
  852. data/lib/ddtrace/monkey.rb +0 -58
@@ -114,6 +114,34 @@ Because you are likely not running all tests locally, your report will contain p
114
114
  You *must* check the CI step `coverage` for the complete test coverage report, ensuring coverage is not
115
115
  decreased.
116
116
 
117
+ **Ensuring tests don't leak resources**
118
+
119
+ Tests execution can create resources that are hard to track: threads, sockets, files, etc. Because these resources can come
120
+ from the both the test setup as well as the code under test, making sure all resources are properly disposed is important
121
+ to prevent the application from inadvertently creating cumulative resources during its execution.
122
+
123
+ When running tests that utilize threads, you might see an error message similar to this one:
124
+
125
+ ```
126
+ Test leaked 1 thread: "Datadog::Workers::AsyncTransport integration tests"
127
+ Ensure all threads are terminated when test finishes:
128
+ 1: #<Thread:0x00007fcbc99863d0 /Users/marco.costa/work/dd-trace-rb/spec/spec_helper.rb:145 sleep> (Thread)
129
+ Thread Creation Site:
130
+ ./dd-trace-rb/spec/ddtrace/workers_integration_spec.rb:245:in 'new'
131
+ ./dd-trace-rb/spec/ddtrace/workers_integration_spec.rb:245:in 'block (4 levels) in <top (required)>'
132
+ Thread Backtrace:
133
+ ./dd-trace-rb/spec/ddtrace/workers_integration_spec.rb:262:in 'sleep'
134
+ .dd-trace-rb/spec/ddtrace/workers_integration_spec.rb:262:in 'block (5 levels) in <top (required)>'
135
+ ./dd-trace-rb/spec/spec_helper.rb:147:in 'block in initialize'
136
+ ```
137
+
138
+ This means that this test did not finish all threads by the time the test had finished. In this case, the thread
139
+ creation can be traced to `workers_integration_spec.rb:245:in 'new'`. The thread itself is sleeping at `workers_integration_spec.rb:262:in 'sleep'`.
140
+
141
+ The actionable in this case would be to ensure that the thread created in `workers_integration_spec.rb:245` is properly terminated by invoking `Thread#join` during the test tear down, which will wait for the thread to finish before returning.
142
+
143
+ Depending on the situation, the thread in question might need to be forced to terminate. It's recommended to have a mechanism in place to terminate it (a shared variable that changes value when the thread should exit), but as a last resort, `Thread#terminate` forces the thread to finish. Keep in mind that regardless of the termination method, `Thread#join` must be called to ensure that the thread has completely finished its shutdown process.
144
+
117
145
  ### Checking code quality
118
146
 
119
147
  **Linting**
@@ -124,6 +152,16 @@ The trace library uses Rubocop to enforce [code style](https://github.com/bbatso
124
152
  $ bundle exec rake rubocop
125
153
  ```
126
154
 
155
+ ### Running benchmarks
156
+
157
+ If your changes can have a measurable performance impact, we recommend running our benchmark suite:
158
+
159
+ ```
160
+ $ bundle exec rake spec:benchmark
161
+ ```
162
+
163
+ Results are printed to STDOUT as well as written to the `./tmp/benchmark/` directory.
164
+
127
165
  ## Appendix
128
166
 
129
167
  ### Writing new integrations
@@ -141,9 +179,9 @@ To get started quickly, it's perfectly fine to copy-paste an existing integratio
141
179
 
142
180
  Once you have it working in your application, you can [add unit tests](#writing-tests), [run them locally](#running-tests), and [check for code quality](#checking-code-quality) using Docker Compose.
143
181
 
144
- Then [open a pull request](https://github.com/DataDog/dd-trace-rb/CONTRIBUTING.md#have-a-patch) and be sure to add the following to the description:
182
+ Then [open a pull request](../CONTRIBUTING.md#have-a-patch) and be sure to add the following to the description:
145
183
 
146
- - [Documentation](https://github.com/DataDog/dd-trace-rb/docs/GettingStarted.md) for the integration, including versions supported.
184
+ - [Documentation](./GettingStarted.md) for the integration, including versions supported.
147
185
  - Links to the repository/website of the library being integrated
148
186
  - Screenshots showing a sample trace
149
187
  - Any additional code snippets, sample apps, benchmarks, or other resources that demonstrate its implementation are a huge plus!
@@ -34,6 +34,7 @@ To contribute, check out the [contribution guidelines][contribution docs] and [d
34
34
  - [Active Support](#active-support)
35
35
  - [AWS](#aws)
36
36
  - [Concurrent Ruby](#concurrent-ruby)
37
+ - [Cucumber](#cucumber)
37
38
  - [Dalli](#dalli)
38
39
  - [DelayedJob](#delayedjob)
39
40
  - [Elasticsearch](#elasticsearch)
@@ -44,10 +45,13 @@ To contribute, check out the [contribution guidelines][contribution docs] and [d
44
45
  - [GraphQL](#graphql)
45
46
  - [gRPC](#grpc)
46
47
  - [http.rb](#http-rb)
48
+ - [httpclient](#httpclient)
49
+ - [httpx](#httpx)
47
50
  - [MongoDB](#mongodb)
48
51
  - [MySQL2](#mysql2)
49
52
  - [Net/HTTP](#net-http)
50
53
  - [Presto](#presto)
54
+ - [Qless](#qless)
51
55
  - [Que](#que)
52
56
  - [Racecar](#racecar)
53
57
  - [Rack](#rack)
@@ -56,6 +60,7 @@ To contribute, check out the [contribution guidelines][contribution docs] and [d
56
60
  - [Redis](#redis)
57
61
  - [Rest Client](#rest-client)
58
62
  - [Resque](#resque)
63
+ - [RSpec](#rspec)
59
64
  - [Shoryuken](#shoryuken)
60
65
  - [Sequel](#sequel)
61
66
  - [Sidekiq](#sidekiq)
@@ -66,7 +71,9 @@ To contribute, check out the [contribution guidelines][contribution docs] and [d
66
71
  - [Tracer settings](#tracer-settings)
67
72
  - [Custom logging](#custom-logging)
68
73
  - [Environment and tags](#environment-and-tags)
74
+ - [Environment variables](#environment-variables)
69
75
  - [Sampling](#sampling)
76
+ - [Application-side sampling](#application-side-sampling)
70
77
  - [Priority sampling](#priority-sampling)
71
78
  - [Distributed tracing](#distributed-tracing)
72
79
  - [HTTP request queuing](#http-request-queuing)
@@ -78,6 +85,7 @@ To contribute, check out the [contribution guidelines][contribution docs] and [d
78
85
  - [Metrics](#metrics)
79
86
  - [For application runtime](#for-application-runtime)
80
87
  - [OpenTracing](#opentracing)
88
+ - [Profiling](#profiling)
81
89
 
82
90
  ## Compatibility
83
91
 
@@ -85,14 +93,15 @@ To contribute, check out the [contribution guidelines][contribution docs] and [d
85
93
 
86
94
  | Type | Documentation | Version | Support type | Gem version support |
87
95
  | ----- | -------------------------- | ----- | ------------------------------------ | ------------------- |
88
- | MRI | https://www.ruby-lang.org/ | 2.7 | Full | Latest |
96
+ | MRI | https://www.ruby-lang.org/ | 3.0 | Full | Latest |
97
+ | | | 2.7 | Full | Latest |
89
98
  | | | 2.6 | Full | Latest |
90
99
  | | | 2.5 | Full | Latest |
91
100
  | | | 2.4 | Full | Latest |
92
101
  | | | 2.3 | Full | Latest |
93
102
  | | | 2.2 | Full | Latest |
94
103
  | | | 2.1 | Full | Latest |
95
- | | | 2.0 | Full | Latest |
104
+ | | | 2.0 | EOL since June 7th, 2021 | < 0.50.0 |
96
105
  | | | 1.9.3 | EOL since August 6th, 2020 | < 0.27.0 |
97
106
  | | | 1.9.1 | EOL since August 6th, 2020 | < 0.27.0 |
98
107
  | JRuby | https://www.jruby.org | 9.2 | Full | Latest |
@@ -123,14 +132,38 @@ To contribute, check out the [contribution guidelines][contribution docs] and [d
123
132
 
124
133
  The following steps will help you quickly start tracing your Ruby application.
125
134
 
126
- ### Setup the Datadog Agent
135
+ ### Configure the Datadog Agent for APM
127
136
 
128
137
  Before downloading tracing on your application, install the Datadog Agent. The Ruby APM tracer sends trace data through the Datadog Agent.
129
138
 
130
- [Install and configure the Datadog Agent](https://docs.datadoghq.com/tracing/setup), see additional documentation for [tracing Docker applications](https://docs.datadoghq.com/tracing/setup/docker/).
139
+ Install and configure the Datadog Agent to receive traces from your now instrumented application. By default the Datadog Agent is enabled in your `datadog.yaml` file under `apm_enabled: true` and listens for trace traffic at `localhost:8126`. For containerized environments, follow the steps below to enable trace collection within the Datadog Agent.
140
+
141
+ #### Containers
142
+
143
+ 1. Set `apm_non_local_traffic: true` in your main [`datadog.yaml` configuration file](https://docs.datadoghq.com/agent/guide/agent-configuration-files/#agent-main-configuration-file).
144
+
145
+ 2. See the specific setup instructions for [Docker](https://docs.datadoghq.com/agent/docker/apm/?tab=ruby), [Kubernetes](https://docs.datadoghq.com/agent/kubernetes/apm/?tab=helm), [Amazon ECS](https://docs.datadoghq.com/agent/amazon_ecs/apm/?tab=ruby) or [Fargate](https://docs.datadoghq.com/integrations/ecs_fargate/#trace-collection) to ensure that the Agent is configured to receive traces in a containerized environment:
146
+
147
+ 3. After having instrumented your application, the tracing client sends traces to `localhost:8126` by default. If this is not the correct host and port change it by setting the env variables `DD_AGENT_HOST` and `DD_TRACE_AGENT_PORT`.
148
+
131
149
 
132
150
  ### Quickstart for Rails applications
133
151
 
152
+ #### Automatic instrumentation
153
+
154
+ 1. Add the `ddtrace` gem to your Gemfile:
155
+
156
+ ```ruby
157
+ source 'https://rubygems.org'
158
+ gem 'ddtrace', require: 'ddtrace/auto_instrument'
159
+ ```
160
+
161
+ 2. Install the gem with `bundle install`
162
+
163
+ 3. You can configure, override, or disable any specific integration settings by also adding a [Rails Manual Configuration](#rails-manual-configuration) file.
164
+
165
+ #### Manual instrumentation
166
+
134
167
  1. Add the `ddtrace` gem to your Gemfile:
135
168
 
136
169
  ```ruby
@@ -152,6 +185,25 @@ Before downloading tracing on your application, install the Datadog Agent. The R
152
185
 
153
186
  ### Quickstart for Ruby applications
154
187
 
188
+ #### Automatic instrumentation
189
+
190
+ 1. Install the gem with `gem install ddtrace`
191
+ 2. Requiring any [supported libraries or frameworks](#integration-instrumentation) that should be instrumented.
192
+ 3. Add `require 'ddtrace/auto_instrument'` to your application. _Note:_ This must be done _after_ requiring any supported libraries or frameworks.
193
+
194
+ ```ruby
195
+ # Example frameworks and libraries
196
+ require 'sinatra'
197
+ require 'faraday'
198
+ require 'redis'
199
+
200
+ require 'ddtrace/auto_instrument'
201
+ ```
202
+
203
+ You can configure, override, or disable any specific integration settings by also adding a [Ruby Manual Configuration Block](#ruby-manual-configuration).
204
+
205
+ #### Manual instrumentation
206
+
155
207
  1. Install the gem with `gem install ddtrace`
156
208
  2. Add a configuration block to your Ruby application:
157
209
 
@@ -226,7 +278,7 @@ And `options` is an optional `Hash` that accepts the following parameters:
226
278
  | `resource` | `String` | Name of the resource or action being operated on. Traces with the same resource value will be grouped together for the purpose of metrics (but still independently viewable.) Usually domain specific, such as a URL, query, request, etc. (e.g. `'Article#submit'`, `http://example.com/articles/list`.) | `name` of Span. |
227
279
  | `span_type` | `String` | The type of the span (such as `'http'`, `'db'`, etc.) | `nil` |
228
280
  | `child_of` | `Datadog::Span` / `Datadog::Context` | Parent for this span. If not provided, will automatically become current active span. | `nil` |
229
- | `start_time` | `Integer` | When the span actually starts. Useful when tracing events that have already happened. | `Time.now.utc` |
281
+ | `start_time` | `Time` | When the span actually starts. Useful when tracing events that have already happened. | `Time.now` |
230
282
  | `tags` | `Hash` | Extra tags which should be added to the span. | `{}` |
231
283
  | `on_error` | `Proc` | Handler invoked when a block is provided to trace, and it raises an error. Provided `span` and `error` as arguments. Sets error on the span by default. | `proc { |span, error| span.set_error(error) unless span.nil? }` |
232
284
 
@@ -338,6 +390,7 @@ For a list of available integrations, and their configuration options, please re
338
390
  | Active Support | `active_support` | `>= 3.0` | `>= 3.0` | *[Link](#active-support)* | *[Link](https://github.com/rails/rails/tree/master/activesupport)* |
339
391
  | AWS | `aws` | `>= 2.0` | `>= 2.0` | *[Link](#aws)* | *[Link](https://github.com/aws/aws-sdk-ruby)* |
340
392
  | Concurrent Ruby | `concurrent_ruby` | `>= 0.9` | `>= 0.9` | *[Link](#concurrent-ruby)* | *[Link](https://github.com/ruby-concurrency/concurrent-ruby)* |
393
+ | Cucumber | `cucumber` | `>= 3.0` | `>= 1.7.16` | *[Link](#cucumber)* | *[Link](https://github.com/cucumber/cucumber-ruby)* |
341
394
  | Dalli | `dalli` | `>= 2.0` | `>= 2.0` | *[Link](#dalli)* | *[Link](https://github.com/petergoldstein/dalli)* |
342
395
  | DelayedJob | `delayed_job` | `>= 4.1` | `>= 4.1` | *[Link](#delayedjob)* | *[Link](https://github.com/collectiveidea/delayed_job)* |
343
396
  | Elasticsearch | `elasticsearch` | `>= 1.0` | `>= 1.0` | *[Link](#elasticsearch)* | *[Link](https://github.com/elastic/elasticsearch-ruby)* |
@@ -348,19 +401,24 @@ For a list of available integrations, and their configuration options, please re
348
401
  | GraphQL | `graphql` | `>= 1.7.9` | `>= 1.7.9` | *[Link](#graphql)* | *[Link](https://github.com/rmosolgo/graphql-ruby)* |
349
402
  | gRPC | `grpc` | `>= 1.7` | *gem not available* | *[Link](#grpc)* | *[Link](https://github.com/grpc/grpc/tree/master/src/rubyc)* |
350
403
  | http.rb | `httprb` | `>= 2.0` | `>= 2.0` | *[Link](#http-rb)* | *[Link](https://github.com/httprb/http)* |
404
+ | httpclient | `httpclient` | `>= 2.2` | `>= 2.2` | *[Link](#httpclient)* | *[Link](https://github.com/nahi/httpclient)* |
405
+ | httpx | `httpx` | `>= 0.11` | `>= 0.11` | *[Link](#httpx)* | *[Link](https://gitlab.com/honeyryderchuck/httpx)* |
351
406
  | Kafka | `ruby-kafka` | `>= 0.7.10` | `>= 0.7.10` | *[Link](#kafka)* | *[Link](https://github.com/zendesk/ruby-kafka)* |
407
+ | Makara (through Active Record) | `makara` | `>= 0.3.5` | `>= 0.3.5` | *[Link](#active-record)* | *[Link](https://github.com/instacart/makara)* |
352
408
  | MongoDB | `mongo` | `>= 2.1` | `>= 2.1` | *[Link](#mongodb)* | *[Link](https://github.com/mongodb/mongo-ruby-driver)* |
353
409
  | MySQL2 | `mysql2` | `>= 0.3.21` | *gem not available* | *[Link](#mysql2)* | *[Link](https://github.com/brianmario/mysql2)* |
354
410
  | Net/HTTP | `http` | *(Any supported Ruby)* | *(Any supported Ruby)* | *[Link](#nethttp)* | *[Link](https://ruby-doc.org/stdlib-2.4.0/libdoc/net/http/rdoc/Net/HTTP.html)* |
355
411
  | Presto | `presto` | `>= 0.5.14` | `>= 0.5.14` | *[Link](#presto)* | *[Link](https://github.com/treasure-data/presto-client-ruby)* |
412
+ | Qless | `qless` | `>= 0.10.0` | `>= 0.10.0` | *[Link](#qless)* | *[Link](https://github.com/seomoz/qless)* |
356
413
  | Que | `que` | `>= 1.0.0.beta2` | `>= 1.0.0.beta2` | *[Link](#que)* | *[Link](https://github.com/que-rb/que)* |
357
414
  | Racecar | `racecar` | `>= 0.3.5` | `>= 0.3.5` | *[Link](#racecar)* | *[Link](https://github.com/zendesk/racecar)* |
358
415
  | Rack | `rack` | `>= 1.1` | `>= 1.1` | *[Link](#rack)* | *[Link](https://github.com/rack/rack)* |
359
416
  | Rails | `rails` | `>= 3.0` | `>= 3.0` | *[Link](#rails)* | *[Link](https://github.com/rails/rails)* |
360
417
  | Rake | `rake` | `>= 12.0` | `>= 12.0` | *[Link](#rake)* | *[Link](https://github.com/ruby/rake)* |
361
418
  | Redis | `redis` | `>= 3.2` | `>= 3.2` | *[Link](#redis)* | *[Link](https://github.com/redis/redis-rb)* |
362
- | Resque | `resque` | `>= 1.0, < 2.0` | `>= 1.0, < 2.0` | *[Link](#resque)* | *[Link](https://github.com/resque/resque)* |
419
+ | Resque | `resque` | `>= 1.0` | `>= 1.0` | *[Link](#resque)* | *[Link](https://github.com/resque/resque)* |
363
420
  | Rest Client | `rest-client` | `>= 1.8` | `>= 1.8` | *[Link](#rest-client)* | *[Link](https://github.com/rest-client/rest-client)* |
421
+ | RSpec | `rspec`. | `>= 3.0.0` | `>= 3.0.0` | *[Link](#rspec)*. | *[Link](https://github.com/rspec/rspec)* |
364
422
  | Sequel | `sequel` | `>= 3.41` | `>= 3.41` | *[Link](#sequel)* | *[Link](https://github.com/jeremyevans/sequel)* |
365
423
  | Shoryuken | `shoryuken` | `>= 3.2` | `>= 3.2` | *[Link](#shoryuken)* | *[Link](https://github.com/phstc/shoryuken)* |
366
424
  | Sidekiq | `sidekiq` | `>= 3.5.4` | `>= 3.5.4` | *[Link](#sidekiq)* | *[Link](https://github.com/mperham/sidekiq)* |
@@ -386,7 +444,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
386
444
 
387
445
  | Key | Description | Default |
388
446
  | --- | ----------- | ------- |
389
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
390
447
  | `service_name` | Service name used for `action_cable` instrumentation | `'action_cable'` |
391
448
 
392
449
  ### Action View
@@ -406,7 +463,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
406
463
 
407
464
  | Key | Description | Default |
408
465
  | ---| --- | --- |
409
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
410
466
  | `service_name` | Service name used for rendering instrumentation. | `action_view` |
411
467
  | `template_base_path` | Used when the template name is parsed. If you don't store your templates in the `views/` folder, you may need to change this value | `'views/'` |
412
468
 
@@ -428,7 +484,6 @@ ActiveModelSerializers::SerializableResource.new(test_obj).serializable_hash
428
484
 
429
485
  | Key | Description | Default |
430
486
  | --- | ----------- | ------- |
431
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
432
487
  | `service_name` | Service name used for `active_model_serializers` instrumentation. | `'active_model_serializers'` |
433
488
 
434
489
  ### Action Pack
@@ -448,7 +503,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
448
503
 
449
504
  | Key | Description | Default |
450
505
  | ---| --- | --- |
451
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
452
506
  | `service_name` | Service name used for rendering instrumentation. | `action_pack` |
453
507
 
454
508
  ### Active Record
@@ -476,7 +530,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
476
530
 
477
531
  | Key | Description | Default |
478
532
  | ---| --- | --- |
479
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to the global setting, `false` for off. | `false` |
480
533
  | `orm_service_name` | Service name used for the mapping portion of query results to ActiveRecord objects. Inherits service name from parent by default. | _parent.service_name_ (e.g. `'mysql2'`) |
481
534
  | `service_name` | Service name used for database portion of `active_record` instrumentation. | Name of database adapter (e.g. `'mysql2'`) |
482
535
 
@@ -495,16 +548,19 @@ Datadog.configure do |c|
495
548
  # Only available if you are using Rails with ActiveRecord.
496
549
  c.use :active_record, describes: :secondary_database, service_name: 'secondary-db'
497
550
 
551
+ # Block configuration pattern.
498
552
  c.use :active_record, describes: :secondary_database do |second_db|
499
553
  second_db.service_name = 'secondary-db'
500
554
  end
501
555
 
502
556
  # Connection string with the following connection settings:
503
- # Adapter, user, host, port, database
557
+ # adapter, username, host, port, database
558
+ # Other fields are ignored.
504
559
  c.use :active_record, describes: 'mysql2://root@127.0.0.1:3306/mysql', service_name: 'secondary-db'
505
560
 
506
- # Hash with following connection settings
507
- # Adapter, user, host, port, database
561
+ # Hash with following connection settings:
562
+ # adapter, username, host, port, database
563
+ # Other fields are ignored.
508
564
  c.use :active_record, describes: {
509
565
  adapter: 'mysql2',
510
566
  host: '127.0.0.1',
@@ -513,9 +569,34 @@ Datadog.configure do |c|
513
569
  username: 'root'
514
570
  },
515
571
  service_name: 'secondary-db'
572
+
573
+ # If using the `makara` gem, it's possible to match on connection `role`:
574
+ c.use :active_record, describes: { makara_role: 'primary' }, service_name: 'primary-db'
575
+ c.use :active_record, describes: { makara_role: 'replica' }, service_name: 'secondary-db'
576
+ end
577
+ ```
578
+
579
+ You can also create configurations based on partial matching of database connection fields:
580
+
581
+ ```ruby
582
+ Datadog.configure do |c|
583
+ # Matches any connection on host `127.0.0.1`.
584
+ c.use :active_record, describes: { host: '127.0.0.1' }, service_name: 'local-db'
585
+
586
+ # Matches any `mysql2` connection.
587
+ c.use :active_record, describes: { adapter: 'mysql2'}, service_name: 'mysql-db'
588
+
589
+ # Matches any `mysql2` connection to the `reports` database.
590
+ #
591
+ # In case of multiple matching `describe` configurations, the latest one applies.
592
+ # In this case a connection with both adapter `mysql` and database `reports`
593
+ # will be configured `service_name: 'reports-db'`, not `service_name: 'mysql-db'`.
594
+ c.use :active_record, describes: { adapter: 'mysql2', database: 'reports'}, service_name: 'reports-db'
516
595
  end
517
596
  ```
518
597
 
598
+ When multiple `describes` configurations match a connection, the latest configured rule that matches will be applied.
599
+
519
600
  If ActiveRecord traces an event that uses a connection that matches a key defined by `describes`, it will use the trace settings assigned to that connection. If the connection does not match any of the described connections, it will use default settings defined by `c.use :active_record` instead.
520
601
 
521
602
  ### Active Support
@@ -538,7 +619,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
538
619
 
539
620
  | Key | Description | Default |
540
621
  | ---| --- | --- |
541
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
542
622
  | `cache_service` | Service name used for caching with `active_support` instrumentation. | `active_support-cache` |
543
623
 
544
624
  ### AWS
@@ -561,7 +641,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
561
641
 
562
642
  | Key | Description | Default |
563
643
  | --- | ----------- | ------- |
564
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
565
644
  | `service_name` | Service name used for `aws` instrumentation | `'aws'` |
566
645
 
567
646
  ### Concurrent Ruby
@@ -590,6 +669,41 @@ Where `options` is an optional `Hash` that accepts the following parameters:
590
669
  | --- | ----------- | ------- |
591
670
  | `service_name` | Service name used for `concurrent-ruby` instrumentation | `'concurrent-ruby'` |
592
671
 
672
+ ### Cucumber
673
+
674
+ Cucumber integration will trace all executions of scenarios and steps when using `cucumber` framework.
675
+
676
+ To activate your integration, use the `Datadog.configure` method:
677
+
678
+ ```ruby
679
+ require 'cucumber'
680
+ require 'ddtrace'
681
+
682
+ # Configure default Cucumber integration
683
+ Datadog.configure do |c|
684
+ c.use :cucumber, options
685
+ end
686
+
687
+ # Example of how to attach tags from scenario to active span
688
+ Around do |scenario, block|
689
+ active_span = Datadog.configuration[:cucumber][:tracer].active_span
690
+ unless active_span.nil?
691
+ scenario.tags.filter { |tag| tag.include? ':' }.each do |tag|
692
+ active_span.set_tag(*tag.name.split(':', 2))
693
+ end
694
+ end
695
+ block.call
696
+ end
697
+ ```
698
+
699
+ Where `options` is an optional `Hash` that accepts the following parameters:
700
+
701
+ | Key | Description | Default |
702
+ | --- | ----------- | ------- |
703
+ | `enabled` | Defines whether Cucumber tests should be traced. Useful for temporarily disabling tracing. `true` or `false` | `true` |
704
+ | `service_name` | Service name used for `cucumber` instrumentation. | `'cucumber'` |
705
+ | `operation_name` | Operation name used for `cucumber` instrumentation. Useful if you want rename automatic trace metrics e.g. `trace.#{operation_name}.errors`. | `'cucumber.test'` |
706
+
593
707
  ### Dalli
594
708
 
595
709
  Dalli integration will trace all calls to your `memcached` server:
@@ -612,12 +726,11 @@ Where `options` is an optional `Hash` that accepts the following parameters:
612
726
 
613
727
  | Key | Description | Default |
614
728
  | --- | ----------- | ------- |
615
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
616
729
  | `service_name` | Service name used for `dalli` instrumentation | `'memcached'` |
617
730
 
618
731
  ### DelayedJob
619
732
 
620
- The DelayedJob integration uses lifecycle hooks to trace the job executions.
733
+ The DelayedJob integration uses lifecycle hooks to trace the job executions and enqueues.
621
734
 
622
735
  You can enable it through `Datadog.configure`:
623
736
 
@@ -633,8 +746,9 @@ Where `options` is an optional `Hash` that accepts the following parameters:
633
746
 
634
747
  | Key | Description | Default |
635
748
  | --- | ----------- | ------- |
636
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
637
749
  | `service_name` | Service name used for `DelayedJob` instrumentation | `'delayed_job'` |
750
+ | `client_service_name` | Service name used for client-side `DelayedJob` instrumentation | `'delayed_job-client'` |
751
+ | `error_handler` | Custom error handler invoked when a job raises an error. Provided `span` and `error` as arguments. Sets error on the span by default. Useful for ignoring transient errors. | `proc { |span, error| span.set_error(error) unless span.nil? }` |
638
752
 
639
753
  ### Elasticsearch
640
754
 
@@ -657,7 +771,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
657
771
 
658
772
  | Key | Description | Default |
659
773
  | --- | ----------- | ------- |
660
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
661
774
  | `quantize` | Hash containing options for quantization. May include `:show` with an Array of keys to not quantize (or `:all` to skip quantization), or `:exclude` with Array of keys to exclude entirely. | `{}` |
662
775
  | `service_name` | Service name used for `elasticsearch` instrumentation | `'elasticsearch'` |
663
776
 
@@ -683,7 +796,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
683
796
 
684
797
  | Key | Description | Default |
685
798
  | --- | ----------- | ------- |
686
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
687
799
  | `distributed_tracing` | Enables [distributed tracing](#distributed-tracing) | `true` |
688
800
  | `service_name` | Service name for `ethon` instrumentation. | `'ethon'` |
689
801
  | `split_by_domain` | Uses the request domain as the service name when set to `true`. | `false` |
@@ -715,7 +827,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
715
827
 
716
828
  | Key | Description | Default |
717
829
  | --- | ----------- | ------- |
718
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
719
830
  | `distributed_tracing` | Enables [distributed tracing](#distributed-tracing) | `true` |
720
831
  | `error_handler` | A `Proc` that accepts a `response` parameter. If it evaluates to a *truthy* value, the trace span is marked as an error. By default only sets 5XX responses as errors. | `nil` |
721
832
  | `service_name` | Service name for Excon instrumentation. When provided to middleware for a specific connection, it applies only to that connection object. | `'excon'` |
@@ -778,7 +889,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
778
889
 
779
890
  | Key | Description | Default |
780
891
  | --- | ----------- | ------- |
781
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
782
892
  | `distributed_tracing` | Enables [distributed tracing](#distributed-tracing) | `true` |
783
893
  | `error_handler` | A `Proc` that accepts a `response` parameter. If it evaluates to a *truthy* value, the trace span is marked as an error. By default only sets 5XX responses as errors. | `nil` |
784
894
  | `service_name` | Service name for Faraday instrumentation. When provided to middleware for a specific connection, it applies only to that connection object. | `'faraday'` |
@@ -812,9 +922,9 @@ Where `options` is an optional `Hash` that accepts the following parameters:
812
922
 
813
923
  | Key | Description | Default |
814
924
  | --- | ----------- | ------- |
815
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `nil` |
816
925
  | `enabled` | Defines whether Grape should be traced. Useful for temporarily disabling tracing. `true` or `false` | `true` |
817
926
  | `service_name` | Service name used for `grape` instrumentation | `'grape'` |
927
+ | `error_statuses`| Defines a status code or range of status codes which should be marked as errors. `'404,405,500-599'` or `[404,405,'500-599']` | `nil` |
818
928
 
819
929
  ### GraphQL
820
930
 
@@ -836,7 +946,6 @@ The `use :graphql` method accepts the following parameters. Additional options c
836
946
 
837
947
  | Key | Description | Default |
838
948
  | --- | ----------- | ------- |
839
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `nil` |
840
949
  | `service_name` | Service name used for `graphql` instrumentation | `'ruby-graphql'` |
841
950
  | `schemas` | Required. Array of `GraphQL::Schema` objects which to trace. Tracing will be added to all the schemas listed, using the options provided to this configuration. If you do not provide any, then tracing will not be activated. | `[]` |
842
951
 
@@ -915,7 +1024,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
915
1024
 
916
1025
  | Key | Description | Default |
917
1026
  | --- | ----------- | ------- |
918
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
919
1027
  | `service_name` | Service name used for `grpc` instrumentation | `'grpc'` |
920
1028
 
921
1029
  **Configuring clients to use different settings**
@@ -957,11 +1065,54 @@ Where `options` is an optional `Hash` that accepts the following parameters:
957
1065
 
958
1066
  | Key | Description | Default |
959
1067
  | --- | ----------- | ------- |
960
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
961
1068
  | `distributed_tracing` | Enables [distributed tracing](#distributed-tracing) | `true` |
962
1069
  | `service_name` | Service name for `httprb` instrumentation. | `'httprb'` |
963
1070
  | `split_by_domain` | Uses the request domain as the service name when set to `true`. | `false` |
964
1071
 
1072
+ ### httpclient
1073
+
1074
+ The httpclient integration will trace any HTTP call using the httpclient gem.
1075
+
1076
+ ```ruby
1077
+ require 'httpclient'
1078
+ require 'ddtrace'
1079
+ Datadog.configure do |c|
1080
+ c.use :httpclient, options
1081
+ # optionally, specify a different service name for hostnames matching a regex
1082
+ c.use :httpclient, describes: /user-[^.]+\.example\.com/ do |httpclient|
1083
+ httpclient.service_name = 'user.example.com'
1084
+ httpclient.split_by_domain = false # Only necessary if split_by_domain is true by default
1085
+ end
1086
+ end
1087
+ ```
1088
+
1089
+ Where `options` is an optional `Hash` that accepts the following parameters:
1090
+
1091
+ | Key | Description | Default |
1092
+ | --- | ----------- | ------- |
1093
+ | `distributed_tracing` | Enables [distributed tracing](#distributed-tracing) | `true` |
1094
+ | `service_name` | Service name for `httpclient` instrumentation. | `'httpclient'` |
1095
+ | `split_by_domain` | Uses the request domain as the service name when set to `true`. | `false` |
1096
+
1097
+ ### httpx
1098
+
1099
+ `httpx` maintains its [own integration with `ddtrace`](https://honeyryderchuck.gitlab.io/httpx/wiki/Datadog-Adapter):
1100
+
1101
+ ```ruby
1102
+ require "ddtrace"
1103
+ require "httpx/adapters/datadog"
1104
+
1105
+ Datadog.configure do |c|
1106
+ c.use :httpx
1107
+
1108
+ # optionally, specify a different service name for hostnames matching a regex
1109
+ c.use :httpx, describes: /user-[^.]+\.example\.com/ do |http|
1110
+ http.service_name = 'user.example.com'
1111
+ http.split_by_domain = false # Only necessary if split_by_domain is true by default
1112
+ end
1113
+ end
1114
+ ```
1115
+
965
1116
  ### Kafka
966
1117
 
967
1118
  The Kafka integration provides tracing of the `ruby-kafka` gem:
@@ -982,7 +1133,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
982
1133
 
983
1134
  | Key | Description | Default |
984
1135
  | --- | ----------- | ------- |
985
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
986
1136
  | `service_name` | Service name used for `kafka` instrumentation | `'kafka'` |
987
1137
  | `tracer` | `Datadog::Tracer` used to perform instrumentation. Usually you don't need to set this. | `Datadog.tracer` |
988
1138
 
@@ -1011,7 +1161,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1011
1161
 
1012
1162
  | Key | Description | Default |
1013
1163
  | --- | ----------- | ------- |
1014
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
1015
1164
  | `quantize` | Hash containing options for quantization. May include `:show` with an Array of keys to not quantize (or `:all` to skip quantization), or `:exclude` with Array of keys to exclude entirely. | `{ show: [:collection, :database, :operation] }` |
1016
1165
  | `service_name` | Service name used for `mongo` instrumentation | `'mongodb'` |
1017
1166
 
@@ -1035,7 +1184,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1035
1184
 
1036
1185
  | Key | Description | Default |
1037
1186
  | --- | ----------- | ------- |
1038
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
1039
1187
  | `service_name` | Service name used for `mysql2` instrumentation | `'mysql2'` |
1040
1188
 
1041
1189
  ### Net/HTTP
@@ -1068,7 +1216,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1068
1216
 
1069
1217
  | Key | Description | Default |
1070
1218
  | --- | ----------- | ------- |
1071
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
1072
1219
  | `distributed_tracing` | Enables [distributed tracing](#distributed-tracing) | `true` |
1073
1220
  | `service_name` | Service name used for `http` instrumentation | `'net/http'` |
1074
1221
  | `split_by_domain` | Uses the request domain as the service name when set to `true`. | `false` |
@@ -1109,9 +1256,30 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1109
1256
 
1110
1257
  | Key | Description | Default |
1111
1258
  | --- | ----------- | ------- |
1112
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
1113
1259
  | `service_name` | Service name used for `presto` instrumentation | `'presto'` |
1114
1260
 
1261
+ ### Qless
1262
+
1263
+ The Qless integration uses lifecycle hooks to trace job executions.
1264
+
1265
+ To add tracing to a Qless job:
1266
+
1267
+ ```ruby
1268
+ require 'ddtrace'
1269
+
1270
+ Datadog.configure do |c|
1271
+ c.use :qless, options
1272
+ end
1273
+ ```
1274
+
1275
+ Where `options` is an optional `Hash` that accepts the following parameters:
1276
+
1277
+ | Key | Description | Default |
1278
+ | --- | ----------- | ------- |
1279
+ | `service_name` | Service name used for `qless` instrumentation | `'qless'` |
1280
+ | `tag_job_data` | Enable tagging with job arguments. true for on, false for off. | `false` |
1281
+ | `tag_job_tags` | Enable tagging with job tags. true for on, false for off. | `false` |
1282
+
1115
1283
  ### Que
1116
1284
 
1117
1285
  The Que integration is a middleware which will trace job executions.
@@ -1130,11 +1298,11 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1130
1298
 
1131
1299
  | Key | Description | Default |
1132
1300
  | --- | ----------- | ------- |
1133
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
1134
1301
  | `enabled` | Defines whether Que should be traced. Useful for temporarily disabling tracing. `true` or `false` | `true` |
1135
1302
  | `service_name` | Service name used for `que` instrumentation | `'que'` |
1136
1303
  | `tag_args` | Enable tagging of a job's args field. `true` for on, `false` for off. | `false` |
1137
1304
  | `tag_data` | Enable tagging of a job's data field. `true` for on, `false` for off. | `false` |
1305
+ | `error_handler` | Custom error handler invoked when a job raises an error. Provided `span` and `error` as arguments. Sets error on the span by default. Useful for ignoring transient errors. | `proc { |span, error| span.set_error(error) unless span.nil? }` |
1138
1306
 
1139
1307
  ### Racecar
1140
1308
 
@@ -1154,7 +1322,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1154
1322
 
1155
1323
  | Key | Description | Default |
1156
1324
  | --- | ----------- | ------- |
1157
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
1158
1325
  | `service_name` | Service name used for `racecar` instrumentation | `'racecar'` |
1159
1326
 
1160
1327
  ### Rack
@@ -1184,11 +1351,10 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1184
1351
 
1185
1352
  | Key | Description | Default |
1186
1353
  | --- | ----------- | ------- |
1187
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `nil` |
1188
1354
  | `application` | Your Rack application. Required for `middleware_names`. | `nil` |
1189
1355
  | `distributed_tracing` | Enables [distributed tracing](#distributed-tracing) so that this service trace is connected with a trace of another service if tracing headers are received | `true` |
1190
1356
  | `headers` | Hash of HTTP request or response headers to add as tags to the `rack.request`. Accepts `request` and `response` keys with Array values e.g. `['Last-Modified']`. Adds `http.request.headers.*` and `http.response.headers.*` tags respectively. | `{ response: ['Content-Type', 'X-Request-ID'] }` |
1191
- | `middleware_names` | Enable this if you want to use the middleware classes as the resource names for `rack` spans. Requires `application` option to use. | `false` |
1357
+ | `middleware_names` | Enable this if you want to use the last executed middleware class as the resource name for the `rack` span. If enabled alongside the `rails` instrumention, `rails` takes precedence by setting the `rack` resource name to the active `rails` controller when applicable. Requires `application` option to use. | `false` |
1192
1358
  | `quantize` | Hash containing options for quantization. May include `:query` or `:fragment`. | `{}` |
1193
1359
  | `quantize.query` | Hash containing options for query portion of URL quantization. May include `:show` or `:exclude`. See options below. Option must be nested inside the `quantize` option. | `{}` |
1194
1360
  | `quantize.query.show` | Defines which values should always be shown. Shows no values by default. May be an Array of strings, or `:all` to show all values. Option must be nested inside the `query` option. | `nil` |
@@ -1247,7 +1413,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1247
1413
 
1248
1414
  | Key | Description | Default |
1249
1415
  | --- | ----------- | ------- |
1250
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to the global setting, `false` for off. | `nil` |
1251
1416
  | `cache_service` | Cache service name used when tracing cache activity | `'<app_name>-cache'` |
1252
1417
  | `controller_service` | Service name used when tracing a Rails action controller | `'<app_name>'` |
1253
1418
  | `database_service` | Database service name used when tracing database activity | `'<app_name>-<adapter_name>'` |
@@ -1267,8 +1432,9 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1267
1432
  | 2.1 | | 3.0 - 4.2 |
1268
1433
  | 2.2 - 2.3 | | 3.0 - 5.2 |
1269
1434
  | 2.4 | | 4.2.8 - 5.2 |
1270
- | 2.5 | | 4.2.8 - 6.0 |
1271
- | 2.6 - 2.7 | 9.2 | 5.0 - 6.0 |
1435
+ | 2.5 | | 4.2.8 - 6.1 |
1436
+ | 2.6 - 2.7 | 9.2 | 5.0 - 6.1 |
1437
+ | 3.0 | | 6.1 |
1272
1438
 
1273
1439
  ### Rake
1274
1440
 
@@ -1296,7 +1462,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1296
1462
 
1297
1463
  | Key | Description | Default |
1298
1464
  | --- | ----------- | ------- |
1299
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to the global setting, `false` for off. | `false` |
1300
1465
  | `enabled` | Defines whether Rake tasks should be traced. Useful for temporarily disabling tracing. `true` or `false` | `true` |
1301
1466
  | `quantize` | Hash containing options for quantization of task arguments. See below for more details and examples. | `{}` |
1302
1467
  | `service_name` | Service name used for `rake` instrumentation | `'rake'` |
@@ -1356,8 +1521,8 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1356
1521
 
1357
1522
  | Key | Description | Default |
1358
1523
  | --- | ----------- | ------- |
1359
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
1360
1524
  | `service_name` | Service name used for `redis` instrumentation | `'redis'` |
1525
+ | `command_args` | Show the command arguments (e.g. `key` in `GET key`) as resource name and tag | true |
1361
1526
 
1362
1527
  You can also set *per-instance* configuration as it follows:
1363
1528
 
@@ -1395,12 +1560,17 @@ Datadog.configure do |c|
1395
1560
  # The default configuration for any redis client
1396
1561
  c.use :redis, service_name: 'redis-default'
1397
1562
 
1398
- # The configuration matching a given unix socket
1563
+ # The configuration matching a given unix socket.
1399
1564
  c.use :redis, describes: { url: 'unix://path/to/file' }, service_name: 'redis-unix'
1400
1565
 
1401
- # Connection string
1402
- c.use :redis, describes: { url: 'redis://127.0.0.1:6379/0' }, service_name: 'redis-connection-string'
1403
- # Client host, port, db, scheme
1566
+ # For network connections, only these fields are considered during matching:
1567
+ # scheme, host, port, db
1568
+ # Other fields are ignored.
1569
+
1570
+ # Network connection string
1571
+ c.use :redis, describes: 'redis://127.0.0.1:6379/0', service_name: 'redis-connection-string'
1572
+ c.use :redis, describes: { url: 'redis://127.0.0.1:6379/1' }, service_name: 'redis-connection-url'
1573
+ # Network client hash
1404
1574
  c.use :redis, describes: { host: 'my-host.com', port: 6379, db: 1, scheme: 'redis' }, service_name: 'redis-connection-hash'
1405
1575
  # Only a subset of the connection hash
1406
1576
  c.use :redis, describes: { host: ENV['APP_CACHE_HOST'], port: ENV['APP_CACHE_PORT'] }, service_name: 'redis-cache'
@@ -1408,6 +1578,8 @@ Datadog.configure do |c|
1408
1578
  end
1409
1579
  ```
1410
1580
 
1581
+ When multiple `describes` configurations match a connection, the latest configured rule that matches will be applied.
1582
+
1411
1583
  ### Resque
1412
1584
 
1413
1585
  The Resque integration uses Resque hooks that wraps the `perform` method.
@@ -1415,16 +1587,11 @@ The Resque integration uses Resque hooks that wraps the `perform` method.
1415
1587
  To add tracing to a Resque job:
1416
1588
 
1417
1589
  ```ruby
1590
+ require 'resque'
1418
1591
  require 'ddtrace'
1419
1592
 
1420
- class MyJob
1421
- def self.perform(*args)
1422
- # do_something
1423
- end
1424
- end
1425
-
1426
1593
  Datadog.configure do |c|
1427
- c.use :resque, options
1594
+ c.use :resque, **options
1428
1595
  end
1429
1596
  ```
1430
1597
 
@@ -1432,9 +1599,9 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1432
1599
 
1433
1600
  | Key | Description | Default |
1434
1601
  | --- | ----------- | ------- |
1435
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to the global setting, `false` for off. | `false` |
1436
1602
  | `service_name` | Service name used for `resque` instrumentation | `'resque'` |
1437
- | `workers` | An array including all worker classes you want to trace (e.g. `[MyJob]`) | `[]` |
1603
+ | `error_handler` | Custom error handler invoked when a job raises an error. Provided `span` and `error` as arguments. Sets error on the span by default. Useful for ignoring transient errors. | `proc { |span, error| span.set_error(error) unless span.nil? }` |
1604
+ | `workers` | **[DEPRECATED]** Limits instrumented worker classes to only the ones specified in an array (e.g. `[MyJob]`). If not provided, instruments all workers. | `nil` |
1438
1605
 
1439
1606
  ### Rest Client
1440
1607
 
@@ -1453,10 +1620,33 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1453
1620
 
1454
1621
  | Key | Description | Default |
1455
1622
  | --- | ----------- | ------- |
1456
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
1457
1623
  | `distributed_tracing` | Enables [distributed tracing](#distributed-tracing) | `true` |
1458
1624
  | `service_name` | Service name for `rest_client` instrumentation. | `'rest_client'` |
1459
1625
 
1626
+ ### RSpec
1627
+
1628
+ RSpec integration will trace all executions of example groups and examples when using `rspec` test framework.
1629
+
1630
+ To activate your integration, use the `Datadog.configure` method:
1631
+
1632
+ ```ruby
1633
+ require 'rspec'
1634
+ require 'ddtrace'
1635
+
1636
+ # Configure default RSpec integration
1637
+ Datadog.configure do |c|
1638
+ c.use :rspec, options
1639
+ end
1640
+ ```
1641
+
1642
+ Where `options` is an optional `Hash` that accepts the following parameters:
1643
+
1644
+ | Key | Description | Default |
1645
+ | --- | ----------- | ------- |
1646
+ | `enabled` | Defines whether RSpec tests should be traced. Useful for temporarily disabling tracing. `true` or `false` | `true` |
1647
+ | `service_name` | Service name used for `rspec` instrumentation. | `'rspec'` |
1648
+ | `operation_name` | Operation name used for `rspec` instrumentation. Useful if you want rename automatic trace metrics e.g. `trace.#{operation_name}.errors`. | `'rspec.example'` |
1649
+
1460
1650
  ### Sequel
1461
1651
 
1462
1652
  The Sequel integration traces queries made to your database.
@@ -1487,11 +1677,8 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1487
1677
 
1488
1678
  | Key | Description | Default |
1489
1679
  | --- | ----------- | ------- |
1490
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
1491
1680
  | `service_name` | Service name for `sequel` instrumentation | Name of database adapter (e.g. `'mysql2'`) |
1492
1681
 
1493
- Only Ruby 2.0+ is supported.
1494
-
1495
1682
  **Configuring databases to use different settings**
1496
1683
 
1497
1684
  If you use multiple databases with Sequel, you can give each of them different settings by configuring their respective `Sequel::Database` objects:
@@ -1523,8 +1710,9 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1523
1710
 
1524
1711
  | Key | Description | Default |
1525
1712
  | --- | ----------- | ------- |
1526
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
1527
1713
  | `service_name` | Service name used for `shoryuken` instrumentation | `'shoryuken'` |
1714
+ | `tag_body` | Tag spans with the SQS message body `true` or `false` | `false` |
1715
+ | `error_handler` | Custom error handler invoked when a job raises an error. Provided `span` and `error` as arguments. Sets error on the span by default. Useful for ignoring transient errors. | `proc { |span, error| span.set_error(error) unless span.nil? }` |
1528
1716
 
1529
1717
  ### Sidekiq
1530
1718
 
@@ -1544,10 +1732,10 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1544
1732
 
1545
1733
  | Key | Description | Default |
1546
1734
  | --- | ----------- | ------- |
1547
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
1548
1735
  | `client_service_name` | Service name used for client-side `sidekiq` instrumentation | `'sidekiq-client'` |
1549
1736
  | `service_name` | Service name used for server-side `sidekiq` instrumentation | `'sidekiq'` |
1550
1737
  | `tag_args` | Enable tagging of job arguments. `true` for on, `false` for off. | `false` |
1738
+ | `error_handler` | Custom error handler invoked when a job raises an error. Provided `span` and `error` as arguments. Sets error on the span by default. Useful for ignoring transient errors. | `proc { |span, error| span.set_error(error) unless span.nil? }` |
1551
1739
 
1552
1740
  ### Sinatra
1553
1741
 
@@ -1607,7 +1795,6 @@ Ensure you register `Datadog::Contrib::Sinatra::Tracer` as a middleware before y
1607
1795
 
1608
1796
  | Key | Description | Default |
1609
1797
  | --- | ----------- | ------- |
1610
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `nil` |
1611
1798
  | `distributed_tracing` | Enables [distributed tracing](#distributed-tracing) so that this service trace is connected with a trace of another service if tracing headers are received | `true` |
1612
1799
  | `headers` | Hash of HTTP request or response headers to add as tags to the `sinatra.request`. Accepts `request` and `response` keys with Array values e.g. `['Last-Modified']`. Adds `http.request.headers.*` and `http.response.headers.*` tags respectively. | `{ response: ['Content-Type', 'X-Request-ID'] }` |
1613
1800
  | `resource_script_names` | Prepend resource names with script name | `false` |
@@ -1631,10 +1818,10 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1631
1818
 
1632
1819
  | Key | Description | Default |
1633
1820
  | --- | ----------- | ------- |
1634
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
1635
1821
  | `enabled` | Defines whether Sneakers should be traced. Useful for temporarily disabling tracing. `true` or `false` | `true` |
1636
1822
  | `service_name` | Service name used for `sneakers` instrumentation | `'sneakers'` |
1637
1823
  | `tag_body` | Enable tagging of job message. `true` for on, `false` for off. | `false` |
1824
+ | `error_handler` | Custom error handler invoked when a job raises an error. Provided `span` and `error` as arguments. Sets error on the span by default. Useful for ignoring transient errors. | `proc { |span, error| span.set_error(error) unless span.nil? }` |
1638
1825
 
1639
1826
  ### Sucker Punch
1640
1827
 
@@ -1655,7 +1842,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1655
1842
 
1656
1843
  | Key | Description | Default |
1657
1844
  | --- | ----------- | ------- |
1658
- | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
1659
1845
  | `service_name` | Service name used for `sucker_punch` instrumentation | `'sucker_punch'` |
1660
1846
 
1661
1847
  ## Advanced configuration
@@ -1671,13 +1857,20 @@ Datadog.configure do |c|
1671
1857
  c.tracer.enabled = true
1672
1858
  c.tracer.hostname = 'my-agent'
1673
1859
  c.tracer.port = 8126
1674
- c.tracer.partial_flush.enabled = false
1860
+
1861
+ # Ensure all traces are ingested by Datadog
1862
+ c.sampling.default_rate = 1.0 # Recommended
1863
+ c.sampling.rate_limit = 200
1864
+ # or provide a custom implementation (overrides c.sampling settings)
1675
1865
  c.tracer.sampler = Datadog::AllSampler.new
1676
1866
 
1677
- # OR for advanced use cases, you can specify your own tracer:
1867
+ # Breaks down very large traces into smaller batches
1868
+ c.tracer.partial_flush.enabled = false
1869
+
1870
+ # You can specify your own tracer
1678
1871
  c.tracer.instance = Datadog::Tracer.new
1679
1872
 
1680
- # To enable debug mode:
1873
+ # To enable debug mode
1681
1874
  c.diagnostics.debug = true
1682
1875
  end
1683
1876
  ```
@@ -1689,9 +1882,12 @@ Available options are:
1689
1882
  - `instance`: set to a custom `Datadog::Tracer` instance. If provided, other trace settings are ignored (you must configure it manually.)
1690
1883
  - `partial_flush.enabled`: set to `true` to enable partial trace flushing (for long running traces.) Disabled by default. *Experimental.*
1691
1884
  - `port`: set the port the trace agent is listening on.
1885
+ - `sampling.default_rate`: default tracer sampling rate, between `0.0` (0%) and `1.0` (100%, recommended). `1.0` or Tracing without Limits™, allows you to send all of your traffic and retention can be [configured within the Datadog app](https://docs.datadoghq.com/tracing/trace_retention_and_ingestion/). When this configuration is not set, the Datadog agent will keep an intelligent assortment of diverse traces.
1886
+ - `sampling.rate_limit`: maximum number of traces per second to sample. Defaults to 100 per second.
1692
1887
  - `sampler`: set to a custom `Datadog::Sampler` instance. If provided, the tracer will use this sampler to determine sampling behavior.
1693
1888
  - `diagnostics.startup_logs.enabled`: Startup configuration and diagnostic log. Defaults to `true`. Can be configured through the `DD_TRACE_STARTUP_LOGS` environment variable.
1694
1889
  - `diagnostics.debug`: set to true to enable debug logging. Can be configured through the `DD_TRACE_DEBUG` environment variable. Defaults to `false`.
1890
+ - `time_now_provider`: when testing, it might be helpful to use a different time provider. For Timecop, for example, `->{ Time.now_without_mock_time }` allows the tracer to use the real wall time. Span duration calculation will still use the system monotonic clock when available, thus not being affected by this setting. Defaults to `->{ Time.now }`.
1695
1891
 
1696
1892
  #### Custom logging
1697
1893
 
@@ -1745,13 +1941,22 @@ Other Environment Variables:
1745
1941
 
1746
1942
  - `DD_TRACE_AGENT_URL`: Sets the URL endpoint where traces are sent. Has priority over `DD_AGENT_HOST` and `DD_TRACE_AGENT_PORT` if set. e.g. `DD_TRACE_AGENT_URL=http://localhost:8126`.
1747
1943
  - `DD_TRACE_<INTEGRATION>_ENABLED`: Enables or disables an **activated** integration. Defaults to `true`.. e.g. `DD_TRACE_RAILS_ENABLED=false`. This option has no effects on integrations that have not been explicitly activated (e.g. `Datadog.configure{ |c| c.use :integration }`).on code. This environment variable can only be used to disable an integration.
1748
- - `DD_TRACE_<INTEGRATION>_ANALYTICS_ENABLED`: Enables or disable App Analytics for a specific integration. Valid values are: true or false (default). e.g. `DD_TRACE_ACTION_CABLE_ANALYTICS_ENABLED=true`.
1749
- - `DD_TRACE_<INTEGRATION>_ANALYTICS_SAMPLE_RATE`: Sets the App Analytics sampling rate for a specific integration. A floating number between 0.0 and 1.0 (default). e.g. `DD_TRACE_ACTION_CABLE_ANALYTICS_SAMPLE_RATE=0.5`.
1944
+ - `DD_TRACE_SAMPLE_RATE`: Sets the trace sampling rate between `0.0` (0%) and `1.0` (100%, recommended). `1.0` or Tracing without Limits™, allows you to send all of your traffic and retention can be [configured within the Datadog app](https://docs.datadoghq.com/tracing/trace_retention_and_ingestion/). When this configuration is not set, the Datadog agent will keep an intelligent assortment of diverse traces.
1750
1945
  - `DD_LOGS_INJECTION`: Automatically enables injection [Trace Correlation](#trace-correlation) information, such as `dd.trace_id`, into Rails logs. Supports the default logger (`ActiveSupport::TaggedLogging`) and `Lograge`. Details on the format of Trace Correlation information can be found in the [Trace Correlation](#trace-correlation) section. Valid values are: `true` or `false`(default). e.g. `DD_LOGS_INJECTION=true`.
1751
1946
 
1752
1947
  ### Sampling
1753
1948
 
1754
- `ddtrace` can perform trace sampling. While the trace agent already samples traces to reduce bandwidth usage, client sampling reduces the performance overhead.
1949
+ Datadog's Tracing without Limits™ allows you to send all of your traffic and [configure retention within the Datadog app](https://docs.datadoghq.com/tracing/trace_retention_and_ingestion/).
1950
+
1951
+ We recommend setting the environment variable `DD_TRACE_SAMPLE_RATE=1.0` in all new applications using `ddtrace`.
1952
+
1953
+ App Analytics, previously configured with the `analytics_enabled` setting, is deprecated in favor of Tracing without Limits™. Documentation for this [deprecated configuration is still available](https://docs.datadoghq.com/tracing/legacy_app_analytics/).
1954
+
1955
+ #### Application-side sampling
1956
+
1957
+ While the trace agent can sample traces to reduce bandwidth usage, application-side sampling reduces the performance overhead.
1958
+
1959
+ This will **reduce visibility and is not recommended**. See [DD_TRACE_SAMPLE_RATE](#environment-variables) for the recommended sampling approach.
1755
1960
 
1756
1961
  `Datadog::RateSampler` samples a ratio of the traces. For example:
1757
1962
 
@@ -1909,12 +2114,14 @@ For more details on how to activate distributed tracing for integrations, see th
1909
2114
 
1910
2115
  - [Excon](#excon)
1911
2116
  - [Faraday](#faraday)
1912
- - [Rest Client](#restclient)
2117
+ - [Rest Client](#rest-client)
1913
2118
  - [Net/HTTP](#nethttp)
1914
2119
  - [Rack](#rack)
1915
2120
  - [Rails](#rails)
1916
2121
  - [Sinatra](#sinatra)
1917
2122
  - [http.rb](#http-rb)
2123
+ - [httpclient](#httpclient)
2124
+ - [httpx](#httpx)
1918
2125
 
1919
2126
  **Using the HTTP propagator**
1920
2127
 
@@ -1943,9 +2150,7 @@ end
1943
2150
 
1944
2151
  Traces that originate from HTTP requests can be configured to include the time spent in a frontend web server or load balancer queue before the request reaches the Ruby application.
1945
2152
 
1946
- This functionality is **experimental** and deactivated by default.
1947
-
1948
- To activate this feature, you must add an `X-Request-Start` or `X-Queue-Start` header from your web server (i.e., Nginx). The following is an Nginx configuration example:
2153
+ This feature is disabled by default. To activate it, you must add an `X-Request-Start` or `X-Queue-Start` header from your web server (i.e., Nginx). The following is an Nginx configuration example:
1949
2154
 
1950
2155
  ```
1951
2156
  # /etc/nginx/conf.d/ruby_service.conf
@@ -1959,9 +2164,7 @@ server {
1959
2164
  }
1960
2165
  ```
1961
2166
 
1962
- Then you must enable the request queuing feature in the integration handling the request.
1963
-
1964
- For Rack-based applications, see the [documentation](#rack) for details for enabling this feature.
2167
+ Then you must enable the request queuing feature, by setting `request_queuing: true`, in the integration handling the request. For Rack-based applications, see the [documentation](#rack) for details.
1965
2168
 
1966
2169
  ### Processing Pipeline
1967
2170
 
@@ -2045,9 +2248,11 @@ Datadog.configure do |c|
2045
2248
  end
2046
2249
  ```
2047
2250
 
2251
+ _Note:_ For `lograge` users who have also defined `lograge.custom_options` in an `initializers/lograge.rb` configuration file, due to the order that Rails loads initializers (alphabetical), automatic trace correlation may not take effect, since `initializers/datadog.rb` would be overwritten by the `initializers/lograge.rb` initializer. To support automatic trace correlation with _existing_ `lograge.custom_options`, use the [Manual (Lograge)](#manual-lograge) configuration below.
2252
+
2048
2253
  ##### Manual (Lograge)
2049
2254
 
2050
- After [setting up Lograge in a Rails application](https://docs.datadoghq.com/logs/log_collection/ruby/), manually modify the `custom_options` block in your environment configuration file (e.g. `config/environments/production.rb`) to add the trace IDs.
2255
+ After [setting up Lograge in a Rails application](https://docs.datadoghq.com/logs/log_collection/ruby/), manually modify the `custom_options` block in your environment configuration file (e.g. `config/environments/production.rb`) to add the trace IDs.
2051
2256
 
2052
2257
  ```ruby
2053
2258
  config.lograge.custom_options = lambda do |event|
@@ -2204,7 +2409,7 @@ The tracer and its integrations can produce some additional metrics that can pro
2204
2409
  To configure your application for metrics collection:
2205
2410
 
2206
2411
  1. [Configure your Datadog agent for StatsD](https://docs.datadoghq.com/developers/dogstatsd/#setup)
2207
- 2. Add `gem 'dogstatsd-ruby'` to your Gemfile
2412
+ 2. Add `gem 'dogstatsd-ruby', '~> 4.0'` to your Gemfile (note that it is advised to pin v4.x [until this issue is solved](https://github.com/DataDog/dogstatsd-ruby/issues/182))
2208
2413
 
2209
2414
  #### For application runtime
2210
2415
 
@@ -2274,3 +2479,19 @@ However, additional instrumentation provided by Datadog can be activated alongsi
2274
2479
  | `OpenTracing::FORMAT_TEXT_MAP` | Yes | |
2275
2480
  | `OpenTracing::FORMAT_RACK` | Yes | Because of the loss of resolution in the Rack format, please note that baggage items with names containing either upper case characters or `-` will be converted to lower case and `_` in a round-trip respectively. We recommend avoiding these characters or accommodating accordingly on the receiving end. |
2276
2481
  | `OpenTracing::FORMAT_BINARY` | No | |
2482
+
2483
+ ### Profiling
2484
+
2485
+ *Currently available as BETA feature.*
2486
+
2487
+ `ddtrace` can produce profiles that measure method-level application resource usage within production environments. These profiles can give insight into resources spent in Ruby code outside of existing trace instrumentation.
2488
+
2489
+ **Setup**
2490
+
2491
+ To get started with profiling, follow the [Profiler Getting Started Guide](https://docs.datadoghq.com/tracing/profiler/getting_started/?code-lang=ruby).
2492
+
2493
+ #### Profiling Resque jobs
2494
+
2495
+ When profiling [Resque](https://github.com/resque/resque) jobs, you should set the `RUN_AT_EXIT_HOOKS=1` option described in the [Resque](https://github.com/resque/resque/blob/v2.0.0/docs/HOOKS.md#worker-hooks) documentation.
2496
+
2497
+ Without this flag, profiles for short-lived Resque jobs will not be available as Resque kills worker processes before they have a chance to submit this information.