ddtrace 0.46.0 → 0.51.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (732) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +303 -79
  3. data/.circleci/images/primary/Dockerfile-2.1.10 +12 -2
  4. data/.circleci/images/primary/Dockerfile-2.2.10 +12 -2
  5. data/.circleci/images/primary/Dockerfile-2.3.8 +14 -2
  6. data/.circleci/images/primary/Dockerfile-2.4.10 +85 -0
  7. data/.circleci/images/primary/{Dockerfile-2.5.6 → Dockerfile-2.5.9} +13 -3
  8. data/.circleci/images/primary/{Dockerfile-2.6.4 → Dockerfile-2.6.7} +13 -3
  9. data/.circleci/images/primary/{Dockerfile-2.7.0 → Dockerfile-2.7.3} +13 -3
  10. data/.circleci/images/primary/{Dockerfile-3.0.0 → Dockerfile-3.0.1} +3 -3
  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} +2 -6
  13. data/.circleci/images/primary/{Dockerfile-2.4.6 → Dockerfile-truffleruby-21.1.0} +4 -4
  14. data/.dd-ci/ci-app-spec.json +31 -0
  15. data/.dockerignore +0 -1
  16. data/.gitattributes +1 -0
  17. data/.github/workflows/create-next-milestone.yml +2 -2
  18. data/.github/workflows/test-head.yaml +34 -0
  19. data/.gitignore +0 -1
  20. data/.gitlab-ci.yml +18 -18
  21. data/.rubocop.yml +32 -9
  22. data/.rubocop_todo.yml +53 -12
  23. data/.simplecov +6 -0
  24. data/Appraisals +254 -176
  25. data/CHANGELOG.md +271 -1
  26. data/Gemfile +35 -7
  27. data/LICENSE-3rdparty.csv +2 -0
  28. data/Rakefile +339 -332
  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 +6 -4
  34. data/docker-compose.yml +68 -54
  35. data/docs/GettingStarted.md +149 -67
  36. data/docs/ProfilingDevelopment.md +88 -0
  37. data/gemfiles/jruby_9.2.0.0_contrib.gemfile +82 -0
  38. data/gemfiles/jruby_9.2.0.0_contrib.gemfile.lock +1571 -0
  39. data/gemfiles/jruby_9.2.0.0_contrib_old.gemfile +36 -0
  40. data/gemfiles/jruby_9.2.0.0_contrib_old.gemfile.lock +159 -0
  41. data/gemfiles/jruby_9.2.0.0_core_old.gemfile +35 -0
  42. data/gemfiles/jruby_9.2.0.0_core_old.gemfile.lock +155 -0
  43. data/gemfiles/jruby_9.2.0.0_cucumber3.gemfile +36 -0
  44. data/gemfiles/jruby_9.2.0.0_cucumber3.gemfile.lock +176 -0
  45. data/gemfiles/jruby_9.2.0.0_cucumber4.gemfile +36 -0
  46. data/gemfiles/jruby_9.2.0.0_cucumber4.gemfile.lock +208 -0
  47. data/gemfiles/jruby_9.2.0.0_cucumber5.gemfile +36 -0
  48. data/gemfiles/jruby_9.2.0.0_cucumber5.gemfile.lock +208 -0
  49. data/gemfiles/jruby_9.2.0.0_rails5_mysql2.gemfile +41 -0
  50. data/gemfiles/jruby_9.2.0.0_rails5_mysql2.gemfile.lock +273 -0
  51. data/gemfiles/jruby_9.2.0.0_rails5_postgres.gemfile +41 -0
  52. data/gemfiles/jruby_9.2.0.0_rails5_postgres.gemfile.lock +273 -0
  53. data/gemfiles/jruby_9.2.0.0_rails5_postgres_redis.gemfile +42 -0
  54. data/gemfiles/jruby_9.2.0.0_rails5_postgres_redis.gemfile.lock +275 -0
  55. data/gemfiles/jruby_9.2.0.0_rails5_postgres_redis_activesupport.gemfile +42 -0
  56. data/gemfiles/jruby_9.2.0.0_rails5_postgres_redis_activesupport.gemfile.lock +275 -0
  57. data/gemfiles/jruby_9.2.0.0_rails5_postgres_sidekiq.gemfile +43 -0
  58. data/gemfiles/jruby_9.2.0.0_rails5_postgres_sidekiq.gemfile.lock +281 -0
  59. data/gemfiles/jruby_9.2.0.0_rails5_semantic_logger.gemfile +41 -0
  60. data/gemfiles/jruby_9.2.0.0_rails5_semantic_logger.gemfile.lock +272 -0
  61. data/gemfiles/jruby_9.2.0.0_rails61_mysql2.gemfile +41 -0
  62. data/gemfiles/jruby_9.2.0.0_rails61_mysql2.gemfile.lock +292 -0
  63. data/gemfiles/jruby_9.2.0.0_rails61_postgres.gemfile +41 -0
  64. data/gemfiles/jruby_9.2.0.0_rails61_postgres.gemfile.lock +292 -0
  65. data/gemfiles/jruby_9.2.0.0_rails61_postgres_redis.gemfile +42 -0
  66. data/gemfiles/jruby_9.2.0.0_rails61_postgres_redis.gemfile.lock +294 -0
  67. data/gemfiles/jruby_9.2.0.0_rails61_postgres_sidekiq.gemfile +42 -0
  68. data/gemfiles/jruby_9.2.0.0_rails61_postgres_sidekiq.gemfile.lock +299 -0
  69. data/gemfiles/jruby_9.2.0.0_rails61_semantic_logger.gemfile +41 -0
  70. data/gemfiles/jruby_9.2.0.0_rails61_semantic_logger.gemfile.lock +291 -0
  71. data/gemfiles/jruby_9.2.0.0_rails6_mysql2.gemfile +41 -0
  72. data/gemfiles/jruby_9.2.0.0_rails6_mysql2.gemfile.lock +289 -0
  73. data/gemfiles/jruby_9.2.0.0_rails6_postgres.gemfile +41 -0
  74. data/gemfiles/jruby_9.2.0.0_rails6_postgres.gemfile.lock +289 -0
  75. data/gemfiles/jruby_9.2.0.0_rails6_postgres_redis.gemfile +42 -0
  76. data/gemfiles/jruby_9.2.0.0_rails6_postgres_redis.gemfile.lock +291 -0
  77. data/gemfiles/jruby_9.2.0.0_rails6_postgres_redis_activesupport.gemfile +42 -0
  78. data/gemfiles/jruby_9.2.0.0_rails6_postgres_redis_activesupport.gemfile.lock +291 -0
  79. data/gemfiles/jruby_9.2.0.0_rails6_postgres_sidekiq.gemfile +43 -0
  80. data/gemfiles/jruby_9.2.0.0_rails6_postgres_sidekiq.gemfile.lock +297 -0
  81. data/gemfiles/jruby_9.2.0.0_rails6_semantic_logger.gemfile +41 -0
  82. data/gemfiles/jruby_9.2.0.0_rails6_semantic_logger.gemfile.lock +288 -0
  83. data/gemfiles/jruby_9.2.0.0_resque2_redis3.gemfile +37 -0
  84. data/gemfiles/jruby_9.2.0.0_resque2_redis3.gemfile.lock +182 -0
  85. data/gemfiles/jruby_9.2.0.0_resque2_redis4.gemfile +37 -0
  86. data/gemfiles/jruby_9.2.0.0_resque2_redis4.gemfile.lock +182 -0
  87. data/gemfiles/jruby_9.2.18.0_contrib.gemfile +82 -0
  88. data/gemfiles/jruby_9.2.18.0_contrib.gemfile.lock +1571 -0
  89. data/gemfiles/jruby_9.2.18.0_contrib_old.gemfile +36 -0
  90. data/gemfiles/jruby_9.2.18.0_contrib_old.gemfile.lock +159 -0
  91. data/gemfiles/jruby_9.2.18.0_core_old.gemfile +35 -0
  92. data/gemfiles/jruby_9.2.18.0_core_old.gemfile.lock +155 -0
  93. data/gemfiles/jruby_9.2.18.0_cucumber3.gemfile +36 -0
  94. data/gemfiles/jruby_9.2.18.0_cucumber3.gemfile.lock +176 -0
  95. data/gemfiles/jruby_9.2.18.0_cucumber4.gemfile +36 -0
  96. data/gemfiles/jruby_9.2.18.0_cucumber4.gemfile.lock +208 -0
  97. data/gemfiles/jruby_9.2.18.0_cucumber5.gemfile +36 -0
  98. data/gemfiles/jruby_9.2.18.0_cucumber5.gemfile.lock +208 -0
  99. data/gemfiles/jruby_9.2.18.0_rails5_mysql2.gemfile +41 -0
  100. data/gemfiles/jruby_9.2.18.0_rails5_mysql2.gemfile.lock +273 -0
  101. data/gemfiles/jruby_9.2.18.0_rails5_postgres.gemfile +41 -0
  102. data/gemfiles/jruby_9.2.18.0_rails5_postgres.gemfile.lock +273 -0
  103. data/gemfiles/jruby_9.2.18.0_rails5_postgres_redis.gemfile +42 -0
  104. data/gemfiles/jruby_9.2.18.0_rails5_postgres_redis.gemfile.lock +275 -0
  105. data/gemfiles/jruby_9.2.18.0_rails5_postgres_redis_activesupport.gemfile +42 -0
  106. data/gemfiles/jruby_9.2.18.0_rails5_postgres_redis_activesupport.gemfile.lock +275 -0
  107. data/gemfiles/jruby_9.2.18.0_rails5_postgres_sidekiq.gemfile +43 -0
  108. data/gemfiles/jruby_9.2.18.0_rails5_postgres_sidekiq.gemfile.lock +281 -0
  109. data/gemfiles/jruby_9.2.18.0_rails5_semantic_logger.gemfile +41 -0
  110. data/gemfiles/jruby_9.2.18.0_rails5_semantic_logger.gemfile.lock +272 -0
  111. data/gemfiles/jruby_9.2.18.0_rails61_mysql2.gemfile +41 -0
  112. data/gemfiles/jruby_9.2.18.0_rails61_mysql2.gemfile.lock +292 -0
  113. data/gemfiles/jruby_9.2.18.0_rails61_postgres.gemfile +41 -0
  114. data/gemfiles/jruby_9.2.18.0_rails61_postgres.gemfile.lock +292 -0
  115. data/gemfiles/jruby_9.2.18.0_rails61_postgres_redis.gemfile +42 -0
  116. data/gemfiles/jruby_9.2.18.0_rails61_postgres_redis.gemfile.lock +294 -0
  117. data/gemfiles/jruby_9.2.18.0_rails61_postgres_sidekiq.gemfile +42 -0
  118. data/gemfiles/jruby_9.2.18.0_rails61_postgres_sidekiq.gemfile.lock +299 -0
  119. data/gemfiles/jruby_9.2.18.0_rails61_semantic_logger.gemfile +41 -0
  120. data/gemfiles/jruby_9.2.18.0_rails61_semantic_logger.gemfile.lock +291 -0
  121. data/gemfiles/jruby_9.2.18.0_rails6_mysql2.gemfile +41 -0
  122. data/gemfiles/jruby_9.2.18.0_rails6_mysql2.gemfile.lock +289 -0
  123. data/gemfiles/jruby_9.2.18.0_rails6_postgres.gemfile +41 -0
  124. data/gemfiles/jruby_9.2.18.0_rails6_postgres.gemfile.lock +289 -0
  125. data/gemfiles/jruby_9.2.18.0_rails6_postgres_redis.gemfile +42 -0
  126. data/gemfiles/jruby_9.2.18.0_rails6_postgres_redis.gemfile.lock +291 -0
  127. data/gemfiles/jruby_9.2.18.0_rails6_postgres_redis_activesupport.gemfile +42 -0
  128. data/gemfiles/jruby_9.2.18.0_rails6_postgres_redis_activesupport.gemfile.lock +291 -0
  129. data/gemfiles/jruby_9.2.18.0_rails6_postgres_sidekiq.gemfile +43 -0
  130. data/gemfiles/jruby_9.2.18.0_rails6_postgres_sidekiq.gemfile.lock +297 -0
  131. data/gemfiles/jruby_9.2.18.0_rails6_semantic_logger.gemfile +41 -0
  132. data/gemfiles/jruby_9.2.18.0_rails6_semantic_logger.gemfile.lock +288 -0
  133. data/gemfiles/jruby_9.2.18.0_resque2_redis3.gemfile +37 -0
  134. data/gemfiles/jruby_9.2.18.0_resque2_redis3.gemfile.lock +182 -0
  135. data/gemfiles/jruby_9.2.18.0_resque2_redis4.gemfile +37 -0
  136. data/gemfiles/jruby_9.2.18.0_resque2_redis4.gemfile.lock +182 -0
  137. data/gemfiles/ruby_2.1.10_contrib_old.gemfile +68 -0
  138. data/gemfiles/ruby_2.1.10_contrib_old.gemfile.lock +310 -0
  139. data/gemfiles/ruby_2.1.10_core_old.gemfile +34 -0
  140. data/gemfiles/ruby_2.1.10_core_old.gemfile.lock +120 -0
  141. data/gemfiles/ruby_2.1.10_rails30_postgres.gemfile +39 -0
  142. data/gemfiles/ruby_2.1.10_rails30_postgres.gemfile.lock +193 -0
  143. data/gemfiles/ruby_2.1.10_rails30_postgres_sidekiq.gemfile +40 -0
  144. data/gemfiles/ruby_2.1.10_rails30_postgres_sidekiq.gemfile.lock +202 -0
  145. data/gemfiles/ruby_2.1.10_rails32_mysql2.gemfile +42 -0
  146. data/gemfiles/ruby_2.1.10_rails32_mysql2.gemfile.lock +212 -0
  147. data/gemfiles/ruby_2.1.10_rails32_postgres.gemfile +39 -0
  148. data/gemfiles/ruby_2.1.10_rails32_postgres.gemfile.lock +201 -0
  149. data/gemfiles/ruby_2.1.10_rails32_postgres_redis.gemfile +41 -0
  150. data/gemfiles/ruby_2.1.10_rails32_postgres_redis.gemfile.lock +220 -0
  151. data/gemfiles/ruby_2.1.10_rails32_postgres_sidekiq.gemfile +40 -0
  152. data/gemfiles/ruby_2.1.10_rails32_postgres_sidekiq.gemfile.lock +210 -0
  153. data/gemfiles/ruby_2.1.10_rails4_mysql2.gemfile +39 -0
  154. data/gemfiles/ruby_2.1.10_rails4_mysql2.gemfile.lock +220 -0
  155. data/gemfiles/ruby_2.1.10_rails4_postgres.gemfile +39 -0
  156. data/gemfiles/ruby_2.1.10_rails4_postgres.gemfile.lock +220 -0
  157. data/gemfiles/ruby_2.1.10_rails4_postgres_redis.gemfile +41 -0
  158. data/gemfiles/ruby_2.1.10_rails4_postgres_redis.gemfile.lock +239 -0
  159. data/gemfiles/ruby_2.1.10_rails4_semantic_logger.gemfile +39 -0
  160. data/gemfiles/ruby_2.1.10_rails4_semantic_logger.gemfile.lock +218 -0
  161. data/gemfiles/ruby_2.2.10_contrib.gemfile +76 -0
  162. data/gemfiles/ruby_2.2.10_contrib.gemfile.lock +1499 -0
  163. data/gemfiles/ruby_2.2.10_core_old.gemfile +34 -0
  164. data/gemfiles/ruby_2.2.10_core_old.gemfile.lock +120 -0
  165. data/gemfiles/ruby_2.2.10_rails30_postgres.gemfile +39 -0
  166. data/gemfiles/ruby_2.2.10_rails30_postgres.gemfile.lock +193 -0
  167. data/gemfiles/ruby_2.2.10_rails30_postgres_sidekiq.gemfile +40 -0
  168. data/gemfiles/ruby_2.2.10_rails30_postgres_sidekiq.gemfile.lock +202 -0
  169. data/gemfiles/ruby_2.2.10_rails32_mysql2.gemfile +41 -0
  170. data/gemfiles/ruby_2.2.10_rails32_mysql2.gemfile.lock +209 -0
  171. data/gemfiles/ruby_2.2.10_rails32_postgres.gemfile +39 -0
  172. data/gemfiles/ruby_2.2.10_rails32_postgres.gemfile.lock +201 -0
  173. data/gemfiles/ruby_2.2.10_rails32_postgres_redis.gemfile +41 -0
  174. data/gemfiles/ruby_2.2.10_rails32_postgres_redis.gemfile.lock +220 -0
  175. data/gemfiles/ruby_2.2.10_rails32_postgres_sidekiq.gemfile +40 -0
  176. data/gemfiles/ruby_2.2.10_rails32_postgres_sidekiq.gemfile.lock +210 -0
  177. data/gemfiles/ruby_2.2.10_rails4_mysql2.gemfile +39 -0
  178. data/gemfiles/ruby_2.2.10_rails4_mysql2.gemfile.lock +220 -0
  179. data/gemfiles/ruby_2.2.10_rails4_postgres.gemfile +39 -0
  180. data/gemfiles/ruby_2.2.10_rails4_postgres.gemfile.lock +220 -0
  181. data/gemfiles/ruby_2.2.10_rails4_postgres_redis.gemfile +41 -0
  182. data/gemfiles/ruby_2.2.10_rails4_postgres_redis.gemfile.lock +239 -0
  183. data/gemfiles/ruby_2.2.10_rails4_postgres_sidekiq.gemfile +41 -0
  184. data/gemfiles/ruby_2.2.10_rails4_postgres_sidekiq.gemfile.lock +231 -0
  185. data/gemfiles/ruby_2.2.10_rails4_semantic_logger.gemfile +39 -0
  186. data/gemfiles/ruby_2.2.10_rails4_semantic_logger.gemfile.lock +218 -0
  187. data/gemfiles/ruby_2.2.10_rails5_mysql2.gemfile +39 -0
  188. data/gemfiles/ruby_2.2.10_rails5_mysql2.gemfile.lock +236 -0
  189. data/gemfiles/ruby_2.2.10_rails5_postgres.gemfile +39 -0
  190. data/gemfiles/ruby_2.2.10_rails5_postgres.gemfile.lock +236 -0
  191. data/gemfiles/ruby_2.2.10_rails5_postgres_redis.gemfile +40 -0
  192. data/gemfiles/ruby_2.2.10_rails5_postgres_redis.gemfile.lock +238 -0
  193. data/gemfiles/ruby_2.2.10_rails5_postgres_redis_activesupport.gemfile +40 -0
  194. data/gemfiles/ruby_2.2.10_rails5_postgres_redis_activesupport.gemfile.lock +238 -0
  195. data/gemfiles/ruby_2.2.10_rails5_postgres_sidekiq.gemfile +41 -0
  196. data/gemfiles/ruby_2.2.10_rails5_postgres_sidekiq.gemfile.lock +247 -0
  197. data/gemfiles/ruby_2.2.10_rails5_semantic_logger.gemfile +39 -0
  198. data/gemfiles/ruby_2.2.10_rails5_semantic_logger.gemfile.lock +234 -0
  199. data/gemfiles/ruby_2.3.8_contrib.gemfile +75 -0
  200. data/gemfiles/ruby_2.3.8_contrib.gemfile.lock +1508 -0
  201. data/gemfiles/ruby_2.3.8_contrib_old.gemfile +34 -0
  202. data/gemfiles/ruby_2.3.8_contrib_old.gemfile.lock +123 -0
  203. data/gemfiles/ruby_2.3.8_core_old.gemfile +33 -0
  204. data/gemfiles/ruby_2.3.8_core_old.gemfile.lock +119 -0
  205. data/gemfiles/ruby_2.3.8_cucumber3.gemfile +34 -0
  206. data/gemfiles/ruby_2.3.8_cucumber3.gemfile.lock +140 -0
  207. data/gemfiles/ruby_2.3.8_cucumber4.gemfile +34 -0
  208. data/gemfiles/ruby_2.3.8_cucumber4.gemfile.lock +170 -0
  209. data/gemfiles/ruby_2.3.8_rails30_postgres.gemfile +38 -0
  210. data/gemfiles/ruby_2.3.8_rails30_postgres.gemfile.lock +192 -0
  211. data/gemfiles/ruby_2.3.8_rails30_postgres_sidekiq.gemfile +39 -0
  212. data/gemfiles/ruby_2.3.8_rails30_postgres_sidekiq.gemfile.lock +201 -0
  213. data/gemfiles/ruby_2.3.8_rails32_mysql2.gemfile +40 -0
  214. data/gemfiles/ruby_2.3.8_rails32_mysql2.gemfile.lock +208 -0
  215. data/gemfiles/ruby_2.3.8_rails32_postgres.gemfile +38 -0
  216. data/gemfiles/ruby_2.3.8_rails32_postgres.gemfile.lock +200 -0
  217. data/gemfiles/ruby_2.3.8_rails32_postgres_redis.gemfile +40 -0
  218. data/gemfiles/ruby_2.3.8_rails32_postgres_redis.gemfile.lock +219 -0
  219. data/gemfiles/ruby_2.3.8_rails32_postgres_sidekiq.gemfile +39 -0
  220. data/gemfiles/ruby_2.3.8_rails32_postgres_sidekiq.gemfile.lock +209 -0
  221. data/gemfiles/ruby_2.3.8_rails4_mysql2.gemfile +38 -0
  222. data/gemfiles/ruby_2.3.8_rails4_mysql2.gemfile.lock +219 -0
  223. data/gemfiles/ruby_2.3.8_rails4_postgres.gemfile +38 -0
  224. data/gemfiles/ruby_2.3.8_rails4_postgres.gemfile.lock +219 -0
  225. data/gemfiles/ruby_2.3.8_rails4_postgres_redis.gemfile +40 -0
  226. data/gemfiles/ruby_2.3.8_rails4_postgres_redis.gemfile.lock +238 -0
  227. data/gemfiles/ruby_2.3.8_rails4_postgres_sidekiq.gemfile +40 -0
  228. data/gemfiles/ruby_2.3.8_rails4_postgres_sidekiq.gemfile.lock +230 -0
  229. data/gemfiles/ruby_2.3.8_rails4_semantic_logger.gemfile +38 -0
  230. data/gemfiles/ruby_2.3.8_rails4_semantic_logger.gemfile.lock +218 -0
  231. data/gemfiles/ruby_2.3.8_rails5_mysql2.gemfile +37 -0
  232. data/gemfiles/ruby_2.3.8_rails5_mysql2.gemfile.lock +230 -0
  233. data/gemfiles/ruby_2.3.8_rails5_postgres.gemfile +37 -0
  234. data/gemfiles/ruby_2.3.8_rails5_postgres.gemfile.lock +230 -0
  235. data/gemfiles/ruby_2.3.8_rails5_postgres_redis.gemfile +38 -0
  236. data/gemfiles/ruby_2.3.8_rails5_postgres_redis.gemfile.lock +232 -0
  237. data/gemfiles/ruby_2.3.8_rails5_postgres_redis_activesupport.gemfile +38 -0
  238. data/gemfiles/ruby_2.3.8_rails5_postgres_redis_activesupport.gemfile.lock +232 -0
  239. data/gemfiles/ruby_2.3.8_rails5_postgres_sidekiq.gemfile +39 -0
  240. data/gemfiles/ruby_2.3.8_rails5_postgres_sidekiq.gemfile.lock +241 -0
  241. data/gemfiles/ruby_2.3.8_rails5_semantic_logger.gemfile +37 -0
  242. data/gemfiles/ruby_2.3.8_rails5_semantic_logger.gemfile.lock +229 -0
  243. data/gemfiles/ruby_2.3.8_resque2_redis3.gemfile +35 -0
  244. data/gemfiles/ruby_2.3.8_resque2_redis3.gemfile.lock +146 -0
  245. data/gemfiles/ruby_2.3.8_resque2_redis4.gemfile +35 -0
  246. data/gemfiles/ruby_2.3.8_resque2_redis4.gemfile.lock +146 -0
  247. data/gemfiles/ruby_2.4.10_contrib.gemfile +81 -0
  248. data/gemfiles/ruby_2.4.10_contrib.gemfile.lock +1596 -0
  249. data/gemfiles/ruby_2.4.10_contrib_old.gemfile +39 -0
  250. data/gemfiles/ruby_2.4.10_contrib_old.gemfile.lock +157 -0
  251. data/gemfiles/ruby_2.4.10_core_old.gemfile +38 -0
  252. data/gemfiles/ruby_2.4.10_core_old.gemfile.lock +153 -0
  253. data/gemfiles/ruby_2.4.10_cucumber3.gemfile +39 -0
  254. data/gemfiles/ruby_2.4.10_cucumber3.gemfile.lock +174 -0
  255. data/gemfiles/ruby_2.4.10_cucumber4.gemfile +39 -0
  256. data/gemfiles/ruby_2.4.10_cucumber4.gemfile.lock +204 -0
  257. data/gemfiles/ruby_2.4.10_rails5_mysql2.gemfile +42 -0
  258. data/gemfiles/ruby_2.4.10_rails5_mysql2.gemfile.lock +264 -0
  259. data/gemfiles/ruby_2.4.10_rails5_postgres.gemfile +42 -0
  260. data/gemfiles/ruby_2.4.10_rails5_postgres.gemfile.lock +264 -0
  261. data/gemfiles/ruby_2.4.10_rails5_postgres_redis.gemfile +43 -0
  262. data/gemfiles/ruby_2.4.10_rails5_postgres_redis.gemfile.lock +266 -0
  263. data/gemfiles/ruby_2.4.10_rails5_postgres_redis_activesupport.gemfile +43 -0
  264. data/gemfiles/ruby_2.4.10_rails5_postgres_redis_activesupport.gemfile.lock +266 -0
  265. data/gemfiles/ruby_2.4.10_rails5_postgres_sidekiq.gemfile +44 -0
  266. data/gemfiles/ruby_2.4.10_rails5_postgres_sidekiq.gemfile.lock +275 -0
  267. data/gemfiles/ruby_2.4.10_rails5_semantic_logger.gemfile +42 -0
  268. data/gemfiles/ruby_2.4.10_rails5_semantic_logger.gemfile.lock +263 -0
  269. data/gemfiles/ruby_2.4.10_resque2_redis3.gemfile +40 -0
  270. data/gemfiles/ruby_2.4.10_resque2_redis3.gemfile.lock +180 -0
  271. data/gemfiles/ruby_2.4.10_resque2_redis4.gemfile +40 -0
  272. data/gemfiles/ruby_2.4.10_resque2_redis4.gemfile.lock +180 -0
  273. data/gemfiles/ruby_2.5.9_contrib.gemfile +86 -0
  274. data/gemfiles/ruby_2.5.9_contrib.gemfile.lock +1608 -0
  275. data/gemfiles/ruby_2.5.9_contrib_old.gemfile +40 -0
  276. data/gemfiles/ruby_2.5.9_contrib_old.gemfile.lock +167 -0
  277. data/gemfiles/ruby_2.5.9_core_old.gemfile +39 -0
  278. data/gemfiles/ruby_2.5.9_core_old.gemfile.lock +163 -0
  279. data/gemfiles/ruby_2.5.9_cucumber3.gemfile +40 -0
  280. data/gemfiles/ruby_2.5.9_cucumber3.gemfile.lock +184 -0
  281. data/gemfiles/ruby_2.5.9_cucumber4.gemfile +40 -0
  282. data/gemfiles/ruby_2.5.9_cucumber4.gemfile.lock +216 -0
  283. data/gemfiles/ruby_2.5.9_cucumber5.gemfile +40 -0
  284. data/gemfiles/ruby_2.5.9_cucumber5.gemfile.lock +216 -0
  285. data/gemfiles/ruby_2.5.9_rails5_mysql2.gemfile +45 -0
  286. data/gemfiles/ruby_2.5.9_rails5_mysql2.gemfile.lock +276 -0
  287. data/gemfiles/ruby_2.5.9_rails5_postgres.gemfile +45 -0
  288. data/gemfiles/ruby_2.5.9_rails5_postgres.gemfile.lock +276 -0
  289. data/gemfiles/ruby_2.5.9_rails5_postgres_redis.gemfile +46 -0
  290. data/gemfiles/ruby_2.5.9_rails5_postgres_redis.gemfile.lock +278 -0
  291. data/gemfiles/ruby_2.5.9_rails5_postgres_redis_activesupport.gemfile +46 -0
  292. data/gemfiles/ruby_2.5.9_rails5_postgres_redis_activesupport.gemfile.lock +278 -0
  293. data/gemfiles/ruby_2.5.9_rails5_postgres_sidekiq.gemfile +47 -0
  294. data/gemfiles/ruby_2.5.9_rails5_postgres_sidekiq.gemfile.lock +284 -0
  295. data/gemfiles/ruby_2.5.9_rails5_semantic_logger.gemfile +45 -0
  296. data/gemfiles/ruby_2.5.9_rails5_semantic_logger.gemfile.lock +275 -0
  297. data/gemfiles/ruby_2.5.9_rails61_mysql2.gemfile +45 -0
  298. data/gemfiles/ruby_2.5.9_rails61_mysql2.gemfile.lock +295 -0
  299. data/gemfiles/ruby_2.5.9_rails61_postgres.gemfile +45 -0
  300. data/gemfiles/ruby_2.5.9_rails61_postgres.gemfile.lock +295 -0
  301. data/gemfiles/ruby_2.5.9_rails61_postgres_redis.gemfile +46 -0
  302. data/gemfiles/ruby_2.5.9_rails61_postgres_redis.gemfile.lock +297 -0
  303. data/gemfiles/ruby_2.5.9_rails61_postgres_sidekiq.gemfile +46 -0
  304. data/gemfiles/ruby_2.5.9_rails61_postgres_sidekiq.gemfile.lock +302 -0
  305. data/gemfiles/ruby_2.5.9_rails61_semantic_logger.gemfile +45 -0
  306. data/gemfiles/ruby_2.5.9_rails61_semantic_logger.gemfile.lock +294 -0
  307. data/gemfiles/ruby_2.5.9_rails6_mysql2.gemfile +45 -0
  308. data/gemfiles/ruby_2.5.9_rails6_mysql2.gemfile.lock +292 -0
  309. data/gemfiles/ruby_2.5.9_rails6_postgres.gemfile +45 -0
  310. data/gemfiles/ruby_2.5.9_rails6_postgres.gemfile.lock +292 -0
  311. data/gemfiles/ruby_2.5.9_rails6_postgres_redis.gemfile +46 -0
  312. data/gemfiles/ruby_2.5.9_rails6_postgres_redis.gemfile.lock +294 -0
  313. data/gemfiles/ruby_2.5.9_rails6_postgres_redis_activesupport.gemfile +46 -0
  314. data/gemfiles/ruby_2.5.9_rails6_postgres_redis_activesupport.gemfile.lock +294 -0
  315. data/gemfiles/ruby_2.5.9_rails6_postgres_sidekiq.gemfile +47 -0
  316. data/gemfiles/ruby_2.5.9_rails6_postgres_sidekiq.gemfile.lock +300 -0
  317. data/gemfiles/ruby_2.5.9_rails6_semantic_logger.gemfile +45 -0
  318. data/gemfiles/ruby_2.5.9_rails6_semantic_logger.gemfile.lock +291 -0
  319. data/gemfiles/ruby_2.5.9_resque2_redis3.gemfile +41 -0
  320. data/gemfiles/ruby_2.5.9_resque2_redis3.gemfile.lock +190 -0
  321. data/gemfiles/ruby_2.5.9_resque2_redis4.gemfile +41 -0
  322. data/gemfiles/ruby_2.5.9_resque2_redis4.gemfile.lock +190 -0
  323. data/gemfiles/ruby_2.6.7_contrib.gemfile +82 -0
  324. data/gemfiles/ruby_2.6.7_contrib.gemfile.lock +1606 -0
  325. data/gemfiles/ruby_2.6.7_contrib_old.gemfile +40 -0
  326. data/gemfiles/ruby_2.6.7_contrib_old.gemfile.lock +169 -0
  327. data/gemfiles/ruby_2.6.7_core_old.gemfile +39 -0
  328. data/gemfiles/ruby_2.6.7_core_old.gemfile.lock +165 -0
  329. data/gemfiles/ruby_2.6.7_cucumber3.gemfile +40 -0
  330. data/gemfiles/ruby_2.6.7_cucumber3.gemfile.lock +186 -0
  331. data/gemfiles/ruby_2.6.7_cucumber4.gemfile +40 -0
  332. data/gemfiles/ruby_2.6.7_cucumber4.gemfile.lock +218 -0
  333. data/gemfiles/ruby_2.6.7_cucumber5.gemfile +40 -0
  334. data/gemfiles/ruby_2.6.7_cucumber5.gemfile.lock +218 -0
  335. data/gemfiles/ruby_2.6.7_rails5_mysql2.gemfile +43 -0
  336. data/gemfiles/ruby_2.6.7_rails5_mysql2.gemfile.lock +276 -0
  337. data/gemfiles/ruby_2.6.7_rails5_postgres.gemfile +43 -0
  338. data/gemfiles/ruby_2.6.7_rails5_postgres.gemfile.lock +276 -0
  339. data/gemfiles/ruby_2.6.7_rails5_postgres_redis.gemfile +44 -0
  340. data/gemfiles/ruby_2.6.7_rails5_postgres_redis.gemfile.lock +278 -0
  341. data/gemfiles/ruby_2.6.7_rails5_postgres_redis_activesupport.gemfile +44 -0
  342. data/gemfiles/ruby_2.6.7_rails5_postgres_redis_activesupport.gemfile.lock +278 -0
  343. data/gemfiles/ruby_2.6.7_rails5_postgres_sidekiq.gemfile +45 -0
  344. data/gemfiles/ruby_2.6.7_rails5_postgres_sidekiq.gemfile.lock +284 -0
  345. data/gemfiles/ruby_2.6.7_rails5_semantic_logger.gemfile +43 -0
  346. data/gemfiles/ruby_2.6.7_rails5_semantic_logger.gemfile.lock +275 -0
  347. data/gemfiles/ruby_2.6.7_rails61_mysql2.gemfile +43 -0
  348. data/gemfiles/ruby_2.6.7_rails61_mysql2.gemfile.lock +295 -0
  349. data/gemfiles/ruby_2.6.7_rails61_postgres.gemfile +43 -0
  350. data/gemfiles/ruby_2.6.7_rails61_postgres.gemfile.lock +295 -0
  351. data/gemfiles/ruby_2.6.7_rails61_postgres_redis.gemfile +44 -0
  352. data/gemfiles/ruby_2.6.7_rails61_postgres_redis.gemfile.lock +297 -0
  353. data/gemfiles/ruby_2.6.7_rails61_postgres_sidekiq.gemfile +44 -0
  354. data/gemfiles/ruby_2.6.7_rails61_postgres_sidekiq.gemfile.lock +302 -0
  355. data/gemfiles/ruby_2.6.7_rails61_semantic_logger.gemfile +43 -0
  356. data/gemfiles/ruby_2.6.7_rails61_semantic_logger.gemfile.lock +294 -0
  357. data/gemfiles/ruby_2.6.7_rails6_mysql2.gemfile +43 -0
  358. data/gemfiles/ruby_2.6.7_rails6_mysql2.gemfile.lock +292 -0
  359. data/gemfiles/ruby_2.6.7_rails6_postgres.gemfile +43 -0
  360. data/gemfiles/ruby_2.6.7_rails6_postgres.gemfile.lock +292 -0
  361. data/gemfiles/ruby_2.6.7_rails6_postgres_redis.gemfile +44 -0
  362. data/gemfiles/ruby_2.6.7_rails6_postgres_redis.gemfile.lock +294 -0
  363. data/gemfiles/ruby_2.6.7_rails6_postgres_redis_activesupport.gemfile +44 -0
  364. data/gemfiles/ruby_2.6.7_rails6_postgres_redis_activesupport.gemfile.lock +294 -0
  365. data/gemfiles/ruby_2.6.7_rails6_postgres_sidekiq.gemfile +45 -0
  366. data/gemfiles/ruby_2.6.7_rails6_postgres_sidekiq.gemfile.lock +300 -0
  367. data/gemfiles/ruby_2.6.7_rails6_semantic_logger.gemfile +43 -0
  368. data/gemfiles/ruby_2.6.7_rails6_semantic_logger.gemfile.lock +291 -0
  369. data/gemfiles/ruby_2.6.7_resque2_redis3.gemfile +41 -0
  370. data/gemfiles/ruby_2.6.7_resque2_redis3.gemfile.lock +192 -0
  371. data/gemfiles/ruby_2.6.7_resque2_redis4.gemfile +41 -0
  372. data/gemfiles/ruby_2.6.7_resque2_redis4.gemfile.lock +192 -0
  373. data/gemfiles/ruby_2.7.3_contrib.gemfile +81 -0
  374. data/gemfiles/ruby_2.7.3_contrib.gemfile.lock +1580 -0
  375. data/gemfiles/ruby_2.7.3_contrib_old.gemfile +40 -0
  376. data/gemfiles/ruby_2.7.3_contrib_old.gemfile.lock +169 -0
  377. data/gemfiles/ruby_2.7.3_core_old.gemfile +39 -0
  378. data/gemfiles/ruby_2.7.3_core_old.gemfile.lock +165 -0
  379. data/gemfiles/ruby_2.7.3_cucumber3.gemfile +40 -0
  380. data/gemfiles/ruby_2.7.3_cucumber3.gemfile.lock +186 -0
  381. data/gemfiles/ruby_2.7.3_cucumber4.gemfile +40 -0
  382. data/gemfiles/ruby_2.7.3_cucumber4.gemfile.lock +218 -0
  383. data/gemfiles/ruby_2.7.3_cucumber5.gemfile +40 -0
  384. data/gemfiles/ruby_2.7.3_cucumber5.gemfile.lock +218 -0
  385. data/gemfiles/ruby_2.7.3_rails5_mysql2.gemfile +43 -0
  386. data/gemfiles/ruby_2.7.3_rails5_mysql2.gemfile.lock +278 -0
  387. data/gemfiles/ruby_2.7.3_rails5_postgres.gemfile +43 -0
  388. data/gemfiles/ruby_2.7.3_rails5_postgres.gemfile.lock +278 -0
  389. data/gemfiles/ruby_2.7.3_rails5_postgres_redis.gemfile +45 -0
  390. data/gemfiles/ruby_2.7.3_rails5_postgres_redis.gemfile.lock +297 -0
  391. data/gemfiles/ruby_2.7.3_rails5_postgres_redis_activesupport.gemfile +45 -0
  392. data/gemfiles/ruby_2.7.3_rails5_postgres_redis_activesupport.gemfile.lock +297 -0
  393. data/gemfiles/ruby_2.7.3_rails5_postgres_sidekiq.gemfile +45 -0
  394. data/gemfiles/ruby_2.7.3_rails5_postgres_sidekiq.gemfile.lock +286 -0
  395. data/gemfiles/ruby_2.7.3_rails5_semantic_logger.gemfile +43 -0
  396. data/gemfiles/ruby_2.7.3_rails5_semantic_logger.gemfile.lock +277 -0
  397. data/gemfiles/ruby_2.7.3_rails61_mysql2.gemfile +43 -0
  398. data/gemfiles/ruby_2.7.3_rails61_mysql2.gemfile.lock +297 -0
  399. data/gemfiles/ruby_2.7.3_rails61_postgres.gemfile +43 -0
  400. data/gemfiles/ruby_2.7.3_rails61_postgres.gemfile.lock +297 -0
  401. data/gemfiles/ruby_2.7.3_rails61_postgres_redis.gemfile +44 -0
  402. data/gemfiles/ruby_2.7.3_rails61_postgres_redis.gemfile.lock +299 -0
  403. data/gemfiles/ruby_2.7.3_rails61_postgres_sidekiq.gemfile +44 -0
  404. data/gemfiles/ruby_2.7.3_rails61_postgres_sidekiq.gemfile.lock +304 -0
  405. data/gemfiles/ruby_2.7.3_rails61_semantic_logger.gemfile +43 -0
  406. data/gemfiles/ruby_2.7.3_rails61_semantic_logger.gemfile.lock +296 -0
  407. data/gemfiles/ruby_2.7.3_rails6_mysql2.gemfile +43 -0
  408. data/gemfiles/ruby_2.7.3_rails6_mysql2.gemfile.lock +294 -0
  409. data/gemfiles/ruby_2.7.3_rails6_postgres.gemfile +43 -0
  410. data/gemfiles/ruby_2.7.3_rails6_postgres.gemfile.lock +294 -0
  411. data/gemfiles/ruby_2.7.3_rails6_postgres_redis.gemfile +45 -0
  412. data/gemfiles/ruby_2.7.3_rails6_postgres_redis.gemfile.lock +313 -0
  413. data/gemfiles/ruby_2.7.3_rails6_postgres_redis_activesupport.gemfile +45 -0
  414. data/gemfiles/ruby_2.7.3_rails6_postgres_redis_activesupport.gemfile.lock +313 -0
  415. data/gemfiles/ruby_2.7.3_rails6_postgres_sidekiq.gemfile +45 -0
  416. data/gemfiles/ruby_2.7.3_rails6_postgres_sidekiq.gemfile.lock +302 -0
  417. data/gemfiles/ruby_2.7.3_rails6_semantic_logger.gemfile +43 -0
  418. data/gemfiles/ruby_2.7.3_rails6_semantic_logger.gemfile.lock +293 -0
  419. data/gemfiles/ruby_2.7.3_resque2_redis3.gemfile +41 -0
  420. data/gemfiles/ruby_2.7.3_resque2_redis3.gemfile.lock +192 -0
  421. data/gemfiles/ruby_2.7.3_resque2_redis4.gemfile +41 -0
  422. data/gemfiles/ruby_2.7.3_resque2_redis4.gemfile.lock +192 -0
  423. data/gemfiles/ruby_3.0.1_contrib.gemfile +80 -0
  424. data/gemfiles/ruby_3.0.1_contrib.gemfile.lock +1583 -0
  425. data/gemfiles/ruby_3.0.1_core_old.gemfile +40 -0
  426. data/gemfiles/ruby_3.0.1_core_old.gemfile.lock +167 -0
  427. data/gemfiles/ruby_3.0.1_cucumber3.gemfile +41 -0
  428. data/gemfiles/ruby_3.0.1_cucumber3.gemfile.lock +188 -0
  429. data/gemfiles/ruby_3.0.1_cucumber4.gemfile +41 -0
  430. data/gemfiles/ruby_3.0.1_cucumber4.gemfile.lock +220 -0
  431. data/gemfiles/ruby_3.0.1_cucumber5.gemfile +41 -0
  432. data/gemfiles/ruby_3.0.1_cucumber5.gemfile.lock +220 -0
  433. data/gemfiles/ruby_3.0.1_rails61_mysql2.gemfile +44 -0
  434. data/gemfiles/ruby_3.0.1_rails61_mysql2.gemfile.lock +297 -0
  435. data/gemfiles/ruby_3.0.1_rails61_postgres.gemfile +44 -0
  436. data/gemfiles/ruby_3.0.1_rails61_postgres.gemfile.lock +297 -0
  437. data/gemfiles/ruby_3.0.1_rails61_postgres_redis.gemfile +45 -0
  438. data/gemfiles/ruby_3.0.1_rails61_postgres_redis.gemfile.lock +299 -0
  439. data/gemfiles/ruby_3.0.1_rails61_postgres_sidekiq.gemfile +46 -0
  440. data/gemfiles/ruby_3.0.1_rails61_postgres_sidekiq.gemfile.lock +311 -0
  441. data/gemfiles/ruby_3.0.1_rails61_semantic_logger.gemfile +44 -0
  442. data/gemfiles/ruby_3.0.1_rails61_semantic_logger.gemfile.lock +296 -0
  443. data/gemfiles/ruby_3.0.1_resque2_redis3.gemfile +42 -0
  444. data/gemfiles/ruby_3.0.1_resque2_redis3.gemfile.lock +194 -0
  445. data/gemfiles/ruby_3.0.1_resque2_redis4.gemfile +42 -0
  446. data/gemfiles/ruby_3.0.1_resque2_redis4.gemfile.lock +194 -0
  447. data/integration/README.md +1 -2
  448. data/integration/apps/rack/Dockerfile +3 -0
  449. data/integration/apps/rack/README.md +2 -2
  450. data/integration/apps/rack/script/build-images +1 -1
  451. data/integration/apps/rack/script/ci +3 -2
  452. data/integration/apps/rails-five/README.md +2 -2
  453. data/integration/apps/rails-five/script/build-images +1 -1
  454. data/integration/apps/rails-five/script/ci +3 -2
  455. data/integration/apps/rspec/.dockerignore +1 -0
  456. data/integration/apps/rspec/.envrc.sample +1 -0
  457. data/integration/apps/rspec/.gitignore +2 -0
  458. data/integration/apps/rspec/.rspec +1 -0
  459. data/integration/apps/rspec/Dockerfile +25 -0
  460. data/integration/apps/rspec/Dockerfile-ci +11 -0
  461. data/integration/apps/rspec/Gemfile +14 -0
  462. data/integration/apps/rspec/README.md +70 -0
  463. data/integration/apps/rspec/agent.yaml +3 -0
  464. data/integration/apps/rspec/app/datadog.rb +13 -0
  465. data/integration/apps/rspec/app/fibonacci.rb +30 -0
  466. data/integration/apps/rspec/bin/run +20 -0
  467. data/integration/apps/rspec/bin/setup +23 -0
  468. data/integration/apps/rspec/bin/test +21 -0
  469. data/integration/apps/rspec/docker-compose.ci.yml +51 -0
  470. data/integration/apps/rspec/docker-compose.yml +64 -0
  471. data/integration/apps/rspec/script/build-images +37 -0
  472. data/integration/apps/rspec/script/ci +53 -0
  473. data/integration/apps/rspec/spec/fibonacci_spec.rb +16 -0
  474. data/integration/apps/rspec/spec/rspec_spec.rb +58 -0
  475. data/integration/apps/rspec/spec/spec_helper.rb +24 -0
  476. data/integration/apps/ruby/README.md +2 -2
  477. data/integration/apps/ruby/script/build-images +1 -1
  478. data/integration/apps/ruby/script/ci +3 -2
  479. data/integration/images/include/datadog/demo_env.rb +15 -14
  480. data/integration/images/include/http-health-check +1 -1
  481. data/integration/images/wrk/scripts/entrypoint.sh +1 -1
  482. data/integration/script/build-images +1 -1
  483. data/lib/datadog/ci.rb +16 -0
  484. data/lib/datadog/ci/configuration/components.rb +30 -0
  485. data/lib/datadog/ci/configuration/settings.rb +36 -0
  486. data/lib/datadog/ci/context_flush.rb +28 -0
  487. data/lib/datadog/ci/contrib/cucumber/configuration/settings.rb +30 -0
  488. data/lib/datadog/ci/contrib/cucumber/ext.rb +19 -0
  489. data/lib/datadog/ci/contrib/cucumber/formatter.rb +97 -0
  490. data/lib/datadog/ci/contrib/cucumber/instrumentation.rb +26 -0
  491. data/lib/datadog/ci/contrib/cucumber/integration.rb +47 -0
  492. data/lib/datadog/ci/contrib/cucumber/patcher.rb +25 -0
  493. data/lib/datadog/ci/contrib/rspec/configuration/settings.rb +30 -0
  494. data/lib/datadog/ci/contrib/rspec/example.rb +73 -0
  495. data/lib/datadog/ci/contrib/rspec/ext.rb +18 -0
  496. data/lib/datadog/ci/contrib/rspec/integration.rb +48 -0
  497. data/lib/datadog/ci/contrib/rspec/patcher.rb +25 -0
  498. data/lib/datadog/ci/ext/app_types.rb +9 -0
  499. data/lib/datadog/ci/ext/environment.rb +438 -0
  500. data/lib/datadog/ci/ext/settings.rb +10 -0
  501. data/lib/datadog/ci/ext/test.rb +34 -0
  502. data/lib/datadog/ci/extensions.rb +17 -0
  503. data/lib/datadog/ci/test.rb +76 -0
  504. data/lib/datadog/core/environment/cgroup.rb +49 -0
  505. data/lib/datadog/core/environment/class_count.rb +19 -0
  506. data/lib/datadog/core/environment/container.rb +88 -0
  507. data/lib/datadog/core/environment/ext.rb +26 -0
  508. data/lib/datadog/core/environment/gc.rb +18 -0
  509. data/lib/datadog/core/environment/identity.rb +50 -0
  510. data/lib/datadog/core/environment/object_space.rb +22 -0
  511. data/lib/datadog/core/environment/socket.rb +16 -0
  512. data/lib/datadog/core/environment/thread_count.rb +18 -0
  513. data/lib/datadog/core/environment/variable_helpers.rb +39 -0
  514. data/lib/ddtrace.rb +3 -2
  515. data/lib/ddtrace/auto_instrument.rb +1 -0
  516. data/lib/ddtrace/buffer.rb +2 -2
  517. data/lib/ddtrace/configuration.rb +98 -25
  518. data/lib/ddtrace/configuration/agent_settings_resolver.rb +230 -0
  519. data/lib/ddtrace/configuration/base.rb +7 -10
  520. data/lib/ddtrace/configuration/components.rb +150 -23
  521. data/lib/ddtrace/configuration/options.rb +4 -6
  522. data/lib/ddtrace/configuration/settings.rb +104 -7
  523. data/lib/ddtrace/context.rb +17 -14
  524. data/lib/ddtrace/context_flush.rb +14 -2
  525. data/lib/ddtrace/context_provider.rb +0 -2
  526. data/lib/ddtrace/contrib/action_cable/event.rb +4 -4
  527. data/lib/ddtrace/contrib/action_pack/action_controller/instrumentation.rb +1 -1
  528. data/lib/ddtrace/contrib/action_pack/action_controller/patcher.rb +1 -1
  529. data/lib/ddtrace/contrib/action_pack/utils.rb +1 -1
  530. data/lib/ddtrace/contrib/action_view/event.rb +2 -2
  531. data/lib/ddtrace/contrib/action_view/patcher.rb +4 -4
  532. data/lib/ddtrace/contrib/active_model_serializers/event.rb +2 -2
  533. data/lib/ddtrace/contrib/active_record/configuration/makara_resolver.rb +30 -0
  534. data/lib/ddtrace/contrib/active_record/configuration/resolver.rb +103 -26
  535. data/lib/ddtrace/contrib/active_record/event.rb +2 -2
  536. data/lib/ddtrace/contrib/active_record/utils.rb +2 -2
  537. data/lib/ddtrace/contrib/active_support/cache/patcher.rb +7 -7
  538. data/lib/ddtrace/contrib/active_support/cache/redis.rb +1 -5
  539. data/lib/ddtrace/contrib/active_support/notifications/event.rb +2 -2
  540. data/lib/ddtrace/contrib/active_support/notifications/subscriber.rb +1 -1
  541. data/lib/ddtrace/contrib/auto_instrument.rb +1 -2
  542. data/lib/ddtrace/contrib/aws/instrumentation.rb +29 -0
  543. data/lib/ddtrace/contrib/aws/patcher.rb +4 -0
  544. data/lib/ddtrace/contrib/aws/services.rb +1 -0
  545. data/lib/ddtrace/contrib/concurrent_ruby/patcher.rb +1 -1
  546. data/lib/ddtrace/contrib/configurable.rb +64 -40
  547. data/lib/ddtrace/contrib/configuration/resolver.rb +70 -5
  548. data/lib/ddtrace/contrib/configuration/resolvers/pattern_resolver.rb +19 -17
  549. data/lib/ddtrace/contrib/configuration/settings.rb +7 -6
  550. data/lib/ddtrace/contrib/dalli/instrumentation.rb +1 -1
  551. data/lib/ddtrace/contrib/dalli/patcher.rb +1 -1
  552. data/lib/ddtrace/contrib/elasticsearch/patcher.rb +1 -0
  553. data/lib/ddtrace/contrib/ethon/easy_patch.rb +1 -1
  554. data/lib/ddtrace/contrib/ethon/multi_patch.rb +1 -1
  555. data/lib/ddtrace/contrib/ethon/patcher.rb +2 -2
  556. data/lib/ddtrace/contrib/extensions.rb +29 -6
  557. data/lib/ddtrace/contrib/faraday/patcher.rb +2 -2
  558. data/lib/ddtrace/contrib/grape/instrumentation.rb +2 -2
  559. data/lib/ddtrace/contrib/grape/patcher.rb +1 -1
  560. data/lib/ddtrace/contrib/grpc/patcher.rb +1 -1
  561. data/lib/ddtrace/contrib/http/instrumentation.rb +1 -1
  562. data/lib/ddtrace/contrib/http/patcher.rb +1 -1
  563. data/lib/ddtrace/contrib/httpclient/instrumentation.rb +13 -17
  564. data/lib/ddtrace/contrib/httpclient/patcher.rb +6 -3
  565. data/lib/ddtrace/contrib/httprb/instrumentation.rb +13 -18
  566. data/lib/ddtrace/contrib/httprb/patcher.rb +6 -3
  567. data/lib/ddtrace/contrib/integration.rb +3 -3
  568. data/lib/ddtrace/contrib/kafka/event.rb +2 -2
  569. data/lib/ddtrace/contrib/lograge/configuration/settings.rb +18 -0
  570. data/lib/ddtrace/contrib/lograge/ext.rb +10 -0
  571. data/lib/ddtrace/contrib/lograge/instrumentation.rb +38 -0
  572. data/lib/ddtrace/contrib/lograge/integration.rb +45 -0
  573. data/lib/ddtrace/contrib/{rspec → lograge}/patcher.rb +6 -4
  574. data/lib/ddtrace/contrib/mongodb/instrumentation.rb +2 -2
  575. data/lib/ddtrace/contrib/mongodb/patcher.rb +2 -2
  576. data/lib/ddtrace/contrib/mysql2/instrumentation.rb +1 -1
  577. data/lib/ddtrace/contrib/mysql2/patcher.rb +1 -1
  578. data/lib/ddtrace/contrib/patchable.rb +2 -2
  579. data/lib/ddtrace/contrib/patcher.rb +10 -7
  580. data/lib/ddtrace/contrib/presto/instrumentation.rb +1 -1
  581. data/lib/ddtrace/contrib/presto/patcher.rb +6 -3
  582. data/lib/ddtrace/contrib/qless/patcher.rb +3 -5
  583. data/lib/ddtrace/contrib/racecar/event.rb +2 -2
  584. data/lib/ddtrace/contrib/rack/middlewares.rb +1 -1
  585. data/lib/ddtrace/contrib/rails/framework.rb +25 -1
  586. data/lib/ddtrace/contrib/rails/log_injection.rb +0 -40
  587. data/lib/ddtrace/contrib/rails/patcher.rb +17 -11
  588. data/lib/ddtrace/contrib/rake/instrumentation.rb +1 -1
  589. data/lib/ddtrace/contrib/rake/patcher.rb +1 -1
  590. data/lib/ddtrace/contrib/redis/configuration/resolver.rb +11 -4
  591. data/lib/ddtrace/contrib/registerable.rb +2 -2
  592. data/lib/ddtrace/contrib/resque/configuration/settings.rb +17 -1
  593. data/lib/ddtrace/contrib/resque/integration.rb +1 -1
  594. data/lib/ddtrace/contrib/resque/patcher.rb +4 -4
  595. data/lib/ddtrace/contrib/resque/resque_job.rb +22 -1
  596. data/lib/ddtrace/contrib/rest_client/patcher.rb +1 -1
  597. data/lib/ddtrace/contrib/rest_client/request_patch.rb +1 -1
  598. data/lib/ddtrace/contrib/semantic_logger/configuration/settings.rb +18 -0
  599. data/lib/ddtrace/contrib/semantic_logger/ext.rb +10 -0
  600. data/lib/ddtrace/contrib/semantic_logger/instrumentation.rb +42 -0
  601. data/lib/ddtrace/contrib/semantic_logger/integration.rb +47 -0
  602. data/lib/ddtrace/contrib/semantic_logger/patcher.rb +25 -0
  603. data/lib/ddtrace/contrib/sequel/database.rb +1 -1
  604. data/lib/ddtrace/contrib/sequel/dataset.rb +1 -1
  605. data/lib/ddtrace/contrib/sequel/patcher.rb +2 -2
  606. data/lib/ddtrace/contrib/shoryuken/configuration/settings.rb +1 -0
  607. data/lib/ddtrace/contrib/shoryuken/tracer.rb +7 -3
  608. data/lib/ddtrace/contrib/sinatra/patcher.rb +1 -1
  609. data/lib/ddtrace/contrib/sucker_punch/exception_handler.rb +4 -6
  610. data/lib/ddtrace/contrib/sucker_punch/instrumentation.rb +4 -0
  611. data/lib/ddtrace/correlation.rb +1 -1
  612. data/lib/ddtrace/diagnostics/environment_logger.rb +5 -5
  613. data/lib/ddtrace/error.rb +77 -8
  614. data/lib/ddtrace/ext/app_types.rb +0 -1
  615. data/lib/ddtrace/ext/environment.rb +7 -0
  616. data/lib/ddtrace/ext/git.rb +9 -1
  617. data/lib/ddtrace/ext/profiling.rb +53 -0
  618. data/lib/ddtrace/ext/runtime.rb +0 -7
  619. data/lib/ddtrace/ext/test.rb +2 -18
  620. data/lib/ddtrace/ext/transport.rb +2 -0
  621. data/lib/ddtrace/metrics.rb +68 -13
  622. data/lib/ddtrace/opentelemetry/extensions.rb +1 -1
  623. data/lib/ddtrace/opentracer.rb +20 -39
  624. data/lib/ddtrace/patcher.rb +25 -3
  625. data/lib/ddtrace/pin.rb +5 -9
  626. data/lib/ddtrace/profiling.rb +107 -0
  627. data/lib/ddtrace/profiling/backtrace_location.rb +32 -0
  628. data/lib/ddtrace/profiling/buffer.rb +41 -0
  629. data/lib/ddtrace/profiling/collectors/stack.rb +262 -0
  630. data/lib/ddtrace/profiling/encoding/profile.rb +37 -0
  631. data/lib/ddtrace/profiling/event.rb +13 -0
  632. data/lib/ddtrace/profiling/events/stack.rb +102 -0
  633. data/lib/ddtrace/profiling/exporter.rb +23 -0
  634. data/lib/ddtrace/profiling/ext/cpu.rb +67 -0
  635. data/lib/ddtrace/profiling/ext/cthread.rb +155 -0
  636. data/lib/ddtrace/profiling/ext/forking.rb +97 -0
  637. data/lib/ddtrace/profiling/flush.rb +43 -0
  638. data/lib/ddtrace/profiling/pprof/builder.rb +119 -0
  639. data/lib/ddtrace/profiling/pprof/converter.rb +89 -0
  640. data/lib/ddtrace/profiling/pprof/message_set.rb +12 -0
  641. data/lib/ddtrace/profiling/pprof/payload.rb +18 -0
  642. data/lib/ddtrace/profiling/pprof/pprof.proto +212 -0
  643. data/lib/ddtrace/profiling/pprof/pprof_pb.rb +81 -0
  644. data/lib/ddtrace/profiling/pprof/stack_sample.rb +106 -0
  645. data/lib/ddtrace/profiling/pprof/string_table.rb +10 -0
  646. data/lib/ddtrace/profiling/pprof/template.rb +118 -0
  647. data/lib/ddtrace/profiling/preload.rb +3 -0
  648. data/lib/ddtrace/profiling/profiler.rb +30 -0
  649. data/lib/ddtrace/profiling/recorder.rb +95 -0
  650. data/lib/ddtrace/profiling/scheduler.rb +116 -0
  651. data/lib/ddtrace/profiling/tasks/setup.rb +77 -0
  652. data/lib/ddtrace/profiling/transport/client.rb +12 -0
  653. data/lib/ddtrace/profiling/transport/http.rb +118 -0
  654. data/lib/ddtrace/profiling/transport/http/api.rb +43 -0
  655. data/lib/ddtrace/profiling/transport/http/api/endpoint.rb +100 -0
  656. data/lib/ddtrace/profiling/transport/http/api/instance.rb +36 -0
  657. data/lib/ddtrace/profiling/transport/http/api/spec.rb +40 -0
  658. data/lib/ddtrace/profiling/transport/http/builder.rb +28 -0
  659. data/lib/ddtrace/profiling/transport/http/client.rb +33 -0
  660. data/lib/ddtrace/profiling/transport/http/response.rb +21 -0
  661. data/lib/ddtrace/profiling/transport/io.rb +30 -0
  662. data/lib/ddtrace/profiling/transport/io/client.rb +27 -0
  663. data/lib/ddtrace/profiling/transport/io/response.rb +16 -0
  664. data/lib/ddtrace/profiling/transport/parcel.rb +17 -0
  665. data/lib/ddtrace/profiling/transport/request.rb +15 -0
  666. data/lib/ddtrace/profiling/transport/response.rb +8 -0
  667. data/lib/ddtrace/runtime/metrics.rb +20 -14
  668. data/lib/ddtrace/sampling/rule_sampler.rb +3 -9
  669. data/lib/ddtrace/span.rb +17 -6
  670. data/lib/ddtrace/sync_writer.rb +9 -5
  671. data/lib/ddtrace/tasks/exec.rb +48 -0
  672. data/lib/ddtrace/tasks/help.rb +14 -0
  673. data/lib/ddtrace/tracer.rb +46 -48
  674. data/lib/ddtrace/transport/http.rb +47 -35
  675. data/lib/ddtrace/transport/http/adapters/net.rb +18 -4
  676. data/lib/ddtrace/transport/http/builder.rb +5 -1
  677. data/lib/ddtrace/transport/http/env.rb +8 -0
  678. data/lib/ddtrace/transport/http/statistics.rb +2 -2
  679. data/lib/ddtrace/transport/http/traces.rb +3 -3
  680. data/lib/ddtrace/transport/io/client.rb +15 -8
  681. data/lib/ddtrace/transport/io/response.rb +1 -3
  682. data/lib/ddtrace/transport/io/traces.rb +7 -1
  683. data/lib/ddtrace/transport/parcel.rb +4 -0
  684. data/lib/ddtrace/transport/traces.rb +15 -1
  685. data/lib/ddtrace/utils/compression.rb +27 -0
  686. data/lib/ddtrace/utils/forking.rb +1 -1
  687. data/lib/ddtrace/utils/object_set.rb +39 -0
  688. data/lib/ddtrace/utils/only_once.rb +40 -0
  689. data/lib/ddtrace/utils/sequence.rb +17 -0
  690. data/lib/ddtrace/utils/string_table.rb +45 -0
  691. data/lib/ddtrace/utils/time.rb +8 -3
  692. data/lib/ddtrace/vendor/multipart-post/LICENSE +11 -0
  693. data/lib/ddtrace/vendor/multipart-post/multipart.rb +12 -0
  694. data/lib/ddtrace/vendor/multipart-post/multipart/post.rb +8 -0
  695. data/lib/ddtrace/vendor/multipart-post/multipart/post/composite_read_io.rb +116 -0
  696. data/lib/ddtrace/vendor/multipart-post/multipart/post/multipartable.rb +57 -0
  697. data/lib/ddtrace/vendor/multipart-post/multipart/post/parts.rb +135 -0
  698. data/lib/ddtrace/vendor/multipart-post/multipart/post/version.rb +9 -0
  699. data/lib/ddtrace/vendor/multipart-post/net/http/post/multipart.rb +32 -0
  700. data/lib/ddtrace/version.rb +14 -2
  701. data/lib/ddtrace/workers.rb +1 -1
  702. data/lib/ddtrace/workers/async.rb +5 -4
  703. data/lib/ddtrace/workers/loop.rb +28 -5
  704. data/lib/ddtrace/workers/polling.rb +11 -5
  705. data/lib/ddtrace/workers/queue.rb +2 -1
  706. data/lib/ddtrace/workers/runtime_metrics.rb +14 -1
  707. data/lib/ddtrace/workers/trace_writer.rb +4 -6
  708. data/lib/ddtrace/writer.rb +10 -4
  709. data/tasks/update_appraisal_gemfiles.rake +36 -0
  710. metadata +576 -38
  711. data/.circleci/images/primary/Dockerfile-2.0.0 +0 -73
  712. data/integration/images/ruby/2.0/Dockerfile +0 -54
  713. data/lib/ddtrace/contrib/cucumber/configuration/settings.rb +0 -28
  714. data/lib/ddtrace/contrib/cucumber/ext.rb +0 -17
  715. data/lib/ddtrace/contrib/cucumber/formatter.rb +0 -98
  716. data/lib/ddtrace/contrib/cucumber/instrumentation.rb +0 -24
  717. data/lib/ddtrace/contrib/cucumber/integration.rb +0 -45
  718. data/lib/ddtrace/contrib/cucumber/patcher.rb +0 -23
  719. data/lib/ddtrace/contrib/rspec/configuration/settings.rb +0 -28
  720. data/lib/ddtrace/contrib/rspec/example.rb +0 -75
  721. data/lib/ddtrace/contrib/rspec/ext.rb +0 -16
  722. data/lib/ddtrace/contrib/rspec/integration.rb +0 -46
  723. data/lib/ddtrace/environment.rb +0 -41
  724. data/lib/ddtrace/ext/ci.rb +0 -297
  725. data/lib/ddtrace/runtime/cgroup.rb +0 -44
  726. data/lib/ddtrace/runtime/class_count.rb +0 -17
  727. data/lib/ddtrace/runtime/container.rb +0 -73
  728. data/lib/ddtrace/runtime/gc.rb +0 -16
  729. data/lib/ddtrace/runtime/identity.rb +0 -40
  730. data/lib/ddtrace/runtime/object_space.rb +0 -19
  731. data/lib/ddtrace/runtime/socket.rb +0 -14
  732. data/lib/ddtrace/runtime/thread_count.rb +0 -16
@@ -0,0 +1,10 @@
1
+ module Datadog
2
+ module CI
3
+ module Ext
4
+ # Defines constants for test tags
5
+ module Settings
6
+ ENV_MODE_ENABLED = 'DD_TRACE_CI_MODE_ENABLED'.freeze
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,34 @@
1
+ module Datadog
2
+ module CI
3
+ module Ext
4
+ # Defines constants for test tags
5
+ module Test
6
+ CONTEXT_ORIGIN = 'ciapp-test'.freeze
7
+
8
+ TAG_ARGUMENTS = 'test.arguments'.freeze
9
+ TAG_FRAMEWORK = 'test.framework'.freeze
10
+ TAG_NAME = 'test.name'.freeze
11
+ TAG_SKIP_REASON = 'test.skip_reason'.freeze # DEV: Not populated yet
12
+ TAG_STATUS = 'test.status'.freeze
13
+ TAG_SUITE = 'test.suite'.freeze
14
+ TAG_TRAITS = 'test.traits'.freeze
15
+ TAG_TYPE = 'test.type'.freeze
16
+
17
+ # Environment runtime tags
18
+ TAG_OS_ARCHITECTURE = 'os.architecture'.freeze
19
+ TAG_OS_PLATFORM = 'os.platform'.freeze
20
+ TAG_RUNTIME_NAME = 'runtime.name'.freeze
21
+ TAG_RUNTIME_VERSION = 'runtime.version'.freeze
22
+
23
+ # TODO: is there a better place for SPAN_KIND?
24
+ TAG_SPAN_KIND = 'span.kind'.freeze
25
+
26
+ module Status
27
+ PASS = 'pass'.freeze
28
+ FAIL = 'fail'.freeze
29
+ SKIP = 'skip'.freeze
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,17 @@
1
+ require 'ddtrace/configuration/settings'
2
+ require 'ddtrace/configuration/components'
3
+
4
+ require 'datadog/ci/configuration/settings'
5
+ require 'datadog/ci/configuration/components'
6
+
7
+ module Datadog
8
+ module CI
9
+ # Extends Datadog tracing with CI features
10
+ module Extensions
11
+ def self.activate!
12
+ Datadog::Configuration::Settings.extend(CI::Configuration::Settings)
13
+ Datadog::Configuration::Components.prepend(CI::Configuration::Components)
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,76 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'ddtrace/contrib/analytics'
4
+
5
+ require 'datadog/ci/ext/app_types'
6
+ require 'datadog/ci/ext/test'
7
+
8
+ require 'rbconfig'
9
+
10
+ module Datadog
11
+ module CI
12
+ # Common behavior for CI tests
13
+ module Test
14
+ # Creates a new span for a CI test
15
+ def self.trace(tracer, span_name, options = {})
16
+ span_options = {
17
+ span_type: Ext::AppTypes::TEST
18
+ }.merge(options[:span_options] || {})
19
+
20
+ if block_given?
21
+ tracer.trace(span_name, span_options) do |span|
22
+ set_tags!(span, options)
23
+ yield(span)
24
+ end
25
+ else
26
+ span = tracer.trace(span_name, span_options)
27
+ set_tags!(span, options)
28
+ span
29
+ end
30
+ end
31
+
32
+ # Adds tags to a CI test span.
33
+ def self.set_tags!(span, tags = {})
34
+ tags ||= {}
35
+
36
+ # Set default tags
37
+ span.context.origin = Ext::Test::CONTEXT_ORIGIN if span.context
38
+ Datadog::Contrib::Analytics.set_measured(span)
39
+ span.set_tag(Ext::Test::TAG_SPAN_KIND, Ext::AppTypes::TEST)
40
+ Ext::Environment.tags(ENV).each { |k, v| span.set_tag(k, v) }
41
+
42
+ # Set contextual tags
43
+ span.set_tag(Ext::Test::TAG_FRAMEWORK, tags[:framework]) if tags[:framework]
44
+ span.set_tag(Ext::Test::TAG_NAME, tags[:test_name]) if tags[:test_name]
45
+ span.set_tag(Ext::Test::TAG_SUITE, tags[:test_suite]) if tags[:test_suite]
46
+ span.set_tag(Ext::Test::TAG_TYPE, tags[:test_type]) if tags[:test_type]
47
+
48
+ set_environment_runtime_tags!(span)
49
+
50
+ span
51
+ end
52
+
53
+ def self.passed!(span)
54
+ span.set_tag(Ext::Test::TAG_STATUS, Ext::Test::Status::PASS)
55
+ end
56
+
57
+ def self.failed!(span, exception = nil)
58
+ span.status = 1
59
+ span.set_tag(Ext::Test::TAG_STATUS, Ext::Test::Status::FAIL)
60
+ span.set_error(exception) unless exception.nil?
61
+ end
62
+
63
+ def self.skipped!(span, exception = nil)
64
+ span.set_tag(Ext::Test::TAG_STATUS, Ext::Test::Status::SKIP)
65
+ span.set_error(exception) unless exception.nil?
66
+ end
67
+
68
+ private_class_method def self.set_environment_runtime_tags!(span)
69
+ span.set_tag(Ext::Test::TAG_OS_ARCHITECTURE, ::RbConfig::CONFIG['host_cpu'])
70
+ span.set_tag(Ext::Test::TAG_OS_PLATFORM, ::RbConfig::CONFIG['host_os'])
71
+ span.set_tag(Ext::Test::TAG_RUNTIME_NAME, Core::Environment::Ext::LANG_ENGINE)
72
+ span.set_tag(Ext::Test::TAG_RUNTIME_VERSION, Core::Environment::Ext::ENGINE_VERSION)
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,49 @@
1
+ require 'datadog/core/environment/ext'
2
+
3
+ module Datadog
4
+ module Core
5
+ module Environment
6
+ # Reads information from Linux cgroups.
7
+ # This information is used to extract information
8
+ # about the current Linux container identity.
9
+ # @see https://man7.org/linux/man-pages/man7/cgroups.7.html
10
+ module Cgroup
11
+ LINE_REGEX = /^(\d+):([^:]*):(.+)$/.freeze
12
+
13
+ Descriptor = Struct.new(
14
+ :id,
15
+ :groups,
16
+ :path,
17
+ :controllers
18
+ )
19
+
20
+ module_function
21
+
22
+ def descriptors(process = 'self')
23
+ [].tap do |descriptors|
24
+ begin
25
+ filepath = "/proc/#{process}/cgroup"
26
+
27
+ if File.exist?(filepath)
28
+ File.foreach("/proc/#{process}/cgroup") do |line|
29
+ line = line.strip
30
+ descriptors << parse(line) unless line.empty?
31
+ end
32
+ end
33
+ rescue StandardError => e
34
+ Datadog.logger.error("Error while parsing cgroup. Cause: #{e.message} Location: #{e.backtrace.first}")
35
+ end
36
+ end
37
+ end
38
+
39
+ def parse(line)
40
+ id, groups, path = line.scan(LINE_REGEX).first
41
+
42
+ Descriptor.new(id, groups, path).tap do |descriptor|
43
+ descriptor.controllers = groups.split(',') unless groups.nil?
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,19 @@
1
+ module Datadog
2
+ module Core
3
+ module Environment
4
+ # Retrieves number of classes from runtime
5
+ module ClassCount
6
+ module_function
7
+
8
+ def value
9
+ ::ObjectSpace.count_objects[:T_CLASS]
10
+ end
11
+
12
+ def available?
13
+ ::ObjectSpace.respond_to?(:count_objects) \
14
+ && ::ObjectSpace.count_objects.key?(:T_CLASS)
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,88 @@
1
+ require 'datadog/core/environment/cgroup'
2
+
3
+ module Datadog
4
+ module Core
5
+ module Environment
6
+ # For container environments
7
+ module Container
8
+ UUID_PATTERN = '[0-9a-f]{8}[-_]?[0-9a-f]{4}[-_]?[0-9a-f]{4}[-_]?[0-9a-f]{4}[-_]?[0-9a-f]{12}'.freeze
9
+ CONTAINER_PATTERN = '[0-9a-f]{64}'.freeze
10
+
11
+ PLATFORM_REGEX = /(?<platform>.*?)(?:.slice)?$/.freeze
12
+ POD_REGEX = /(?<pod>(pod)?#{UUID_PATTERN})(?:.slice)?$/.freeze
13
+ CONTAINER_REGEX = /(?<container>#{UUID_PATTERN}|#{CONTAINER_PATTERN})(?:.scope)?$/.freeze
14
+ FARGATE_14_CONTAINER_REGEX = /(?<container>[0-9a-f]{32}-[0-9]{10})/.freeze
15
+
16
+ Descriptor = Struct.new(
17
+ :platform,
18
+ :container_id,
19
+ :task_uid
20
+ )
21
+
22
+ module_function
23
+
24
+ def platform
25
+ descriptor.platform
26
+ end
27
+
28
+ def container_id
29
+ descriptor.container_id
30
+ end
31
+
32
+ def task_uid
33
+ descriptor.task_uid
34
+ end
35
+
36
+ def descriptor
37
+ @descriptor ||= Descriptor.new.tap do |descriptor|
38
+ begin
39
+ Cgroup.descriptors.each do |cgroup_descriptor|
40
+ # Parse container data from cgroup descriptor
41
+ path = cgroup_descriptor.path
42
+ next if path.nil?
43
+
44
+ # Split path into parts
45
+ parts = path.split('/')
46
+ parts.shift # Remove leading empty part
47
+
48
+ # Read info from path
49
+ next if parts.empty?
50
+
51
+ platform = parts[0][PLATFORM_REGEX, :platform]
52
+ container_id, task_uid = nil
53
+
54
+ case parts.length
55
+ when 0..1
56
+ next
57
+ when 2
58
+ container_id = parts[-1][CONTAINER_REGEX, :container] \
59
+ || parts[-1][FARGATE_14_CONTAINER_REGEX, :container]
60
+ else
61
+ if (container_id = parts[-1][CONTAINER_REGEX, :container])
62
+ task_uid = parts[-2][POD_REGEX, :pod]
63
+ else
64
+ container_id = parts[-1][FARGATE_14_CONTAINER_REGEX, :container]
65
+ end
66
+ end
67
+
68
+ # If container ID wasn't found, ignore.
69
+ # Path might describe a non-container environment.
70
+ next if container_id.nil?
71
+
72
+ descriptor.platform = platform
73
+ descriptor.container_id = container_id
74
+ descriptor.task_uid = task_uid
75
+
76
+ break
77
+ end
78
+ rescue StandardError => e
79
+ Datadog.logger.error(
80
+ "Error while parsing container info. Cause: #{e.message} Location: #{e.backtrace.first}"
81
+ )
82
+ end
83
+ end
84
+ end
85
+ end
86
+ end
87
+ end
88
+ end
@@ -0,0 +1,26 @@
1
+ require 'ddtrace/version'
2
+
3
+ module Datadog
4
+ module Core
5
+ module Environment
6
+ module Ext
7
+ # Identity
8
+ LANG = 'ruby'.freeze
9
+ LANG_ENGINE = RUBY_ENGINE
10
+ LANG_INTERPRETER = "#{RUBY_ENGINE}-#{RUBY_PLATFORM}".freeze
11
+ LANG_PLATFORM = RUBY_PLATFORM
12
+ LANG_VERSION = RUBY_VERSION
13
+ RUBY_ENGINE = ::RUBY_ENGINE # e.g. 'ruby', 'jruby', 'truffleruby'
14
+ TRACER_VERSION = Datadog::VERSION::STRING
15
+
16
+ # e.g for CRuby '3.0.1', for JRuby '9.2.19.0', for TruffleRuby '21.1.0'
17
+ ENGINE_VERSION = if defined?(RUBY_ENGINE_VERSION)
18
+ RUBY_ENGINE_VERSION
19
+ else
20
+ # CRuby < 2.3 doesn't support RUBY_ENGINE_VERSION
21
+ RUBY_VERSION
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,18 @@
1
+ module Datadog
2
+ module Core
3
+ module Environment
4
+ # Retrieves garbage collection statistics
5
+ module GC
6
+ module_function
7
+
8
+ def stat
9
+ ::GC.stat
10
+ end
11
+
12
+ def available?
13
+ defined?(::GC) && ::GC.respond_to?(:stat)
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,50 @@
1
+ require 'securerandom'
2
+ require 'datadog/core/environment/ext'
3
+ require 'ddtrace/utils/forking'
4
+
5
+ module Datadog
6
+ module Core
7
+ module Environment
8
+ # For runtime identity
9
+ module Identity
10
+ extend Datadog::Utils::Forking
11
+
12
+ module_function
13
+
14
+ # Retrieves number of classes from runtime
15
+ def id
16
+ @id ||= SecureRandom.uuid
17
+
18
+ # Check if runtime has changed, e.g. forked.
19
+ after_fork! { @id = SecureRandom.uuid }
20
+
21
+ @id
22
+ end
23
+
24
+ def lang
25
+ Core::Environment::Ext::LANG
26
+ end
27
+
28
+ def lang_engine
29
+ Core::Environment::Ext::LANG_ENGINE
30
+ end
31
+
32
+ def lang_interpreter
33
+ Core::Environment::Ext::LANG_INTERPRETER
34
+ end
35
+
36
+ def lang_platform
37
+ Core::Environment::Ext::LANG_PLATFORM
38
+ end
39
+
40
+ def lang_version
41
+ Core::Environment::Ext::LANG_VERSION
42
+ end
43
+
44
+ def tracer_version
45
+ Core::Environment::Ext::TRACER_VERSION
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,22 @@
1
+ require 'objspace'
2
+
3
+ module Datadog
4
+ module Core
5
+ module Environment
6
+ # Retrieves garbage collection statistics
7
+ # DEV: Currently only used for testing.
8
+ module ObjectSpace
9
+ module_function
10
+
11
+ def estimate_bytesize(object)
12
+ return 0 unless ::ObjectSpace.respond_to?(:memsize_of)
13
+
14
+ # Rough calculation of bytesize; not very accurate.
15
+ object.instance_variables.inject(::ObjectSpace.memsize_of(object)) do |sum, var|
16
+ sum + ::ObjectSpace.memsize_of(object.instance_variable_get(var))
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,16 @@
1
+ require 'socket'
2
+
3
+ module Datadog
4
+ module Core
5
+ module Environment
6
+ # For runtime identity
7
+ module Socket
8
+ module_function
9
+
10
+ def hostname
11
+ ::Socket.gethostname
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,18 @@
1
+ module Datadog
2
+ module Core
3
+ module Environment
4
+ # Retrieves number of threads from runtime
5
+ module ThreadCount
6
+ module_function
7
+
8
+ def value
9
+ Thread.list.count
10
+ end
11
+
12
+ def available?
13
+ Thread.respond_to?(:list)
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end