ddtrace 0.50.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1625) hide show
  1. checksums.yaml +4 -4
  2. data/.editorconfig +22 -0
  3. data/.gitignore +10 -0
  4. data/CHANGELOG.md +430 -11
  5. data/CONTRIBUTING.md +1 -5
  6. data/LICENSE-3rdparty.csv +2 -1
  7. data/README.md +4 -0
  8. data/bin/ddtracerb +5 -5
  9. data/ddtrace.gemspec +20 -5
  10. data/docs/0.x-trace.png +0 -0
  11. data/docs/1.0-trace.png +0 -0
  12. data/docs/AutoInstrumentation.md +36 -0
  13. data/docs/Deprecation.md +8 -0
  14. data/docs/DevelopmentGuide.md +17 -7
  15. data/docs/GettingStarted.md +660 -486
  16. data/docs/ProfilingDevelopment.md +45 -23
  17. data/docs/PublicApi.md +14 -0
  18. data/docs/UpgradeGuide.md +736 -0
  19. data/ext/ddtrace_profiling_native_extension/NativeExtensionDesign.md +86 -0
  20. data/ext/ddtrace_profiling_native_extension/clock_id.h +4 -0
  21. data/ext/ddtrace_profiling_native_extension/clock_id_from_pthread.c +52 -0
  22. data/ext/ddtrace_profiling_native_extension/clock_id_noop.c +14 -0
  23. data/ext/ddtrace_profiling_native_extension/extconf.rb +206 -0
  24. data/ext/ddtrace_profiling_native_extension/private_vm_api_access.c +35 -0
  25. data/ext/ddtrace_profiling_native_extension/private_vm_api_access.h +3 -0
  26. data/ext/ddtrace_profiling_native_extension/profiling.c +24 -0
  27. data/lib/datadog/appsec/assets/blocked.html +4 -0
  28. data/lib/datadog/appsec/assets/waf_rules/README.md +7 -0
  29. data/lib/datadog/appsec/assets/waf_rules/recommended.json +5638 -0
  30. data/lib/datadog/appsec/assets/waf_rules/risky.json +1499 -0
  31. data/lib/datadog/appsec/assets/waf_rules/strict.json +1298 -0
  32. data/lib/datadog/appsec/assets.rb +38 -0
  33. data/lib/datadog/appsec/autoload.rb +16 -0
  34. data/lib/datadog/appsec/configuration/settings.rb +175 -0
  35. data/lib/datadog/appsec/configuration.rb +72 -0
  36. data/lib/datadog/appsec/contrib/auto_instrument.rb +29 -0
  37. data/lib/datadog/appsec/contrib/configuration/settings.rb +20 -0
  38. data/lib/datadog/appsec/contrib/integration.rb +37 -0
  39. data/lib/datadog/appsec/contrib/patcher.rb +12 -0
  40. data/lib/datadog/appsec/contrib/rack/configuration/settings.rb +22 -0
  41. data/lib/datadog/appsec/contrib/rack/ext.rb +15 -0
  42. data/lib/datadog/appsec/contrib/rack/gateway/watcher.rb +126 -0
  43. data/lib/datadog/appsec/contrib/rack/integration.rb +48 -0
  44. data/lib/datadog/appsec/contrib/rack/patcher.rb +33 -0
  45. data/lib/datadog/appsec/contrib/rack/reactive/request.rb +87 -0
  46. data/lib/datadog/appsec/contrib/rack/reactive/response.rb +64 -0
  47. data/lib/datadog/appsec/contrib/rack/request.rb +52 -0
  48. data/lib/datadog/appsec/contrib/rack/request_middleware.rb +57 -0
  49. data/lib/datadog/appsec/contrib/rack/response.rb +24 -0
  50. data/lib/datadog/appsec/contrib/rails/configuration/settings.rb +22 -0
  51. data/lib/datadog/appsec/contrib/rails/ext.rb +15 -0
  52. data/lib/datadog/appsec/contrib/rails/framework.rb +30 -0
  53. data/lib/datadog/appsec/contrib/rails/integration.rb +48 -0
  54. data/lib/datadog/appsec/contrib/rails/patcher.rb +125 -0
  55. data/lib/datadog/appsec/contrib/rails/request_middleware.rb +20 -0
  56. data/lib/datadog/appsec/contrib/sinatra/configuration/settings.rb +22 -0
  57. data/lib/datadog/appsec/contrib/sinatra/ext.rb +15 -0
  58. data/lib/datadog/appsec/contrib/sinatra/framework.rb +34 -0
  59. data/lib/datadog/appsec/contrib/sinatra/integration.rb +48 -0
  60. data/lib/datadog/appsec/contrib/sinatra/patcher.rb +77 -0
  61. data/lib/datadog/appsec/contrib/sinatra/request_middleware.rb +20 -0
  62. data/lib/datadog/appsec/event.rb +106 -0
  63. data/lib/datadog/appsec/extensions.rb +121 -0
  64. data/lib/datadog/appsec/instrumentation/gateway.rb +44 -0
  65. data/lib/datadog/appsec/processor.rb +121 -0
  66. data/lib/datadog/appsec/rate_limiter.rb +55 -0
  67. data/lib/datadog/appsec/reactive/address_hash.rb +18 -0
  68. data/lib/datadog/appsec/reactive/engine.rb +44 -0
  69. data/lib/datadog/appsec/reactive/operation.rb +52 -0
  70. data/lib/datadog/appsec/reactive/subscriber.rb +18 -0
  71. data/lib/datadog/appsec.rb +23 -0
  72. data/lib/datadog/ci/configuration/components.rb +10 -8
  73. data/lib/datadog/ci/configuration/settings.rb +20 -3
  74. data/lib/datadog/ci/contrib/cucumber/configuration/settings.rb +6 -3
  75. data/lib/datadog/ci/contrib/cucumber/ext.rb +3 -0
  76. data/lib/datadog/ci/contrib/cucumber/formatter.rb +5 -8
  77. data/lib/datadog/ci/contrib/cucumber/instrumentation.rb +3 -1
  78. data/lib/datadog/ci/contrib/cucumber/integration.rb +4 -2
  79. data/lib/datadog/ci/contrib/cucumber/patcher.rb +4 -2
  80. data/lib/datadog/ci/contrib/rspec/configuration/settings.rb +6 -3
  81. data/lib/datadog/ci/contrib/rspec/example.rb +5 -8
  82. data/lib/datadog/ci/contrib/rspec/ext.rb +3 -0
  83. data/lib/datadog/ci/contrib/rspec/integration.rb +6 -4
  84. data/lib/datadog/ci/contrib/rspec/patcher.rb +4 -2
  85. data/lib/datadog/ci/ext/app_types.rb +3 -1
  86. data/lib/datadog/ci/ext/environment.rb +312 -126
  87. data/lib/datadog/ci/ext/settings.rb +3 -1
  88. data/lib/datadog/ci/ext/test.rb +10 -1
  89. data/lib/datadog/ci/extensions.rb +6 -4
  90. data/lib/datadog/ci/flush.rb +38 -0
  91. data/lib/datadog/ci/test.rb +33 -13
  92. data/lib/datadog/ci.rb +5 -1
  93. data/lib/datadog/core/buffer/cruby.rb +55 -0
  94. data/lib/datadog/core/buffer/random.rb +134 -0
  95. data/lib/datadog/core/buffer/thread_safe.rb +58 -0
  96. data/lib/datadog/core/chunker.rb +35 -0
  97. data/lib/datadog/core/configuration/agent_settings_resolver.rb +365 -0
  98. data/lib/datadog/core/configuration/base.rb +89 -0
  99. data/lib/datadog/core/configuration/components.rb +393 -0
  100. data/lib/datadog/core/configuration/dependency_resolver.rb +28 -0
  101. data/lib/datadog/core/configuration/option.rb +69 -0
  102. data/lib/datadog/core/configuration/option_definition.rb +126 -0
  103. data/lib/datadog/core/configuration/option_definition_set.rb +22 -0
  104. data/lib/datadog/core/configuration/option_set.rb +10 -0
  105. data/lib/datadog/core/configuration/options.rb +118 -0
  106. data/lib/datadog/core/configuration/settings.rb +618 -0
  107. data/lib/datadog/core/configuration.rb +284 -0
  108. data/lib/datadog/core/diagnostics/environment_logger.rb +283 -0
  109. data/lib/datadog/core/diagnostics/ext.rb +41 -0
  110. data/lib/datadog/core/diagnostics/health.rb +37 -0
  111. data/lib/datadog/core/encoding.rb +76 -0
  112. data/lib/datadog/core/environment/cgroup.rb +53 -0
  113. data/lib/datadog/core/environment/class_count.rb +21 -0
  114. data/lib/datadog/core/environment/container.rb +92 -0
  115. data/lib/datadog/core/environment/ext.rb +46 -0
  116. data/lib/datadog/core/environment/gc.rb +20 -0
  117. data/lib/datadog/core/environment/identity.rb +58 -0
  118. data/lib/datadog/core/environment/socket.rb +24 -0
  119. data/lib/datadog/core/environment/thread_count.rb +20 -0
  120. data/lib/datadog/core/environment/variable_helpers.rb +44 -0
  121. data/lib/datadog/core/environment/vm_cache.rb +47 -0
  122. data/lib/datadog/core/error.rb +101 -0
  123. data/lib/datadog/core/extensions.rb +16 -0
  124. data/lib/datadog/core/git/ext.rb +35 -0
  125. data/lib/datadog/core/logger.rb +46 -0
  126. data/lib/datadog/core/metrics/client.rb +188 -0
  127. data/lib/datadog/core/metrics/ext.rb +20 -0
  128. data/lib/datadog/core/metrics/helpers.rb +25 -0
  129. data/lib/datadog/core/metrics/logging.rb +44 -0
  130. data/lib/datadog/core/metrics/metric.rb +14 -0
  131. data/lib/datadog/core/metrics/options.rb +50 -0
  132. data/lib/datadog/core/pin.rb +75 -0
  133. data/lib/datadog/core/runtime/ext.rb +28 -0
  134. data/lib/datadog/core/runtime/metrics.rb +126 -0
  135. data/lib/datadog/core/utils/compression.rb +32 -0
  136. data/lib/datadog/core/utils/forking.rb +63 -0
  137. data/lib/datadog/core/utils/object_set.rb +43 -0
  138. data/lib/datadog/core/utils/only_once.rb +44 -0
  139. data/lib/datadog/core/utils/safe_dup.rb +27 -0
  140. data/lib/datadog/core/utils/sequence.rb +21 -0
  141. data/lib/datadog/core/utils/string_table.rb +49 -0
  142. data/lib/datadog/core/utils/time.rb +54 -0
  143. data/lib/datadog/core/utils.rb +115 -0
  144. data/lib/datadog/core/vendor/multipart-post/multipart/post/composite_read_io.rb +120 -0
  145. data/lib/datadog/core/vendor/multipart-post/multipart/post/multipartable.rb +61 -0
  146. data/lib/datadog/core/vendor/multipart-post/multipart/post/parts.rb +139 -0
  147. data/lib/datadog/core/vendor/multipart-post/multipart/post/version.rb +13 -0
  148. data/lib/datadog/core/vendor/multipart-post/multipart/post.rb +12 -0
  149. data/lib/datadog/core/vendor/multipart-post/multipart.rb +16 -0
  150. data/lib/datadog/core/vendor/multipart-post/net/http/post/multipart.rb +36 -0
  151. data/lib/datadog/core/worker.rb +24 -0
  152. data/lib/datadog/core/workers/async.rb +180 -0
  153. data/lib/datadog/core/workers/interval_loop.rb +119 -0
  154. data/lib/datadog/core/workers/polling.rb +59 -0
  155. data/lib/datadog/core/workers/queue.rb +44 -0
  156. data/lib/datadog/core/workers/runtime_metrics.rb +65 -0
  157. data/lib/datadog/core.rb +74 -0
  158. data/lib/datadog/opentracer/binary_propagator.rb +26 -0
  159. data/lib/datadog/opentracer/carrier.rb +9 -0
  160. data/lib/datadog/opentracer/distributed_headers.rb +58 -0
  161. data/lib/datadog/opentracer/global_tracer.rb +17 -0
  162. data/lib/datadog/opentracer/propagator.rb +26 -0
  163. data/lib/datadog/opentracer/rack_propagator.rb +72 -0
  164. data/lib/datadog/opentracer/scope.rb +18 -0
  165. data/lib/datadog/opentracer/scope_manager.rb +9 -0
  166. data/lib/datadog/opentracer/span.rb +101 -0
  167. data/lib/datadog/opentracer/span_context.rb +19 -0
  168. data/lib/datadog/opentracer/span_context_factory.rb +27 -0
  169. data/lib/datadog/opentracer/text_map_propagator.rb +87 -0
  170. data/lib/datadog/opentracer/thread_local_scope.rb +34 -0
  171. data/lib/datadog/opentracer/thread_local_scope_manager.rb +43 -0
  172. data/lib/datadog/opentracer/tracer.rb +214 -0
  173. data/lib/datadog/opentracer.rb +24 -0
  174. data/lib/datadog/profiling/backtrace_location.rb +34 -0
  175. data/lib/datadog/profiling/buffer.rb +43 -0
  176. data/lib/datadog/profiling/collectors/code_provenance.rb +114 -0
  177. data/lib/datadog/profiling/collectors/stack.rb +297 -0
  178. data/lib/datadog/profiling/encoding/profile.rb +48 -0
  179. data/lib/datadog/profiling/event.rb +15 -0
  180. data/lib/datadog/profiling/events/stack.rb +82 -0
  181. data/lib/datadog/profiling/exporter.rb +25 -0
  182. data/lib/datadog/profiling/ext/forking.rb +99 -0
  183. data/lib/datadog/profiling/ext.rb +57 -0
  184. data/lib/datadog/profiling/flush.rb +69 -0
  185. data/lib/datadog/profiling/native_extension.rb +41 -0
  186. data/lib/datadog/profiling/pprof/builder.rb +127 -0
  187. data/lib/datadog/profiling/pprof/converter.rb +104 -0
  188. data/lib/datadog/profiling/pprof/message_set.rb +16 -0
  189. data/lib/datadog/profiling/pprof/payload.rb +20 -0
  190. data/lib/datadog/profiling/pprof/pprof_pb.rb +83 -0
  191. data/lib/datadog/profiling/pprof/stack_sample.rb +141 -0
  192. data/lib/datadog/profiling/pprof/string_table.rb +12 -0
  193. data/lib/datadog/profiling/pprof/template.rb +120 -0
  194. data/lib/datadog/profiling/preload.rb +5 -0
  195. data/lib/datadog/profiling/profiler.rb +34 -0
  196. data/lib/datadog/profiling/recorder.rb +117 -0
  197. data/lib/datadog/profiling/scheduler.rb +151 -0
  198. data/lib/datadog/profiling/tasks/exec.rb +50 -0
  199. data/lib/datadog/profiling/tasks/help.rb +18 -0
  200. data/lib/datadog/profiling/tasks/setup.rb +91 -0
  201. data/lib/datadog/profiling/trace_identifiers/ddtrace.rb +45 -0
  202. data/lib/datadog/profiling/trace_identifiers/helper.rb +47 -0
  203. data/lib/datadog/profiling/transport/client.rb +16 -0
  204. data/lib/datadog/profiling/transport/http/api/endpoint.rb +107 -0
  205. data/lib/datadog/profiling/transport/http/api/instance.rb +38 -0
  206. data/lib/datadog/profiling/transport/http/api/spec.rb +42 -0
  207. data/lib/datadog/profiling/transport/http/api.rb +45 -0
  208. data/lib/datadog/profiling/transport/http/builder.rb +30 -0
  209. data/lib/datadog/profiling/transport/http/client.rb +35 -0
  210. data/lib/datadog/profiling/transport/http/response.rb +23 -0
  211. data/lib/datadog/profiling/transport/http.rb +112 -0
  212. data/lib/datadog/profiling/transport/io/client.rb +29 -0
  213. data/lib/datadog/profiling/transport/io/response.rb +18 -0
  214. data/lib/datadog/profiling/transport/io.rb +32 -0
  215. data/lib/datadog/profiling/transport/parcel.rb +19 -0
  216. data/lib/datadog/profiling/transport/request.rb +17 -0
  217. data/lib/datadog/profiling/transport/response.rb +10 -0
  218. data/lib/datadog/profiling.rb +168 -0
  219. data/lib/datadog/tracing/analytics.rb +25 -0
  220. data/lib/datadog/tracing/buffer.rb +126 -0
  221. data/lib/datadog/tracing/configuration/ext.rb +51 -0
  222. data/lib/datadog/tracing/context.rb +68 -0
  223. data/lib/datadog/tracing/context_provider.rb +66 -0
  224. data/lib/datadog/tracing/contrib/action_cable/configuration/settings.rb +35 -0
  225. data/lib/datadog/tracing/contrib/action_cable/event.rb +72 -0
  226. data/lib/datadog/tracing/contrib/action_cable/events/broadcast.rb +58 -0
  227. data/lib/datadog/tracing/contrib/action_cable/events/perform_action.rb +63 -0
  228. data/lib/datadog/tracing/contrib/action_cable/events/transmit.rb +59 -0
  229. data/lib/datadog/tracing/contrib/action_cable/events.rb +37 -0
  230. data/lib/datadog/tracing/contrib/action_cable/ext.rb +32 -0
  231. data/lib/datadog/tracing/contrib/action_cable/instrumentation.rb +91 -0
  232. data/lib/datadog/tracing/contrib/action_cable/integration.rb +50 -0
  233. data/lib/datadog/tracing/contrib/action_cable/patcher.rb +31 -0
  234. data/lib/datadog/tracing/contrib/action_mailer/configuration/settings.rb +36 -0
  235. data/lib/datadog/tracing/contrib/action_mailer/event.rb +52 -0
  236. data/lib/datadog/tracing/contrib/action_mailer/events/deliver.rb +60 -0
  237. data/lib/datadog/tracing/contrib/action_mailer/events/process.rb +47 -0
  238. data/lib/datadog/tracing/contrib/action_mailer/events.rb +34 -0
  239. data/lib/datadog/tracing/contrib/action_mailer/ext.rb +33 -0
  240. data/lib/datadog/tracing/contrib/action_mailer/integration.rb +50 -0
  241. data/lib/datadog/tracing/contrib/action_mailer/patcher.rb +29 -0
  242. data/lib/datadog/tracing/contrib/action_pack/action_controller/instrumentation.rb +156 -0
  243. data/lib/datadog/tracing/contrib/action_pack/action_controller/patcher.rb +29 -0
  244. data/lib/datadog/tracing/contrib/action_pack/configuration/settings.rb +36 -0
  245. data/lib/datadog/tracing/contrib/action_pack/ext.rb +22 -0
  246. data/lib/datadog/tracing/contrib/action_pack/integration.rb +50 -0
  247. data/lib/datadog/tracing/contrib/action_pack/patcher.rb +27 -0
  248. data/lib/datadog/tracing/contrib/action_pack/utils.rb +40 -0
  249. data/lib/datadog/tracing/contrib/action_view/configuration/settings.rb +36 -0
  250. data/lib/datadog/tracing/contrib/action_view/event.rb +35 -0
  251. data/lib/datadog/tracing/contrib/action_view/events/render_partial.rb +54 -0
  252. data/lib/datadog/tracing/contrib/action_view/events/render_template.rb +57 -0
  253. data/lib/datadog/tracing/contrib/action_view/events.rb +34 -0
  254. data/lib/datadog/tracing/contrib/action_view/ext.rb +24 -0
  255. data/lib/datadog/tracing/contrib/action_view/instrumentation/partial_renderer.rb +78 -0
  256. data/lib/datadog/tracing/contrib/action_view/instrumentation/template_renderer.rb +91 -0
  257. data/lib/datadog/tracing/contrib/action_view/integration.rb +57 -0
  258. data/lib/datadog/tracing/contrib/action_view/patcher.rb +48 -0
  259. data/lib/datadog/tracing/contrib/action_view/utils.rb +36 -0
  260. data/lib/datadog/tracing/contrib/active_job/configuration/settings.rb +37 -0
  261. data/lib/datadog/tracing/contrib/active_job/event.rb +58 -0
  262. data/lib/datadog/tracing/contrib/active_job/events/discard.rb +50 -0
  263. data/lib/datadog/tracing/contrib/active_job/events/enqueue.rb +49 -0
  264. data/lib/datadog/tracing/contrib/active_job/events/enqueue_at.rb +49 -0
  265. data/lib/datadog/tracing/contrib/active_job/events/enqueue_retry.rb +51 -0
  266. data/lib/datadog/tracing/contrib/active_job/events/perform.rb +49 -0
  267. data/lib/datadog/tracing/contrib/active_job/events/retry_stopped.rb +50 -0
  268. data/lib/datadog/tracing/contrib/active_job/events.rb +42 -0
  269. data/lib/datadog/tracing/contrib/active_job/ext.rb +39 -0
  270. data/lib/datadog/tracing/contrib/active_job/integration.rb +50 -0
  271. data/lib/datadog/tracing/contrib/active_job/log_injection.rb +26 -0
  272. data/lib/datadog/tracing/contrib/active_job/patcher.rb +36 -0
  273. data/lib/datadog/tracing/contrib/active_model_serializers/configuration/settings.rb +33 -0
  274. data/lib/datadog/tracing/contrib/active_model_serializers/event.rb +69 -0
  275. data/lib/datadog/tracing/contrib/active_model_serializers/events/render.rb +45 -0
  276. data/lib/datadog/tracing/contrib/active_model_serializers/events/serialize.rb +47 -0
  277. data/lib/datadog/tracing/contrib/active_model_serializers/events.rb +34 -0
  278. data/lib/datadog/tracing/contrib/active_model_serializers/ext.rb +24 -0
  279. data/lib/datadog/tracing/contrib/active_model_serializers/integration.rb +45 -0
  280. data/lib/datadog/tracing/contrib/active_model_serializers/patcher.rb +33 -0
  281. data/lib/datadog/tracing/contrib/active_record/configuration/makara_resolver.rb +36 -0
  282. data/lib/datadog/tracing/contrib/active_record/configuration/resolver.rb +138 -0
  283. data/lib/datadog/tracing/contrib/active_record/configuration/settings.rb +39 -0
  284. data/lib/datadog/tracing/contrib/active_record/event.rb +30 -0
  285. data/lib/datadog/tracing/contrib/active_record/events/instantiation.rb +58 -0
  286. data/lib/datadog/tracing/contrib/active_record/events/sql.rb +78 -0
  287. data/lib/datadog/tracing/contrib/active_record/events.rb +34 -0
  288. data/lib/datadog/tracing/contrib/active_record/ext.rb +29 -0
  289. data/lib/datadog/tracing/contrib/active_record/integration.rb +56 -0
  290. data/lib/datadog/tracing/contrib/active_record/patcher.rb +27 -0
  291. data/lib/datadog/tracing/contrib/active_record/utils.rb +128 -0
  292. data/lib/datadog/tracing/contrib/active_record/vendor/connection_specification.rb +307 -0
  293. data/lib/datadog/tracing/contrib/active_support/cache/instrumentation.rb +270 -0
  294. data/lib/datadog/tracing/contrib/active_support/cache/patcher.rb +73 -0
  295. data/lib/datadog/tracing/contrib/active_support/cache/redis.rb +47 -0
  296. data/lib/datadog/tracing/contrib/active_support/configuration/settings.rb +35 -0
  297. data/lib/datadog/tracing/contrib/active_support/ext.rb +31 -0
  298. data/lib/datadog/tracing/contrib/active_support/integration.rb +51 -0
  299. data/lib/datadog/tracing/contrib/active_support/notifications/event.rb +71 -0
  300. data/lib/datadog/tracing/contrib/active_support/notifications/subscriber.rb +71 -0
  301. data/lib/datadog/tracing/contrib/active_support/notifications/subscription.rb +162 -0
  302. data/lib/datadog/tracing/contrib/active_support/patcher.rb +27 -0
  303. data/lib/datadog/tracing/contrib/analytics.rb +29 -0
  304. data/lib/datadog/tracing/contrib/auto_instrument.rb +53 -0
  305. data/lib/datadog/tracing/contrib/aws/configuration/settings.rb +35 -0
  306. data/lib/datadog/tracing/contrib/aws/ext.rb +27 -0
  307. data/lib/datadog/tracing/contrib/aws/instrumentation.rb +95 -0
  308. data/lib/datadog/tracing/contrib/aws/integration.rb +47 -0
  309. data/lib/datadog/tracing/contrib/aws/parsed_context.rb +60 -0
  310. data/lib/datadog/tracing/contrib/aws/patcher.rb +57 -0
  311. data/lib/datadog/tracing/contrib/aws/services.rb +123 -0
  312. data/lib/datadog/tracing/contrib/concurrent_ruby/configuration/settings.rb +23 -0
  313. data/lib/datadog/tracing/contrib/concurrent_ruby/context_composite_executor_service.rb +46 -0
  314. data/lib/datadog/tracing/contrib/concurrent_ruby/ext.rb +16 -0
  315. data/lib/datadog/tracing/contrib/concurrent_ruby/future_patch.rb +27 -0
  316. data/lib/datadog/tracing/contrib/concurrent_ruby/integration.rb +43 -0
  317. data/lib/datadog/tracing/contrib/concurrent_ruby/patcher.rb +33 -0
  318. data/lib/datadog/tracing/contrib/configurable.rb +102 -0
  319. data/lib/datadog/tracing/contrib/configuration/resolver.rb +85 -0
  320. data/lib/datadog/tracing/contrib/configuration/resolvers/pattern_resolver.rb +43 -0
  321. data/lib/datadog/tracing/contrib/configuration/settings.rb +43 -0
  322. data/lib/datadog/tracing/contrib/dalli/configuration/settings.rb +35 -0
  323. data/lib/datadog/tracing/contrib/dalli/ext.rb +24 -0
  324. data/lib/datadog/tracing/contrib/dalli/instrumentation.rb +58 -0
  325. data/lib/datadog/tracing/contrib/dalli/integration.rb +52 -0
  326. data/lib/datadog/tracing/contrib/dalli/patcher.rb +29 -0
  327. data/lib/datadog/tracing/contrib/dalli/quantize.rb +26 -0
  328. data/lib/datadog/tracing/contrib/delayed_job/configuration/settings.rb +38 -0
  329. data/lib/datadog/tracing/contrib/delayed_job/ext.rb +26 -0
  330. data/lib/datadog/tracing/contrib/delayed_job/integration.rb +43 -0
  331. data/lib/datadog/tracing/contrib/delayed_job/patcher.rb +32 -0
  332. data/lib/datadog/tracing/contrib/delayed_job/plugin.rb +101 -0
  333. data/lib/datadog/tracing/contrib/elasticsearch/configuration/settings.rb +36 -0
  334. data/lib/datadog/tracing/contrib/elasticsearch/ext.rb +26 -0
  335. data/lib/datadog/tracing/contrib/elasticsearch/integration.rb +44 -0
  336. data/lib/datadog/tracing/contrib/elasticsearch/patcher.rb +115 -0
  337. data/lib/datadog/tracing/contrib/elasticsearch/quantize.rb +89 -0
  338. data/lib/datadog/tracing/contrib/ethon/configuration/settings.rb +37 -0
  339. data/lib/datadog/tracing/contrib/ethon/easy_patch.rb +177 -0
  340. data/lib/datadog/tracing/contrib/ethon/ext.rb +24 -0
  341. data/lib/datadog/tracing/contrib/ethon/integration.rb +48 -0
  342. data/lib/datadog/tracing/contrib/ethon/multi_patch.rb +96 -0
  343. data/lib/datadog/tracing/contrib/ethon/patcher.rb +32 -0
  344. data/lib/datadog/tracing/contrib/excon/configuration/settings.rb +38 -0
  345. data/lib/datadog/tracing/contrib/excon/ext.rb +21 -0
  346. data/lib/datadog/tracing/contrib/excon/integration.rb +48 -0
  347. data/lib/datadog/tracing/contrib/excon/middleware.rb +170 -0
  348. data/lib/datadog/tracing/contrib/excon/patcher.rb +31 -0
  349. data/lib/datadog/tracing/contrib/extensions.rb +199 -0
  350. data/lib/datadog/tracing/contrib/faraday/configuration/settings.rb +42 -0
  351. data/lib/datadog/tracing/contrib/faraday/connection.rb +22 -0
  352. data/lib/datadog/tracing/contrib/faraday/ext.rb +21 -0
  353. data/lib/datadog/tracing/contrib/faraday/integration.rb +48 -0
  354. data/lib/datadog/tracing/contrib/faraday/middleware.rb +93 -0
  355. data/lib/datadog/tracing/contrib/faraday/patcher.rb +57 -0
  356. data/lib/datadog/tracing/contrib/faraday/rack_builder.rb +22 -0
  357. data/lib/datadog/tracing/contrib/grape/configuration/settings.rb +42 -0
  358. data/lib/datadog/tracing/contrib/grape/endpoint.rb +253 -0
  359. data/lib/datadog/tracing/contrib/grape/ext.rb +28 -0
  360. data/lib/datadog/tracing/contrib/grape/instrumentation.rb +37 -0
  361. data/lib/datadog/tracing/contrib/grape/integration.rb +44 -0
  362. data/lib/datadog/tracing/contrib/grape/patcher.rb +34 -0
  363. data/lib/datadog/tracing/contrib/graphql/configuration/settings.rb +36 -0
  364. data/lib/datadog/tracing/contrib/graphql/ext.rb +19 -0
  365. data/lib/datadog/tracing/contrib/graphql/integration.rb +44 -0
  366. data/lib/datadog/tracing/contrib/graphql/patcher.rb +92 -0
  367. data/lib/datadog/tracing/contrib/grpc/configuration/settings.rb +37 -0
  368. data/lib/datadog/tracing/contrib/grpc/datadog_interceptor/client.rb +84 -0
  369. data/lib/datadog/tracing/contrib/grpc/datadog_interceptor/server.rb +90 -0
  370. data/lib/datadog/tracing/contrib/grpc/datadog_interceptor.rb +104 -0
  371. data/lib/datadog/tracing/contrib/grpc/ext.rb +23 -0
  372. data/lib/datadog/tracing/contrib/grpc/integration.rb +43 -0
  373. data/lib/datadog/tracing/contrib/grpc/intercept_with_datadog.rb +53 -0
  374. data/lib/datadog/tracing/contrib/grpc/patcher.rb +38 -0
  375. data/lib/datadog/tracing/contrib/http/circuit_breaker.rb +44 -0
  376. data/lib/datadog/tracing/contrib/http/configuration/settings.rb +37 -0
  377. data/lib/datadog/tracing/contrib/http/ext.rb +21 -0
  378. data/lib/datadog/tracing/contrib/http/instrumentation.rb +139 -0
  379. data/lib/datadog/tracing/contrib/http/integration.rb +49 -0
  380. data/lib/datadog/tracing/contrib/http/patcher.rb +30 -0
  381. data/lib/datadog/tracing/contrib/http_annotation_helper.rb +17 -0
  382. data/lib/datadog/tracing/contrib/httpclient/configuration/settings.rb +37 -0
  383. data/lib/datadog/tracing/contrib/httpclient/ext.rb +21 -0
  384. data/lib/datadog/tracing/contrib/httpclient/instrumentation.rb +117 -0
  385. data/lib/datadog/tracing/contrib/httpclient/integration.rb +48 -0
  386. data/lib/datadog/tracing/contrib/httpclient/patcher.rb +42 -0
  387. data/lib/datadog/tracing/contrib/httprb/configuration/settings.rb +37 -0
  388. data/lib/datadog/tracing/contrib/httprb/ext.rb +21 -0
  389. data/lib/datadog/tracing/contrib/httprb/instrumentation.rb +128 -0
  390. data/lib/datadog/tracing/contrib/httprb/integration.rb +48 -0
  391. data/lib/datadog/tracing/contrib/httprb/patcher.rb +42 -0
  392. data/lib/datadog/tracing/contrib/integration.rb +78 -0
  393. data/lib/datadog/tracing/contrib/kafka/configuration/settings.rb +35 -0
  394. data/lib/datadog/tracing/contrib/kafka/consumer_event.rb +18 -0
  395. data/lib/datadog/tracing/contrib/kafka/consumer_group_event.rb +18 -0
  396. data/lib/datadog/tracing/contrib/kafka/event.rb +52 -0
  397. data/lib/datadog/tracing/contrib/kafka/events/connection/request.rb +42 -0
  398. data/lib/datadog/tracing/contrib/kafka/events/consumer/process_batch.rb +49 -0
  399. data/lib/datadog/tracing/contrib/kafka/events/consumer/process_message.rb +47 -0
  400. data/lib/datadog/tracing/contrib/kafka/events/consumer_group/heartbeat.rb +47 -0
  401. data/lib/datadog/tracing/contrib/kafka/events/consumer_group/join_group.rb +37 -0
  402. data/lib/datadog/tracing/contrib/kafka/events/consumer_group/leave_group.rb +37 -0
  403. data/lib/datadog/tracing/contrib/kafka/events/consumer_group/sync_group.rb +37 -0
  404. data/lib/datadog/tracing/contrib/kafka/events/produce_operation/send_messages.rb +40 -0
  405. data/lib/datadog/tracing/contrib/kafka/events/producer/deliver_messages.rb +43 -0
  406. data/lib/datadog/tracing/contrib/kafka/events.rb +48 -0
  407. data/lib/datadog/tracing/contrib/kafka/ext.rb +52 -0
  408. data/lib/datadog/tracing/contrib/kafka/integration.rb +44 -0
  409. data/lib/datadog/tracing/contrib/kafka/patcher.rb +30 -0
  410. data/lib/datadog/tracing/contrib/lograge/configuration/settings.rb +23 -0
  411. data/lib/datadog/tracing/contrib/lograge/ext.rb +15 -0
  412. data/lib/datadog/tracing/contrib/lograge/instrumentation.rb +46 -0
  413. data/lib/datadog/tracing/contrib/lograge/integration.rb +50 -0
  414. data/lib/datadog/tracing/contrib/lograge/patcher.rb +29 -0
  415. data/lib/datadog/tracing/contrib/mongodb/configuration/settings.rb +38 -0
  416. data/lib/datadog/tracing/contrib/mongodb/ext.rb +27 -0
  417. data/lib/datadog/tracing/contrib/mongodb/instrumentation.rb +47 -0
  418. data/lib/datadog/tracing/contrib/mongodb/integration.rb +48 -0
  419. data/lib/datadog/tracing/contrib/mongodb/parsers.rb +49 -0
  420. data/lib/datadog/tracing/contrib/mongodb/patcher.rb +34 -0
  421. data/lib/datadog/tracing/contrib/mongodb/subscribers.rb +121 -0
  422. data/lib/datadog/tracing/contrib/mysql2/configuration/settings.rb +35 -0
  423. data/lib/datadog/tracing/contrib/mysql2/ext.rb +22 -0
  424. data/lib/datadog/tracing/contrib/mysql2/instrumentation.rb +62 -0
  425. data/lib/datadog/tracing/contrib/mysql2/integration.rb +43 -0
  426. data/lib/datadog/tracing/contrib/mysql2/patcher.rb +31 -0
  427. data/lib/datadog/tracing/contrib/patchable.rb +109 -0
  428. data/lib/datadog/tracing/contrib/patcher.rb +74 -0
  429. data/lib/datadog/tracing/contrib/presto/configuration/settings.rb +35 -0
  430. data/lib/datadog/tracing/contrib/presto/ext.rb +32 -0
  431. data/lib/datadog/tracing/contrib/presto/instrumentation.rb +125 -0
  432. data/lib/datadog/tracing/contrib/presto/integration.rb +43 -0
  433. data/lib/datadog/tracing/contrib/presto/patcher.rb +37 -0
  434. data/lib/datadog/tracing/contrib/qless/configuration/settings.rb +40 -0
  435. data/lib/datadog/tracing/contrib/qless/ext.rb +26 -0
  436. data/lib/datadog/tracing/contrib/qless/integration.rb +43 -0
  437. data/lib/datadog/tracing/contrib/qless/patcher.rb +39 -0
  438. data/lib/datadog/tracing/contrib/qless/qless_job.rb +75 -0
  439. data/lib/datadog/tracing/contrib/qless/tracer_cleaner.rb +32 -0
  440. data/lib/datadog/tracing/contrib/que/configuration/settings.rb +49 -0
  441. data/lib/datadog/tracing/contrib/que/ext.rb +34 -0
  442. data/lib/datadog/tracing/contrib/que/integration.rb +46 -0
  443. data/lib/datadog/tracing/contrib/que/patcher.rb +29 -0
  444. data/lib/datadog/tracing/contrib/que/tracer.rb +61 -0
  445. data/lib/datadog/tracing/contrib/racecar/configuration/settings.rb +35 -0
  446. data/lib/datadog/tracing/contrib/racecar/event.rb +79 -0
  447. data/lib/datadog/tracing/contrib/racecar/events/batch.rb +35 -0
  448. data/lib/datadog/tracing/contrib/racecar/events/consume.rb +35 -0
  449. data/lib/datadog/tracing/contrib/racecar/events/message.rb +35 -0
  450. data/lib/datadog/tracing/contrib/racecar/events.rb +36 -0
  451. data/lib/datadog/tracing/contrib/racecar/ext.rb +31 -0
  452. data/lib/datadog/tracing/contrib/racecar/integration.rb +44 -0
  453. data/lib/datadog/tracing/contrib/racecar/patcher.rb +30 -0
  454. data/lib/datadog/tracing/contrib/rack/configuration/settings.rb +51 -0
  455. data/lib/datadog/tracing/contrib/rack/ext.rb +25 -0
  456. data/lib/datadog/tracing/contrib/rack/integration.rb +50 -0
  457. data/lib/datadog/tracing/contrib/rack/middlewares.rb +255 -0
  458. data/lib/datadog/tracing/contrib/rack/patcher.rb +109 -0
  459. data/lib/datadog/tracing/contrib/rack/request_queue.rb +48 -0
  460. data/lib/datadog/tracing/contrib/rails/auto_instrument_railtie.rb +12 -0
  461. data/lib/datadog/tracing/contrib/rails/configuration/settings.rb +71 -0
  462. data/lib/datadog/tracing/contrib/rails/ext.rb +19 -0
  463. data/lib/datadog/tracing/contrib/rails/framework.rb +152 -0
  464. data/lib/datadog/tracing/contrib/rails/integration.rb +49 -0
  465. data/lib/datadog/tracing/contrib/rails/log_injection.rb +47 -0
  466. data/lib/datadog/tracing/contrib/rails/middlewares.rb +47 -0
  467. data/lib/datadog/tracing/contrib/rails/patcher.rb +121 -0
  468. data/lib/datadog/tracing/contrib/rails/railtie.rb +19 -0
  469. data/lib/datadog/tracing/contrib/rails/utils.rb +28 -0
  470. data/lib/datadog/tracing/contrib/rake/configuration/settings.rb +36 -0
  471. data/lib/datadog/tracing/contrib/rake/ext.rb +26 -0
  472. data/lib/datadog/tracing/contrib/rake/instrumentation.rb +98 -0
  473. data/lib/datadog/tracing/contrib/rake/integration.rb +43 -0
  474. data/lib/datadog/tracing/contrib/rake/patcher.rb +35 -0
  475. data/lib/datadog/tracing/contrib/redis/configuration/resolver.rb +49 -0
  476. data/lib/datadog/tracing/contrib/redis/configuration/settings.rb +40 -0
  477. data/lib/datadog/tracing/contrib/redis/ext.rb +26 -0
  478. data/lib/datadog/tracing/contrib/redis/instrumentation.rb +78 -0
  479. data/lib/datadog/tracing/contrib/redis/integration.rb +47 -0
  480. data/lib/datadog/tracing/contrib/redis/patcher.rb +36 -0
  481. data/lib/datadog/tracing/contrib/redis/quantize.rb +79 -0
  482. data/lib/datadog/tracing/contrib/redis/tags.rb +54 -0
  483. data/lib/datadog/tracing/contrib/redis/vendor/resolver.rb +162 -0
  484. data/lib/datadog/tracing/contrib/registerable.rb +50 -0
  485. data/lib/datadog/tracing/contrib/registry.rb +52 -0
  486. data/lib/datadog/tracing/contrib/resque/configuration/settings.rb +37 -0
  487. data/lib/datadog/tracing/contrib/resque/ext.rb +21 -0
  488. data/lib/datadog/tracing/contrib/resque/integration.rb +48 -0
  489. data/lib/datadog/tracing/contrib/resque/patcher.rb +30 -0
  490. data/lib/datadog/tracing/contrib/resque/resque_job.rb +103 -0
  491. data/lib/datadog/tracing/contrib/rest_client/configuration/settings.rb +36 -0
  492. data/lib/datadog/tracing/contrib/rest_client/ext.rb +21 -0
  493. data/lib/datadog/tracing/contrib/rest_client/integration.rb +43 -0
  494. data/lib/datadog/tracing/contrib/rest_client/patcher.rb +30 -0
  495. data/lib/datadog/tracing/contrib/rest_client/request_patch.rb +105 -0
  496. data/lib/datadog/tracing/contrib/semantic_logger/configuration/settings.rb +23 -0
  497. data/lib/datadog/tracing/contrib/semantic_logger/ext.rb +15 -0
  498. data/lib/datadog/tracing/contrib/semantic_logger/instrumentation.rb +50 -0
  499. data/lib/datadog/tracing/contrib/semantic_logger/integration.rb +52 -0
  500. data/lib/datadog/tracing/contrib/semantic_logger/patcher.rb +29 -0
  501. data/lib/datadog/tracing/contrib/sequel/configuration/settings.rb +33 -0
  502. data/lib/datadog/tracing/contrib/sequel/database.rb +60 -0
  503. data/lib/datadog/tracing/contrib/sequel/dataset.rb +65 -0
  504. data/lib/datadog/tracing/contrib/sequel/ext.rb +22 -0
  505. data/lib/datadog/tracing/contrib/sequel/integration.rb +43 -0
  506. data/lib/datadog/tracing/contrib/sequel/patcher.rb +37 -0
  507. data/lib/datadog/tracing/contrib/sequel/utils.rb +87 -0
  508. data/lib/datadog/tracing/contrib/shoryuken/configuration/settings.rb +38 -0
  509. data/lib/datadog/tracing/contrib/shoryuken/ext.rb +25 -0
  510. data/lib/datadog/tracing/contrib/shoryuken/integration.rb +44 -0
  511. data/lib/datadog/tracing/contrib/shoryuken/patcher.rb +28 -0
  512. data/lib/datadog/tracing/contrib/shoryuken/tracer.rb +61 -0
  513. data/lib/datadog/tracing/contrib/sidekiq/client_tracer.rb +53 -0
  514. data/lib/datadog/tracing/contrib/sidekiq/configuration/settings.rb +43 -0
  515. data/lib/datadog/tracing/contrib/sidekiq/ext.rb +38 -0
  516. data/lib/datadog/tracing/contrib/sidekiq/integration.rb +53 -0
  517. data/lib/datadog/tracing/contrib/sidekiq/patcher.rb +71 -0
  518. data/lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/heartbeat.rb +34 -0
  519. data/lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/job_fetch.rb +34 -0
  520. data/lib/datadog/tracing/contrib/sidekiq/server_internal_tracer/scheduled_push.rb +33 -0
  521. data/lib/datadog/tracing/contrib/sidekiq/server_tracer.rb +79 -0
  522. data/lib/datadog/tracing/contrib/sidekiq/tracing.rb +44 -0
  523. data/lib/datadog/tracing/contrib/sinatra/configuration/settings.rb +43 -0
  524. data/lib/datadog/tracing/contrib/sinatra/env.rb +66 -0
  525. data/lib/datadog/tracing/contrib/sinatra/ext.rb +32 -0
  526. data/lib/datadog/tracing/contrib/sinatra/framework.rb +107 -0
  527. data/lib/datadog/tracing/contrib/sinatra/headers.rb +35 -0
  528. data/lib/datadog/tracing/contrib/sinatra/integration.rb +43 -0
  529. data/lib/datadog/tracing/contrib/sinatra/patcher.rb +77 -0
  530. data/lib/datadog/tracing/contrib/sinatra/tracer.rb +159 -0
  531. data/lib/datadog/tracing/contrib/sinatra/tracer_middleware.rb +123 -0
  532. data/lib/datadog/tracing/contrib/sneakers/configuration/settings.rb +38 -0
  533. data/lib/datadog/tracing/contrib/sneakers/ext.rb +26 -0
  534. data/lib/datadog/tracing/contrib/sneakers/integration.rb +46 -0
  535. data/lib/datadog/tracing/contrib/sneakers/patcher.rb +30 -0
  536. data/lib/datadog/tracing/contrib/sneakers/tracer.rb +58 -0
  537. data/lib/datadog/tracing/contrib/status_code_matcher.rb +75 -0
  538. data/lib/datadog/tracing/contrib/sucker_punch/configuration/settings.rb +35 -0
  539. data/lib/datadog/tracing/contrib/sucker_punch/exception_handler.rb +28 -0
  540. data/lib/datadog/tracing/contrib/sucker_punch/ext.rb +27 -0
  541. data/lib/datadog/tracing/contrib/sucker_punch/instrumentation.rb +105 -0
  542. data/lib/datadog/tracing/contrib/sucker_punch/integration.rb +43 -0
  543. data/lib/datadog/tracing/contrib/sucker_punch/patcher.rb +38 -0
  544. data/lib/datadog/tracing/contrib/utils/database.rb +31 -0
  545. data/lib/datadog/tracing/contrib/utils/quantization/hash.rb +111 -0
  546. data/lib/datadog/tracing/contrib/utils/quantization/http.rb +99 -0
  547. data/lib/datadog/tracing/contrib.rb +76 -0
  548. data/lib/datadog/tracing/correlation.rb +100 -0
  549. data/lib/datadog/tracing/distributed/headers/b3.rb +55 -0
  550. data/lib/datadog/tracing/distributed/headers/b3_single.rb +67 -0
  551. data/lib/datadog/tracing/distributed/headers/datadog.rb +52 -0
  552. data/lib/datadog/tracing/distributed/headers/ext.rb +31 -0
  553. data/lib/datadog/tracing/distributed/helpers.rb +44 -0
  554. data/lib/datadog/tracing/distributed/parser.rb +70 -0
  555. data/lib/datadog/tracing/event.rb +77 -0
  556. data/lib/datadog/tracing/flush.rb +74 -0
  557. data/lib/datadog/tracing/metadata/analytics.rb +26 -0
  558. data/lib/datadog/tracing/metadata/errors.rb +24 -0
  559. data/lib/datadog/tracing/metadata/ext.rb +151 -0
  560. data/lib/datadog/tracing/metadata/tagging.rb +110 -0
  561. data/lib/datadog/tracing/metadata.rb +20 -0
  562. data/lib/datadog/tracing/pipeline/span_filter.rb +42 -0
  563. data/lib/datadog/tracing/pipeline/span_processor.rb +39 -0
  564. data/lib/datadog/tracing/pipeline.rb +65 -0
  565. data/lib/datadog/tracing/propagation/grpc.rb +88 -0
  566. data/lib/datadog/tracing/propagation/http.rb +109 -0
  567. data/lib/datadog/tracing/runtime/metrics.rb +19 -0
  568. data/lib/datadog/tracing/sampling/all_sampler.rb +25 -0
  569. data/lib/datadog/tracing/sampling/ext.rb +27 -0
  570. data/lib/datadog/tracing/sampling/matcher.rb +68 -0
  571. data/lib/datadog/tracing/sampling/priority_sampler.rb +113 -0
  572. data/lib/datadog/tracing/sampling/rate_by_key_sampler.rb +97 -0
  573. data/lib/datadog/tracing/sampling/rate_by_service_sampler.rb +41 -0
  574. data/lib/datadog/tracing/sampling/rate_limiter.rb +185 -0
  575. data/lib/datadog/tracing/sampling/rate_sampler.rb +55 -0
  576. data/lib/datadog/tracing/sampling/rule.rb +70 -0
  577. data/lib/datadog/tracing/sampling/rule_sampler.rb +133 -0
  578. data/lib/datadog/tracing/sampling/sampler.rb +44 -0
  579. data/lib/datadog/tracing/span.rb +212 -0
  580. data/lib/datadog/tracing/span_operation.rb +521 -0
  581. data/lib/datadog/tracing/sync_writer.rb +69 -0
  582. data/lib/datadog/tracing/trace_digest.rb +60 -0
  583. data/lib/datadog/tracing/trace_operation.rb +432 -0
  584. data/lib/datadog/tracing/trace_segment.rb +207 -0
  585. data/lib/datadog/tracing/tracer.rb +505 -0
  586. data/lib/datadog/tracing/workers/trace_writer.rb +195 -0
  587. data/lib/datadog/tracing/workers.rb +125 -0
  588. data/lib/datadog/tracing/writer.rb +180 -0
  589. data/lib/datadog/tracing.rb +142 -0
  590. data/lib/ddtrace/auto_instrument.rb +7 -1
  591. data/lib/ddtrace/auto_instrument_base.rb +2 -0
  592. data/lib/ddtrace/profiling/preload.rb +3 -2
  593. data/lib/ddtrace/transport/ext.rb +35 -0
  594. data/lib/ddtrace/transport/http/adapters/net.rb +17 -5
  595. data/lib/ddtrace/transport/http/adapters/registry.rb +2 -0
  596. data/lib/ddtrace/transport/http/adapters/test.rb +6 -2
  597. data/lib/ddtrace/transport/http/adapters/unix_socket.rb +25 -12
  598. data/lib/ddtrace/transport/http/api/endpoint.rb +2 -0
  599. data/lib/ddtrace/transport/http/api/fallbacks.rb +2 -0
  600. data/lib/ddtrace/transport/http/api/instance.rb +2 -0
  601. data/lib/ddtrace/transport/http/api/map.rb +2 -0
  602. data/lib/ddtrace/transport/http/api/spec.rb +2 -0
  603. data/lib/ddtrace/transport/http/api.rb +6 -11
  604. data/lib/ddtrace/transport/http/builder.rb +15 -6
  605. data/lib/ddtrace/transport/http/client.rb +4 -1
  606. data/lib/ddtrace/transport/http/env.rb +2 -0
  607. data/lib/ddtrace/transport/http/response.rb +2 -0
  608. data/lib/ddtrace/transport/http/statistics.rb +2 -0
  609. data/lib/ddtrace/transport/http/traces.rb +4 -0
  610. data/lib/ddtrace/transport/http.rb +38 -36
  611. data/lib/ddtrace/transport/io/client.rb +3 -1
  612. data/lib/ddtrace/transport/io/response.rb +2 -0
  613. data/lib/ddtrace/transport/io/traces.rb +5 -1
  614. data/lib/ddtrace/transport/io.rb +4 -2
  615. data/lib/ddtrace/transport/parcel.rb +5 -0
  616. data/lib/ddtrace/transport/request.rb +2 -0
  617. data/lib/ddtrace/transport/response.rb +2 -0
  618. data/lib/ddtrace/transport/serializable_trace.rb +118 -0
  619. data/lib/ddtrace/transport/statistics.rb +7 -4
  620. data/lib/ddtrace/transport/trace_formatter.rb +187 -0
  621. data/lib/ddtrace/transport/traces.rb +18 -7
  622. data/lib/ddtrace/version.rb +15 -12
  623. data/lib/ddtrace.rb +9 -79
  624. metadata +591 -1012
  625. data/.circleci/config.yml +0 -870
  626. data/.circleci/images/primary/Dockerfile-2.1.10 +0 -83
  627. data/.circleci/images/primary/Dockerfile-2.2.10 +0 -83
  628. data/.circleci/images/primary/Dockerfile-2.3.8 +0 -85
  629. data/.circleci/images/primary/Dockerfile-2.4.6 +0 -83
  630. data/.circleci/images/primary/Dockerfile-2.5.6 +0 -83
  631. data/.circleci/images/primary/Dockerfile-2.6.4 +0 -83
  632. data/.circleci/images/primary/Dockerfile-2.7.0 +0 -83
  633. data/.circleci/images/primary/Dockerfile-3.0.0 +0 -73
  634. data/.circleci/images/primary/Dockerfile-jruby-9.2-latest +0 -88
  635. data/.circleci/images/primary/Dockerfile-jruby-9.2.0.0 +0 -73
  636. data/.circleci/images/primary/Dockerfile-truffleruby-21.1.0 +0 -73
  637. data/.dockerignore +0 -0
  638. data/.env +0 -26
  639. data/.github/CODEOWNERS +0 -1
  640. data/.github/workflows/add-milestone-to-pull-requests.yml +0 -42
  641. data/.github/workflows/create-next-milestone.yml +0 -20
  642. data/.gitlab-ci.yml +0 -27
  643. data/.rspec +0 -1
  644. data/.rubocop.yml +0 -351
  645. data/.rubocop_todo.yml +0 -438
  646. data/.simplecov +0 -47
  647. data/.yardopts +0 -5
  648. data/Appraisals +0 -1323
  649. data/Gemfile +0 -69
  650. data/Rakefile +0 -939
  651. data/benchmarks/data/profiler-submission-marshal.gz +0 -0
  652. data/benchmarks/postgres_database.yml +0 -9
  653. data/benchmarks/profiler_sample_loop.rb +0 -69
  654. data/benchmarks/profiler_submission.rb +0 -93
  655. data/benchmarks/sidekiq_test.rb +0 -154
  656. data/docker-compose.yml +0 -414
  657. data/gemfiles/jruby_9.2.0.0_contrib.gemfile +0 -79
  658. data/gemfiles/jruby_9.2.0.0_contrib.gemfile.lock +0 -1518
  659. data/gemfiles/jruby_9.2.0.0_contrib_old.gemfile +0 -35
  660. data/gemfiles/jruby_9.2.0.0_contrib_old.gemfile.lock +0 -157
  661. data/gemfiles/jruby_9.2.0.0_core_old.gemfile +0 -34
  662. data/gemfiles/jruby_9.2.0.0_core_old.gemfile.lock +0 -153
  663. data/gemfiles/jruby_9.2.0.0_cucumber3.gemfile +0 -35
  664. data/gemfiles/jruby_9.2.0.0_cucumber3.gemfile.lock +0 -174
  665. data/gemfiles/jruby_9.2.0.0_cucumber4.gemfile +0 -35
  666. data/gemfiles/jruby_9.2.0.0_cucumber4.gemfile.lock +0 -206
  667. data/gemfiles/jruby_9.2.0.0_cucumber5.gemfile +0 -35
  668. data/gemfiles/jruby_9.2.0.0_cucumber5.gemfile.lock +0 -206
  669. data/gemfiles/jruby_9.2.0.0_rails5_mysql2.gemfile +0 -40
  670. data/gemfiles/jruby_9.2.0.0_rails5_mysql2.gemfile.lock +0 -271
  671. data/gemfiles/jruby_9.2.0.0_rails5_postgres.gemfile +0 -40
  672. data/gemfiles/jruby_9.2.0.0_rails5_postgres.gemfile.lock +0 -271
  673. data/gemfiles/jruby_9.2.0.0_rails5_postgres_redis.gemfile +0 -41
  674. data/gemfiles/jruby_9.2.0.0_rails5_postgres_redis.gemfile.lock +0 -273
  675. data/gemfiles/jruby_9.2.0.0_rails5_postgres_redis_activesupport.gemfile +0 -41
  676. data/gemfiles/jruby_9.2.0.0_rails5_postgres_redis_activesupport.gemfile.lock +0 -273
  677. data/gemfiles/jruby_9.2.0.0_rails5_postgres_sidekiq.gemfile +0 -42
  678. data/gemfiles/jruby_9.2.0.0_rails5_postgres_sidekiq.gemfile.lock +0 -279
  679. data/gemfiles/jruby_9.2.0.0_rails61_mysql2.gemfile +0 -40
  680. data/gemfiles/jruby_9.2.0.0_rails61_mysql2.gemfile.lock +0 -290
  681. data/gemfiles/jruby_9.2.0.0_rails61_postgres.gemfile +0 -40
  682. data/gemfiles/jruby_9.2.0.0_rails61_postgres.gemfile.lock +0 -290
  683. data/gemfiles/jruby_9.2.0.0_rails61_postgres_redis.gemfile +0 -41
  684. data/gemfiles/jruby_9.2.0.0_rails61_postgres_redis.gemfile.lock +0 -292
  685. data/gemfiles/jruby_9.2.0.0_rails61_postgres_sidekiq.gemfile +0 -41
  686. data/gemfiles/jruby_9.2.0.0_rails61_postgres_sidekiq.gemfile.lock +0 -297
  687. data/gemfiles/jruby_9.2.0.0_rails6_mysql2.gemfile +0 -40
  688. data/gemfiles/jruby_9.2.0.0_rails6_mysql2.gemfile.lock +0 -287
  689. data/gemfiles/jruby_9.2.0.0_rails6_postgres.gemfile +0 -40
  690. data/gemfiles/jruby_9.2.0.0_rails6_postgres.gemfile.lock +0 -287
  691. data/gemfiles/jruby_9.2.0.0_rails6_postgres_redis.gemfile +0 -41
  692. data/gemfiles/jruby_9.2.0.0_rails6_postgres_redis.gemfile.lock +0 -289
  693. data/gemfiles/jruby_9.2.0.0_rails6_postgres_redis_activesupport.gemfile +0 -41
  694. data/gemfiles/jruby_9.2.0.0_rails6_postgres_redis_activesupport.gemfile.lock +0 -289
  695. data/gemfiles/jruby_9.2.0.0_rails6_postgres_sidekiq.gemfile +0 -42
  696. data/gemfiles/jruby_9.2.0.0_rails6_postgres_sidekiq.gemfile.lock +0 -295
  697. data/gemfiles/jruby_9.2.0.0_resque2_redis3.gemfile +0 -36
  698. data/gemfiles/jruby_9.2.0.0_resque2_redis3.gemfile.lock +0 -180
  699. data/gemfiles/jruby_9.2.0.0_resque2_redis4.gemfile +0 -36
  700. data/gemfiles/jruby_9.2.0.0_resque2_redis4.gemfile.lock +0 -180
  701. data/gemfiles/jruby_9.2.11.1_contrib.gemfile +0 -79
  702. data/gemfiles/jruby_9.2.11.1_contrib.gemfile.lock +0 -1518
  703. data/gemfiles/jruby_9.2.11.1_contrib_old.gemfile +0 -35
  704. data/gemfiles/jruby_9.2.11.1_contrib_old.gemfile.lock +0 -157
  705. data/gemfiles/jruby_9.2.11.1_core_old.gemfile +0 -34
  706. data/gemfiles/jruby_9.2.11.1_core_old.gemfile.lock +0 -153
  707. data/gemfiles/jruby_9.2.11.1_cucumber3.gemfile +0 -35
  708. data/gemfiles/jruby_9.2.11.1_cucumber3.gemfile.lock +0 -174
  709. data/gemfiles/jruby_9.2.11.1_cucumber4.gemfile +0 -35
  710. data/gemfiles/jruby_9.2.11.1_cucumber4.gemfile.lock +0 -206
  711. data/gemfiles/jruby_9.2.11.1_cucumber5.gemfile +0 -35
  712. data/gemfiles/jruby_9.2.11.1_cucumber5.gemfile.lock +0 -206
  713. data/gemfiles/jruby_9.2.11.1_rails5_mysql2.gemfile +0 -40
  714. data/gemfiles/jruby_9.2.11.1_rails5_mysql2.gemfile.lock +0 -271
  715. data/gemfiles/jruby_9.2.11.1_rails5_postgres.gemfile +0 -40
  716. data/gemfiles/jruby_9.2.11.1_rails5_postgres.gemfile.lock +0 -271
  717. data/gemfiles/jruby_9.2.11.1_rails5_postgres_redis.gemfile +0 -41
  718. data/gemfiles/jruby_9.2.11.1_rails5_postgres_redis.gemfile.lock +0 -273
  719. data/gemfiles/jruby_9.2.11.1_rails5_postgres_redis_activesupport.gemfile +0 -41
  720. data/gemfiles/jruby_9.2.11.1_rails5_postgres_redis_activesupport.gemfile.lock +0 -273
  721. data/gemfiles/jruby_9.2.11.1_rails5_postgres_sidekiq.gemfile +0 -42
  722. data/gemfiles/jruby_9.2.11.1_rails5_postgres_sidekiq.gemfile.lock +0 -279
  723. data/gemfiles/jruby_9.2.11.1_rails61_mysql2.gemfile +0 -40
  724. data/gemfiles/jruby_9.2.11.1_rails61_mysql2.gemfile.lock +0 -290
  725. data/gemfiles/jruby_9.2.11.1_rails61_postgres.gemfile +0 -40
  726. data/gemfiles/jruby_9.2.11.1_rails61_postgres.gemfile.lock +0 -290
  727. data/gemfiles/jruby_9.2.11.1_rails61_postgres_redis.gemfile +0 -41
  728. data/gemfiles/jruby_9.2.11.1_rails61_postgres_redis.gemfile.lock +0 -292
  729. data/gemfiles/jruby_9.2.11.1_rails61_postgres_sidekiq.gemfile +0 -41
  730. data/gemfiles/jruby_9.2.11.1_rails61_postgres_sidekiq.gemfile.lock +0 -297
  731. data/gemfiles/jruby_9.2.11.1_rails6_mysql2.gemfile +0 -40
  732. data/gemfiles/jruby_9.2.11.1_rails6_mysql2.gemfile.lock +0 -287
  733. data/gemfiles/jruby_9.2.11.1_rails6_postgres.gemfile +0 -40
  734. data/gemfiles/jruby_9.2.11.1_rails6_postgres.gemfile.lock +0 -287
  735. data/gemfiles/jruby_9.2.11.1_rails6_postgres_redis.gemfile +0 -41
  736. data/gemfiles/jruby_9.2.11.1_rails6_postgres_redis.gemfile.lock +0 -289
  737. data/gemfiles/jruby_9.2.11.1_rails6_postgres_redis_activesupport.gemfile +0 -41
  738. data/gemfiles/jruby_9.2.11.1_rails6_postgres_redis_activesupport.gemfile.lock +0 -289
  739. data/gemfiles/jruby_9.2.11.1_rails6_postgres_sidekiq.gemfile +0 -42
  740. data/gemfiles/jruby_9.2.11.1_rails6_postgres_sidekiq.gemfile.lock +0 -295
  741. data/gemfiles/jruby_9.2.11.1_resque2_redis3.gemfile +0 -36
  742. data/gemfiles/jruby_9.2.11.1_resque2_redis3.gemfile.lock +0 -180
  743. data/gemfiles/jruby_9.2.11.1_resque2_redis4.gemfile +0 -36
  744. data/gemfiles/jruby_9.2.11.1_resque2_redis4.gemfile.lock +0 -180
  745. data/gemfiles/ruby_2.1.10_contrib_old.gemfile +0 -66
  746. data/gemfiles/ruby_2.1.10_contrib_old.gemfile.lock +0 -305
  747. data/gemfiles/ruby_2.1.10_core_old.gemfile +0 -33
  748. data/gemfiles/ruby_2.1.10_core_old.gemfile.lock +0 -118
  749. data/gemfiles/ruby_2.1.10_rails30_postgres.gemfile +0 -39
  750. data/gemfiles/ruby_2.1.10_rails30_postgres.gemfile.lock +0 -196
  751. data/gemfiles/ruby_2.1.10_rails30_postgres_sidekiq.gemfile +0 -40
  752. data/gemfiles/ruby_2.1.10_rails30_postgres_sidekiq.gemfile.lock +0 -205
  753. data/gemfiles/ruby_2.1.10_rails32_mysql2.gemfile +0 -42
  754. data/gemfiles/ruby_2.1.10_rails32_mysql2.gemfile.lock +0 -215
  755. data/gemfiles/ruby_2.1.10_rails32_postgres.gemfile +0 -39
  756. data/gemfiles/ruby_2.1.10_rails32_postgres.gemfile.lock +0 -204
  757. data/gemfiles/ruby_2.1.10_rails32_postgres_redis.gemfile +0 -41
  758. data/gemfiles/ruby_2.1.10_rails32_postgres_redis.gemfile.lock +0 -223
  759. data/gemfiles/ruby_2.1.10_rails32_postgres_sidekiq.gemfile +0 -40
  760. data/gemfiles/ruby_2.1.10_rails32_postgres_sidekiq.gemfile.lock +0 -213
  761. data/gemfiles/ruby_2.1.10_rails4_mysql2.gemfile +0 -38
  762. data/gemfiles/ruby_2.1.10_rails4_mysql2.gemfile.lock +0 -218
  763. data/gemfiles/ruby_2.1.10_rails4_postgres.gemfile +0 -38
  764. data/gemfiles/ruby_2.1.10_rails4_postgres.gemfile.lock +0 -218
  765. data/gemfiles/ruby_2.1.10_rails4_postgres_redis.gemfile +0 -40
  766. data/gemfiles/ruby_2.1.10_rails4_postgres_redis.gemfile.lock +0 -237
  767. data/gemfiles/ruby_2.2.10_contrib.gemfile +0 -73
  768. data/gemfiles/ruby_2.2.10_contrib.gemfile.lock +0 -1450
  769. data/gemfiles/ruby_2.2.10_core_old.gemfile +0 -33
  770. data/gemfiles/ruby_2.2.10_core_old.gemfile.lock +0 -118
  771. data/gemfiles/ruby_2.2.10_rails30_postgres.gemfile +0 -39
  772. data/gemfiles/ruby_2.2.10_rails30_postgres.gemfile.lock +0 -196
  773. data/gemfiles/ruby_2.2.10_rails30_postgres_sidekiq.gemfile +0 -40
  774. data/gemfiles/ruby_2.2.10_rails30_postgres_sidekiq.gemfile.lock +0 -205
  775. data/gemfiles/ruby_2.2.10_rails32_mysql2.gemfile +0 -41
  776. data/gemfiles/ruby_2.2.10_rails32_mysql2.gemfile.lock +0 -212
  777. data/gemfiles/ruby_2.2.10_rails32_postgres.gemfile +0 -39
  778. data/gemfiles/ruby_2.2.10_rails32_postgres.gemfile.lock +0 -204
  779. data/gemfiles/ruby_2.2.10_rails32_postgres_redis.gemfile +0 -41
  780. data/gemfiles/ruby_2.2.10_rails32_postgres_redis.gemfile.lock +0 -223
  781. data/gemfiles/ruby_2.2.10_rails32_postgres_sidekiq.gemfile +0 -40
  782. data/gemfiles/ruby_2.2.10_rails32_postgres_sidekiq.gemfile.lock +0 -213
  783. data/gemfiles/ruby_2.2.10_rails4_mysql2.gemfile +0 -38
  784. data/gemfiles/ruby_2.2.10_rails4_mysql2.gemfile.lock +0 -218
  785. data/gemfiles/ruby_2.2.10_rails4_postgres.gemfile +0 -38
  786. data/gemfiles/ruby_2.2.10_rails4_postgres.gemfile.lock +0 -218
  787. data/gemfiles/ruby_2.2.10_rails4_postgres_redis.gemfile +0 -40
  788. data/gemfiles/ruby_2.2.10_rails4_postgres_redis.gemfile.lock +0 -237
  789. data/gemfiles/ruby_2.2.10_rails4_postgres_sidekiq.gemfile +0 -40
  790. data/gemfiles/ruby_2.2.10_rails4_postgres_sidekiq.gemfile.lock +0 -229
  791. data/gemfiles/ruby_2.2.10_rails5_mysql2.gemfile +0 -38
  792. data/gemfiles/ruby_2.2.10_rails5_mysql2.gemfile.lock +0 -234
  793. data/gemfiles/ruby_2.2.10_rails5_postgres.gemfile +0 -38
  794. data/gemfiles/ruby_2.2.10_rails5_postgres.gemfile.lock +0 -234
  795. data/gemfiles/ruby_2.2.10_rails5_postgres_redis.gemfile +0 -39
  796. data/gemfiles/ruby_2.2.10_rails5_postgres_redis.gemfile.lock +0 -236
  797. data/gemfiles/ruby_2.2.10_rails5_postgres_redis_activesupport.gemfile +0 -39
  798. data/gemfiles/ruby_2.2.10_rails5_postgres_redis_activesupport.gemfile.lock +0 -236
  799. data/gemfiles/ruby_2.2.10_rails5_postgres_sidekiq.gemfile +0 -40
  800. data/gemfiles/ruby_2.2.10_rails5_postgres_sidekiq.gemfile.lock +0 -245
  801. data/gemfiles/ruby_2.3.8_contrib.gemfile +0 -73
  802. data/gemfiles/ruby_2.3.8_contrib.gemfile.lock +0 -1459
  803. data/gemfiles/ruby_2.3.8_contrib_old.gemfile +0 -34
  804. data/gemfiles/ruby_2.3.8_contrib_old.gemfile.lock +0 -127
  805. data/gemfiles/ruby_2.3.8_core_old.gemfile +0 -33
  806. data/gemfiles/ruby_2.3.8_core_old.gemfile.lock +0 -123
  807. data/gemfiles/ruby_2.3.8_cucumber3.gemfile +0 -34
  808. data/gemfiles/ruby_2.3.8_cucumber3.gemfile.lock +0 -144
  809. data/gemfiles/ruby_2.3.8_cucumber4.gemfile +0 -34
  810. data/gemfiles/ruby_2.3.8_cucumber4.gemfile.lock +0 -174
  811. data/gemfiles/ruby_2.3.8_rails30_postgres.gemfile +0 -39
  812. data/gemfiles/ruby_2.3.8_rails30_postgres.gemfile.lock +0 -201
  813. data/gemfiles/ruby_2.3.8_rails30_postgres_sidekiq.gemfile +0 -40
  814. data/gemfiles/ruby_2.3.8_rails30_postgres_sidekiq.gemfile.lock +0 -210
  815. data/gemfiles/ruby_2.3.8_rails32_mysql2.gemfile +0 -41
  816. data/gemfiles/ruby_2.3.8_rails32_mysql2.gemfile.lock +0 -217
  817. data/gemfiles/ruby_2.3.8_rails32_postgres.gemfile +0 -39
  818. data/gemfiles/ruby_2.3.8_rails32_postgres.gemfile.lock +0 -209
  819. data/gemfiles/ruby_2.3.8_rails32_postgres_redis.gemfile +0 -41
  820. data/gemfiles/ruby_2.3.8_rails32_postgres_redis.gemfile.lock +0 -228
  821. data/gemfiles/ruby_2.3.8_rails32_postgres_sidekiq.gemfile +0 -40
  822. data/gemfiles/ruby_2.3.8_rails32_postgres_sidekiq.gemfile.lock +0 -218
  823. data/gemfiles/ruby_2.3.8_rails4_mysql2.gemfile +0 -38
  824. data/gemfiles/ruby_2.3.8_rails4_mysql2.gemfile.lock +0 -223
  825. data/gemfiles/ruby_2.3.8_rails4_postgres.gemfile +0 -38
  826. data/gemfiles/ruby_2.3.8_rails4_postgres.gemfile.lock +0 -223
  827. data/gemfiles/ruby_2.3.8_rails4_postgres_redis.gemfile +0 -40
  828. data/gemfiles/ruby_2.3.8_rails4_postgres_redis.gemfile.lock +0 -242
  829. data/gemfiles/ruby_2.3.8_rails4_postgres_sidekiq.gemfile +0 -40
  830. data/gemfiles/ruby_2.3.8_rails4_postgres_sidekiq.gemfile.lock +0 -234
  831. data/gemfiles/ruby_2.3.8_rails5_mysql2.gemfile +0 -37
  832. data/gemfiles/ruby_2.3.8_rails5_mysql2.gemfile.lock +0 -234
  833. data/gemfiles/ruby_2.3.8_rails5_postgres.gemfile +0 -37
  834. data/gemfiles/ruby_2.3.8_rails5_postgres.gemfile.lock +0 -234
  835. data/gemfiles/ruby_2.3.8_rails5_postgres_redis.gemfile +0 -38
  836. data/gemfiles/ruby_2.3.8_rails5_postgres_redis.gemfile.lock +0 -236
  837. data/gemfiles/ruby_2.3.8_rails5_postgres_redis_activesupport.gemfile +0 -38
  838. data/gemfiles/ruby_2.3.8_rails5_postgres_redis_activesupport.gemfile.lock +0 -236
  839. data/gemfiles/ruby_2.3.8_rails5_postgres_sidekiq.gemfile +0 -39
  840. data/gemfiles/ruby_2.3.8_rails5_postgres_sidekiq.gemfile.lock +0 -245
  841. data/gemfiles/ruby_2.3.8_resque2_redis3.gemfile +0 -35
  842. data/gemfiles/ruby_2.3.8_resque2_redis3.gemfile.lock +0 -150
  843. data/gemfiles/ruby_2.3.8_resque2_redis4.gemfile +0 -35
  844. data/gemfiles/ruby_2.3.8_resque2_redis4.gemfile.lock +0 -150
  845. data/gemfiles/ruby_2.4.6_contrib.gemfile +0 -78
  846. data/gemfiles/ruby_2.4.6_contrib.gemfile.lock +0 -1513
  847. data/gemfiles/ruby_2.4.6_contrib_old.gemfile +0 -38
  848. data/gemfiles/ruby_2.4.6_contrib_old.gemfile.lock +0 -155
  849. data/gemfiles/ruby_2.4.6_core_old.gemfile +0 -37
  850. data/gemfiles/ruby_2.4.6_core_old.gemfile.lock +0 -151
  851. data/gemfiles/ruby_2.4.6_cucumber3.gemfile +0 -38
  852. data/gemfiles/ruby_2.4.6_cucumber3.gemfile.lock +0 -172
  853. data/gemfiles/ruby_2.4.6_cucumber4.gemfile +0 -38
  854. data/gemfiles/ruby_2.4.6_cucumber4.gemfile.lock +0 -202
  855. data/gemfiles/ruby_2.4.6_rails5_mysql2.gemfile +0 -41
  856. data/gemfiles/ruby_2.4.6_rails5_mysql2.gemfile.lock +0 -262
  857. data/gemfiles/ruby_2.4.6_rails5_postgres.gemfile +0 -41
  858. data/gemfiles/ruby_2.4.6_rails5_postgres.gemfile.lock +0 -262
  859. data/gemfiles/ruby_2.4.6_rails5_postgres_redis.gemfile +0 -42
  860. data/gemfiles/ruby_2.4.6_rails5_postgres_redis.gemfile.lock +0 -264
  861. data/gemfiles/ruby_2.4.6_rails5_postgres_redis_activesupport.gemfile +0 -42
  862. data/gemfiles/ruby_2.4.6_rails5_postgres_redis_activesupport.gemfile.lock +0 -264
  863. data/gemfiles/ruby_2.4.6_rails5_postgres_sidekiq.gemfile +0 -43
  864. data/gemfiles/ruby_2.4.6_rails5_postgres_sidekiq.gemfile.lock +0 -273
  865. data/gemfiles/ruby_2.4.6_resque2_redis3.gemfile +0 -39
  866. data/gemfiles/ruby_2.4.6_resque2_redis3.gemfile.lock +0 -178
  867. data/gemfiles/ruby_2.4.6_resque2_redis4.gemfile +0 -39
  868. data/gemfiles/ruby_2.4.6_resque2_redis4.gemfile.lock +0 -178
  869. data/gemfiles/ruby_2.5.6_contrib.gemfile +0 -83
  870. data/gemfiles/ruby_2.5.6_contrib.gemfile.lock +0 -1526
  871. data/gemfiles/ruby_2.5.6_contrib_old.gemfile +0 -39
  872. data/gemfiles/ruby_2.5.6_contrib_old.gemfile.lock +0 -165
  873. data/gemfiles/ruby_2.5.6_core_old.gemfile +0 -38
  874. data/gemfiles/ruby_2.5.6_core_old.gemfile.lock +0 -161
  875. data/gemfiles/ruby_2.5.6_cucumber3.gemfile +0 -39
  876. data/gemfiles/ruby_2.5.6_cucumber3.gemfile.lock +0 -182
  877. data/gemfiles/ruby_2.5.6_cucumber4.gemfile +0 -39
  878. data/gemfiles/ruby_2.5.6_cucumber4.gemfile.lock +0 -214
  879. data/gemfiles/ruby_2.5.6_cucumber5.gemfile +0 -39
  880. data/gemfiles/ruby_2.5.6_cucumber5.gemfile.lock +0 -214
  881. data/gemfiles/ruby_2.5.6_rails5_mysql2.gemfile +0 -44
  882. data/gemfiles/ruby_2.5.6_rails5_mysql2.gemfile.lock +0 -276
  883. data/gemfiles/ruby_2.5.6_rails5_postgres.gemfile +0 -44
  884. data/gemfiles/ruby_2.5.6_rails5_postgres.gemfile.lock +0 -276
  885. data/gemfiles/ruby_2.5.6_rails5_postgres_redis.gemfile +0 -45
  886. data/gemfiles/ruby_2.5.6_rails5_postgres_redis.gemfile.lock +0 -278
  887. data/gemfiles/ruby_2.5.6_rails5_postgres_redis_activesupport.gemfile +0 -45
  888. data/gemfiles/ruby_2.5.6_rails5_postgres_redis_activesupport.gemfile.lock +0 -278
  889. data/gemfiles/ruby_2.5.6_rails5_postgres_sidekiq.gemfile +0 -46
  890. data/gemfiles/ruby_2.5.6_rails5_postgres_sidekiq.gemfile.lock +0 -284
  891. data/gemfiles/ruby_2.5.6_rails61_mysql2.gemfile +0 -44
  892. data/gemfiles/ruby_2.5.6_rails61_mysql2.gemfile.lock +0 -295
  893. data/gemfiles/ruby_2.5.6_rails61_postgres.gemfile +0 -44
  894. data/gemfiles/ruby_2.5.6_rails61_postgres.gemfile.lock +0 -295
  895. data/gemfiles/ruby_2.5.6_rails61_postgres_redis.gemfile +0 -45
  896. data/gemfiles/ruby_2.5.6_rails61_postgres_redis.gemfile.lock +0 -297
  897. data/gemfiles/ruby_2.5.6_rails61_postgres_sidekiq.gemfile +0 -45
  898. data/gemfiles/ruby_2.5.6_rails61_postgres_sidekiq.gemfile.lock +0 -302
  899. data/gemfiles/ruby_2.5.6_rails6_mysql2.gemfile +0 -44
  900. data/gemfiles/ruby_2.5.6_rails6_mysql2.gemfile.lock +0 -292
  901. data/gemfiles/ruby_2.5.6_rails6_postgres.gemfile +0 -44
  902. data/gemfiles/ruby_2.5.6_rails6_postgres.gemfile.lock +0 -292
  903. data/gemfiles/ruby_2.5.6_rails6_postgres_redis.gemfile +0 -45
  904. data/gemfiles/ruby_2.5.6_rails6_postgres_redis.gemfile.lock +0 -294
  905. data/gemfiles/ruby_2.5.6_rails6_postgres_redis_activesupport.gemfile +0 -45
  906. data/gemfiles/ruby_2.5.6_rails6_postgres_redis_activesupport.gemfile.lock +0 -294
  907. data/gemfiles/ruby_2.5.6_rails6_postgres_sidekiq.gemfile +0 -46
  908. data/gemfiles/ruby_2.5.6_rails6_postgres_sidekiq.gemfile.lock +0 -300
  909. data/gemfiles/ruby_2.5.6_resque2_redis3.gemfile +0 -40
  910. data/gemfiles/ruby_2.5.6_resque2_redis3.gemfile.lock +0 -188
  911. data/gemfiles/ruby_2.5.6_resque2_redis4.gemfile +0 -40
  912. data/gemfiles/ruby_2.5.6_resque2_redis4.gemfile.lock +0 -188
  913. data/gemfiles/ruby_2.6.4_contrib.gemfile +0 -79
  914. data/gemfiles/ruby_2.6.4_contrib.gemfile.lock +0 -1524
  915. data/gemfiles/ruby_2.6.4_contrib_old.gemfile +0 -39
  916. data/gemfiles/ruby_2.6.4_contrib_old.gemfile.lock +0 -167
  917. data/gemfiles/ruby_2.6.4_core_old.gemfile +0 -38
  918. data/gemfiles/ruby_2.6.4_core_old.gemfile.lock +0 -163
  919. data/gemfiles/ruby_2.6.4_cucumber3.gemfile +0 -39
  920. data/gemfiles/ruby_2.6.4_cucumber3.gemfile.lock +0 -184
  921. data/gemfiles/ruby_2.6.4_cucumber4.gemfile +0 -39
  922. data/gemfiles/ruby_2.6.4_cucumber4.gemfile.lock +0 -216
  923. data/gemfiles/ruby_2.6.4_cucumber5.gemfile +0 -39
  924. data/gemfiles/ruby_2.6.4_cucumber5.gemfile.lock +0 -216
  925. data/gemfiles/ruby_2.6.4_rails5_mysql2.gemfile +0 -42
  926. data/gemfiles/ruby_2.6.4_rails5_mysql2.gemfile.lock +0 -276
  927. data/gemfiles/ruby_2.6.4_rails5_postgres.gemfile +0 -42
  928. data/gemfiles/ruby_2.6.4_rails5_postgres.gemfile.lock +0 -276
  929. data/gemfiles/ruby_2.6.4_rails5_postgres_redis.gemfile +0 -43
  930. data/gemfiles/ruby_2.6.4_rails5_postgres_redis.gemfile.lock +0 -278
  931. data/gemfiles/ruby_2.6.4_rails5_postgres_redis_activesupport.gemfile +0 -43
  932. data/gemfiles/ruby_2.6.4_rails5_postgres_redis_activesupport.gemfile.lock +0 -278
  933. data/gemfiles/ruby_2.6.4_rails5_postgres_sidekiq.gemfile +0 -44
  934. data/gemfiles/ruby_2.6.4_rails5_postgres_sidekiq.gemfile.lock +0 -284
  935. data/gemfiles/ruby_2.6.4_rails61_mysql2.gemfile +0 -42
  936. data/gemfiles/ruby_2.6.4_rails61_mysql2.gemfile.lock +0 -295
  937. data/gemfiles/ruby_2.6.4_rails61_postgres.gemfile +0 -42
  938. data/gemfiles/ruby_2.6.4_rails61_postgres.gemfile.lock +0 -295
  939. data/gemfiles/ruby_2.6.4_rails61_postgres_redis.gemfile +0 -43
  940. data/gemfiles/ruby_2.6.4_rails61_postgres_redis.gemfile.lock +0 -297
  941. data/gemfiles/ruby_2.6.4_rails61_postgres_sidekiq.gemfile +0 -43
  942. data/gemfiles/ruby_2.6.4_rails61_postgres_sidekiq.gemfile.lock +0 -302
  943. data/gemfiles/ruby_2.6.4_rails6_mysql2.gemfile +0 -42
  944. data/gemfiles/ruby_2.6.4_rails6_mysql2.gemfile.lock +0 -292
  945. data/gemfiles/ruby_2.6.4_rails6_postgres.gemfile +0 -42
  946. data/gemfiles/ruby_2.6.4_rails6_postgres.gemfile.lock +0 -292
  947. data/gemfiles/ruby_2.6.4_rails6_postgres_redis.gemfile +0 -43
  948. data/gemfiles/ruby_2.6.4_rails6_postgres_redis.gemfile.lock +0 -294
  949. data/gemfiles/ruby_2.6.4_rails6_postgres_redis_activesupport.gemfile +0 -43
  950. data/gemfiles/ruby_2.6.4_rails6_postgres_redis_activesupport.gemfile.lock +0 -294
  951. data/gemfiles/ruby_2.6.4_rails6_postgres_sidekiq.gemfile +0 -44
  952. data/gemfiles/ruby_2.6.4_rails6_postgres_sidekiq.gemfile.lock +0 -300
  953. data/gemfiles/ruby_2.6.4_resque2_redis3.gemfile +0 -40
  954. data/gemfiles/ruby_2.6.4_resque2_redis3.gemfile.lock +0 -190
  955. data/gemfiles/ruby_2.6.4_resque2_redis4.gemfile +0 -40
  956. data/gemfiles/ruby_2.6.4_resque2_redis4.gemfile.lock +0 -190
  957. data/gemfiles/ruby_2.7.0_contrib.gemfile +0 -78
  958. data/gemfiles/ruby_2.7.0_contrib.gemfile.lock +0 -1523
  959. data/gemfiles/ruby_2.7.0_contrib_old.gemfile +0 -39
  960. data/gemfiles/ruby_2.7.0_contrib_old.gemfile.lock +0 -167
  961. data/gemfiles/ruby_2.7.0_core_old.gemfile +0 -38
  962. data/gemfiles/ruby_2.7.0_core_old.gemfile.lock +0 -163
  963. data/gemfiles/ruby_2.7.0_cucumber3.gemfile +0 -39
  964. data/gemfiles/ruby_2.7.0_cucumber3.gemfile.lock +0 -184
  965. data/gemfiles/ruby_2.7.0_cucumber4.gemfile +0 -39
  966. data/gemfiles/ruby_2.7.0_cucumber4.gemfile.lock +0 -216
  967. data/gemfiles/ruby_2.7.0_cucumber5.gemfile +0 -39
  968. data/gemfiles/ruby_2.7.0_cucumber5.gemfile.lock +0 -216
  969. data/gemfiles/ruby_2.7.0_rails5_mysql2.gemfile +0 -42
  970. data/gemfiles/ruby_2.7.0_rails5_mysql2.gemfile.lock +0 -276
  971. data/gemfiles/ruby_2.7.0_rails5_postgres.gemfile +0 -42
  972. data/gemfiles/ruby_2.7.0_rails5_postgres.gemfile.lock +0 -276
  973. data/gemfiles/ruby_2.7.0_rails5_postgres_redis.gemfile +0 -44
  974. data/gemfiles/ruby_2.7.0_rails5_postgres_redis.gemfile.lock +0 -295
  975. data/gemfiles/ruby_2.7.0_rails5_postgres_redis_activesupport.gemfile +0 -44
  976. data/gemfiles/ruby_2.7.0_rails5_postgres_redis_activesupport.gemfile.lock +0 -295
  977. data/gemfiles/ruby_2.7.0_rails5_postgres_sidekiq.gemfile +0 -44
  978. data/gemfiles/ruby_2.7.0_rails5_postgres_sidekiq.gemfile.lock +0 -284
  979. data/gemfiles/ruby_2.7.0_rails61_mysql2.gemfile +0 -42
  980. data/gemfiles/ruby_2.7.0_rails61_mysql2.gemfile.lock +0 -295
  981. data/gemfiles/ruby_2.7.0_rails61_postgres.gemfile +0 -42
  982. data/gemfiles/ruby_2.7.0_rails61_postgres.gemfile.lock +0 -295
  983. data/gemfiles/ruby_2.7.0_rails61_postgres_redis.gemfile +0 -43
  984. data/gemfiles/ruby_2.7.0_rails61_postgres_redis.gemfile.lock +0 -297
  985. data/gemfiles/ruby_2.7.0_rails61_postgres_sidekiq.gemfile +0 -43
  986. data/gemfiles/ruby_2.7.0_rails61_postgres_sidekiq.gemfile.lock +0 -302
  987. data/gemfiles/ruby_2.7.0_rails6_mysql2.gemfile +0 -42
  988. data/gemfiles/ruby_2.7.0_rails6_mysql2.gemfile.lock +0 -292
  989. data/gemfiles/ruby_2.7.0_rails6_postgres.gemfile +0 -42
  990. data/gemfiles/ruby_2.7.0_rails6_postgres.gemfile.lock +0 -292
  991. data/gemfiles/ruby_2.7.0_rails6_postgres_redis.gemfile +0 -44
  992. data/gemfiles/ruby_2.7.0_rails6_postgres_redis.gemfile.lock +0 -311
  993. data/gemfiles/ruby_2.7.0_rails6_postgres_redis_activesupport.gemfile +0 -44
  994. data/gemfiles/ruby_2.7.0_rails6_postgres_redis_activesupport.gemfile.lock +0 -311
  995. data/gemfiles/ruby_2.7.0_rails6_postgres_sidekiq.gemfile +0 -44
  996. data/gemfiles/ruby_2.7.0_rails6_postgres_sidekiq.gemfile.lock +0 -300
  997. data/gemfiles/ruby_2.7.0_resque2_redis3.gemfile +0 -40
  998. data/gemfiles/ruby_2.7.0_resque2_redis3.gemfile.lock +0 -190
  999. data/gemfiles/ruby_2.7.0_resque2_redis4.gemfile +0 -40
  1000. data/gemfiles/ruby_2.7.0_resque2_redis4.gemfile.lock +0 -190
  1001. data/gemfiles/ruby_3.0.0_contrib.gemfile +0 -78
  1002. data/gemfiles/ruby_3.0.0_contrib.gemfile.lock +0 -1540
  1003. data/gemfiles/ruby_3.0.0_core_old.gemfile +0 -39
  1004. data/gemfiles/ruby_3.0.0_core_old.gemfile.lock +0 -165
  1005. data/gemfiles/ruby_3.0.0_cucumber3.gemfile +0 -40
  1006. data/gemfiles/ruby_3.0.0_cucumber3.gemfile.lock +0 -186
  1007. data/gemfiles/ruby_3.0.0_cucumber4.gemfile +0 -40
  1008. data/gemfiles/ruby_3.0.0_cucumber4.gemfile.lock +0 -218
  1009. data/gemfiles/ruby_3.0.0_cucumber5.gemfile +0 -40
  1010. data/gemfiles/ruby_3.0.0_cucumber5.gemfile.lock +0 -218
  1011. data/gemfiles/ruby_3.0.0_rails61_mysql2.gemfile +0 -43
  1012. data/gemfiles/ruby_3.0.0_rails61_mysql2.gemfile.lock +0 -295
  1013. data/gemfiles/ruby_3.0.0_rails61_postgres.gemfile +0 -43
  1014. data/gemfiles/ruby_3.0.0_rails61_postgres.gemfile.lock +0 -295
  1015. data/gemfiles/ruby_3.0.0_rails61_postgres_redis.gemfile +0 -44
  1016. data/gemfiles/ruby_3.0.0_rails61_postgres_redis.gemfile.lock +0 -297
  1017. data/gemfiles/ruby_3.0.0_rails61_postgres_sidekiq.gemfile +0 -44
  1018. data/gemfiles/ruby_3.0.0_rails61_postgres_sidekiq.gemfile.lock +0 -302
  1019. data/gemfiles/ruby_3.0.0_resque2_redis3.gemfile +0 -41
  1020. data/gemfiles/ruby_3.0.0_resque2_redis3.gemfile.lock +0 -192
  1021. data/gemfiles/ruby_3.0.0_resque2_redis4.gemfile +0 -41
  1022. data/gemfiles/ruby_3.0.0_resque2_redis4.gemfile.lock +0 -192
  1023. data/integration/README.md +0 -67
  1024. data/integration/apps/rack/.dockerignore +0 -1
  1025. data/integration/apps/rack/.envrc.sample +0 -1
  1026. data/integration/apps/rack/.gitignore +0 -4
  1027. data/integration/apps/rack/.rspec +0 -1
  1028. data/integration/apps/rack/Dockerfile +0 -28
  1029. data/integration/apps/rack/Dockerfile-ci +0 -11
  1030. data/integration/apps/rack/Gemfile +0 -24
  1031. data/integration/apps/rack/README.md +0 -93
  1032. data/integration/apps/rack/app/acme.rb +0 -80
  1033. data/integration/apps/rack/app/datadog.rb +0 -17
  1034. data/integration/apps/rack/bin/run +0 -22
  1035. data/integration/apps/rack/bin/setup +0 -17
  1036. data/integration/apps/rack/bin/test +0 -24
  1037. data/integration/apps/rack/config/puma.rb +0 -14
  1038. data/integration/apps/rack/config/unicorn.rb +0 -23
  1039. data/integration/apps/rack/config.ru +0 -6
  1040. data/integration/apps/rack/docker-compose.ci.yml +0 -62
  1041. data/integration/apps/rack/docker-compose.yml +0 -78
  1042. data/integration/apps/rack/script/build-images +0 -38
  1043. data/integration/apps/rack/script/ci +0 -51
  1044. data/integration/apps/rack/spec/integration/basic_spec.rb +0 -10
  1045. data/integration/apps/rack/spec/spec_helper.rb +0 -16
  1046. data/integration/apps/rack/spec/support/integration_helper.rb +0 -22
  1047. data/integration/apps/rails-five/.dockerignore +0 -1
  1048. data/integration/apps/rails-five/.env +0 -3
  1049. data/integration/apps/rails-five/.envrc.sample +0 -1
  1050. data/integration/apps/rails-five/.gitignore +0 -30
  1051. data/integration/apps/rails-five/Dockerfile +0 -25
  1052. data/integration/apps/rails-five/Dockerfile-ci +0 -11
  1053. data/integration/apps/rails-five/Gemfile +0 -104
  1054. data/integration/apps/rails-five/README.md +0 -94
  1055. data/integration/apps/rails-five/Rakefile +0 -6
  1056. data/integration/apps/rails-five/app/channels/application_cable/channel.rb +0 -4
  1057. data/integration/apps/rails-five/app/channels/application_cable/connection.rb +0 -4
  1058. data/integration/apps/rails-five/app/controllers/application_controller.rb +0 -2
  1059. data/integration/apps/rails-five/app/controllers/basic_controller.rb +0 -36
  1060. data/integration/apps/rails-five/app/controllers/concerns/.keep +0 -0
  1061. data/integration/apps/rails-five/app/controllers/health_controller.rb +0 -9
  1062. data/integration/apps/rails-five/app/controllers/jobs_controller.rb +0 -12
  1063. data/integration/apps/rails-five/app/jobs/application_job.rb +0 -2
  1064. data/integration/apps/rails-five/app/jobs/test_job.rb +0 -12
  1065. data/integration/apps/rails-five/app/mailers/application_mailer.rb +0 -4
  1066. data/integration/apps/rails-five/app/models/application_record.rb +0 -3
  1067. data/integration/apps/rails-five/app/models/concerns/.keep +0 -0
  1068. data/integration/apps/rails-five/app/models/test.rb +0 -2
  1069. data/integration/apps/rails-five/app/views/layouts/mailer.html.erb +0 -13
  1070. data/integration/apps/rails-five/app/views/layouts/mailer.text.erb +0 -1
  1071. data/integration/apps/rails-five/bin/bundle +0 -3
  1072. data/integration/apps/rails-five/bin/rails +0 -9
  1073. data/integration/apps/rails-five/bin/rake +0 -9
  1074. data/integration/apps/rails-five/bin/run +0 -24
  1075. data/integration/apps/rails-five/bin/setup +0 -27
  1076. data/integration/apps/rails-five/bin/spring +0 -17
  1077. data/integration/apps/rails-five/bin/test +0 -21
  1078. data/integration/apps/rails-five/bin/update +0 -28
  1079. data/integration/apps/rails-five/config/application.rb +0 -97
  1080. data/integration/apps/rails-five/config/boot.rb +0 -4
  1081. data/integration/apps/rails-five/config/cable.yml +0 -10
  1082. data/integration/apps/rails-five/config/credentials.yml.enc +0 -1
  1083. data/integration/apps/rails-five/config/database.yml +0 -28
  1084. data/integration/apps/rails-five/config/environment.rb +0 -5
  1085. data/integration/apps/rails-five/config/environments/development.rb +0 -51
  1086. data/integration/apps/rails-five/config/environments/production.rb +0 -82
  1087. data/integration/apps/rails-five/config/environments/test.rb +0 -43
  1088. data/integration/apps/rails-five/config/initializers/datadog.rb +0 -18
  1089. data/integration/apps/rails-five/config/initializers/filter_parameter_logging.rb +0 -4
  1090. data/integration/apps/rails-five/config/initializers/resque.rb +0 -4
  1091. data/integration/apps/rails-five/config/initializers/rollbar.rb +0 -5
  1092. data/integration/apps/rails-five/config/initializers/wrap_parameters.rb +0 -14
  1093. data/integration/apps/rails-five/config/locales/en.yml +0 -33
  1094. data/integration/apps/rails-five/config/puma.rb +0 -24
  1095. data/integration/apps/rails-five/config/routes.rb +0 -11
  1096. data/integration/apps/rails-five/config/spring.rb +0 -6
  1097. data/integration/apps/rails-five/config/unicorn.rb +0 -29
  1098. data/integration/apps/rails-five/config.ru +0 -5
  1099. data/integration/apps/rails-five/db/migrate/20190927215052_create_tests.rb +0 -11
  1100. data/integration/apps/rails-five/db/schema.rb +0 -23
  1101. data/integration/apps/rails-five/db/seeds.rb +0 -7
  1102. data/integration/apps/rails-five/docker-compose.ci.yml +0 -98
  1103. data/integration/apps/rails-five/docker-compose.yml +0 -100
  1104. data/integration/apps/rails-five/lib/tasks/.keep +0 -0
  1105. data/integration/apps/rails-five/log/.keep +0 -0
  1106. data/integration/apps/rails-five/public/robots.txt +0 -1
  1107. data/integration/apps/rails-five/script/build-images +0 -35
  1108. data/integration/apps/rails-five/script/ci +0 -51
  1109. data/integration/apps/rails-five/spec/integration/basic_spec.rb +0 -10
  1110. data/integration/apps/rails-five/spec/spec_helper.rb +0 -16
  1111. data/integration/apps/rails-five/spec/support/integration_helper.rb +0 -22
  1112. data/integration/apps/rails-five/storage/.keep +0 -0
  1113. data/integration/apps/rails-five/tmp/.keep +0 -0
  1114. data/integration/apps/rails-five/vendor/.keep +0 -0
  1115. data/integration/apps/rspec/.dockerignore +0 -1
  1116. data/integration/apps/rspec/.envrc.sample +0 -1
  1117. data/integration/apps/rspec/.gitignore +0 -2
  1118. data/integration/apps/rspec/.rspec +0 -1
  1119. data/integration/apps/rspec/Dockerfile +0 -25
  1120. data/integration/apps/rspec/Dockerfile-ci +0 -11
  1121. data/integration/apps/rspec/Gemfile +0 -14
  1122. data/integration/apps/rspec/README.md +0 -70
  1123. data/integration/apps/rspec/agent.yaml +0 -3
  1124. data/integration/apps/rspec/app/datadog.rb +0 -13
  1125. data/integration/apps/rspec/app/fibonacci.rb +0 -30
  1126. data/integration/apps/rspec/bin/run +0 -20
  1127. data/integration/apps/rspec/bin/setup +0 -17
  1128. data/integration/apps/rspec/bin/test +0 -21
  1129. data/integration/apps/rspec/docker-compose.ci.yml +0 -51
  1130. data/integration/apps/rspec/docker-compose.yml +0 -63
  1131. data/integration/apps/rspec/script/build-images +0 -37
  1132. data/integration/apps/rspec/script/ci +0 -53
  1133. data/integration/apps/rspec/spec/fibonacci_spec.rb +0 -16
  1134. data/integration/apps/rspec/spec/rspec_spec.rb +0 -58
  1135. data/integration/apps/rspec/spec/spec_helper.rb +0 -24
  1136. data/integration/apps/ruby/.dockerignore +0 -1
  1137. data/integration/apps/ruby/.envrc.sample +0 -1
  1138. data/integration/apps/ruby/.gitignore +0 -2
  1139. data/integration/apps/ruby/Dockerfile +0 -25
  1140. data/integration/apps/ruby/Dockerfile-ci +0 -11
  1141. data/integration/apps/ruby/Gemfile +0 -11
  1142. data/integration/apps/ruby/README.md +0 -70
  1143. data/integration/apps/ruby/agent.yaml +0 -3
  1144. data/integration/apps/ruby/app/datadog.rb +0 -13
  1145. data/integration/apps/ruby/app/fibonacci.rb +0 -58
  1146. data/integration/apps/ruby/bin/run +0 -20
  1147. data/integration/apps/ruby/bin/setup +0 -17
  1148. data/integration/apps/ruby/bin/test +0 -21
  1149. data/integration/apps/ruby/docker-compose.ci.yml +0 -51
  1150. data/integration/apps/ruby/docker-compose.yml +0 -63
  1151. data/integration/apps/ruby/script/build-images +0 -38
  1152. data/integration/apps/ruby/script/ci +0 -51
  1153. data/integration/images/agent/Dockerfile +0 -2
  1154. data/integration/images/agent/agent.yaml +0 -3
  1155. data/integration/images/include/datadog/analyzer.rb +0 -71
  1156. data/integration/images/include/datadog/demo_env.rb +0 -101
  1157. data/integration/images/include/http-health-check +0 -33
  1158. data/integration/images/ruby/2.1/Dockerfile +0 -54
  1159. data/integration/images/ruby/2.2/Dockerfile +0 -54
  1160. data/integration/images/ruby/2.3/Dockerfile +0 -70
  1161. data/integration/images/ruby/2.4/Dockerfile +0 -54
  1162. data/integration/images/ruby/2.5/Dockerfile +0 -54
  1163. data/integration/images/ruby/2.6/Dockerfile +0 -54
  1164. data/integration/images/ruby/2.7/Dockerfile +0 -54
  1165. data/integration/images/ruby/3.0/Dockerfile +0 -54
  1166. data/integration/images/wrk/Dockerfile +0 -33
  1167. data/integration/images/wrk/scripts/entrypoint.sh +0 -17
  1168. data/integration/images/wrk/scripts/scenarios/basic/default.lua +0 -1
  1169. data/integration/images/wrk/scripts/scenarios/basic/fibonacci.lua +0 -1
  1170. data/integration/script/build-images +0 -43
  1171. data/lib/datadog/ci/context_flush.rb +0 -28
  1172. data/lib/ddtrace/analytics.rb +0 -38
  1173. data/lib/ddtrace/buffer.rb +0 -326
  1174. data/lib/ddtrace/chunker.rb +0 -34
  1175. data/lib/ddtrace/configuration/agent_settings_resolver.rb +0 -230
  1176. data/lib/ddtrace/configuration/base.rb +0 -81
  1177. data/lib/ddtrace/configuration/components.rb +0 -249
  1178. data/lib/ddtrace/configuration/dependency_resolver.rb +0 -24
  1179. data/lib/ddtrace/configuration/option.rb +0 -64
  1180. data/lib/ddtrace/configuration/option_definition.rb +0 -121
  1181. data/lib/ddtrace/configuration/option_definition_set.rb +0 -18
  1182. data/lib/ddtrace/configuration/option_set.rb +0 -6
  1183. data/lib/ddtrace/configuration/options.rb +0 -111
  1184. data/lib/ddtrace/configuration/pin_setup.rb +0 -31
  1185. data/lib/ddtrace/configuration/settings.rb +0 -388
  1186. data/lib/ddtrace/configuration.rb +0 -176
  1187. data/lib/ddtrace/context.rb +0 -325
  1188. data/lib/ddtrace/context_flush.rb +0 -81
  1189. data/lib/ddtrace/context_provider.rb +0 -61
  1190. data/lib/ddtrace/contrib/action_cable/configuration/settings.rb +0 -30
  1191. data/lib/ddtrace/contrib/action_cable/event.rb +0 -66
  1192. data/lib/ddtrace/contrib/action_cable/events/broadcast.rb +0 -49
  1193. data/lib/ddtrace/contrib/action_cable/events/perform_action.rb +0 -55
  1194. data/lib/ddtrace/contrib/action_cable/events/transmit.rb +0 -50
  1195. data/lib/ddtrace/contrib/action_cable/events.rb +0 -33
  1196. data/lib/ddtrace/contrib/action_cable/ext.rb +0 -26
  1197. data/lib/ddtrace/contrib/action_cable/instrumentation.rb +0 -31
  1198. data/lib/ddtrace/contrib/action_cable/integration.rb +0 -45
  1199. data/lib/ddtrace/contrib/action_cable/patcher.rb +0 -27
  1200. data/lib/ddtrace/contrib/action_pack/action_controller/instrumentation.rb +0 -146
  1201. data/lib/ddtrace/contrib/action_pack/action_controller/patcher.rb +0 -25
  1202. data/lib/ddtrace/contrib/action_pack/configuration/settings.rb +0 -32
  1203. data/lib/ddtrace/contrib/action_pack/ext.rb +0 -19
  1204. data/lib/ddtrace/contrib/action_pack/integration.rb +0 -45
  1205. data/lib/ddtrace/contrib/action_pack/patcher.rb +0 -23
  1206. data/lib/ddtrace/contrib/action_pack/utils.rb +0 -36
  1207. data/lib/ddtrace/contrib/action_view/configuration/settings.rb +0 -31
  1208. data/lib/ddtrace/contrib/action_view/event.rb +0 -35
  1209. data/lib/ddtrace/contrib/action_view/events/render_partial.rb +0 -46
  1210. data/lib/ddtrace/contrib/action_view/events/render_template.rb +0 -49
  1211. data/lib/ddtrace/contrib/action_view/events.rb +0 -30
  1212. data/lib/ddtrace/contrib/action_view/ext.rb +0 -20
  1213. data/lib/ddtrace/contrib/action_view/instrumentation/partial_renderer.rb +0 -74
  1214. data/lib/ddtrace/contrib/action_view/instrumentation/template_renderer.rb +0 -167
  1215. data/lib/ddtrace/contrib/action_view/integration.rb +0 -52
  1216. data/lib/ddtrace/contrib/action_view/patcher.rb +0 -47
  1217. data/lib/ddtrace/contrib/action_view/utils.rb +0 -32
  1218. data/lib/ddtrace/contrib/active_model_serializers/configuration/settings.rb +0 -30
  1219. data/lib/ddtrace/contrib/active_model_serializers/event.rb +0 -68
  1220. data/lib/ddtrace/contrib/active_model_serializers/events/render.rb +0 -32
  1221. data/lib/ddtrace/contrib/active_model_serializers/events/serialize.rb +0 -35
  1222. data/lib/ddtrace/contrib/active_model_serializers/events.rb +0 -30
  1223. data/lib/ddtrace/contrib/active_model_serializers/ext.rb +0 -20
  1224. data/lib/ddtrace/contrib/active_model_serializers/integration.rb +0 -40
  1225. data/lib/ddtrace/contrib/active_model_serializers/patcher.rb +0 -29
  1226. data/lib/ddtrace/contrib/active_record/configuration/makara_resolver.rb +0 -30
  1227. data/lib/ddtrace/contrib/active_record/configuration/resolver.rb +0 -134
  1228. data/lib/ddtrace/contrib/active_record/configuration/settings.rb +0 -35
  1229. data/lib/ddtrace/contrib/active_record/event.rb +0 -30
  1230. data/lib/ddtrace/contrib/active_record/events/instantiation.rb +0 -60
  1231. data/lib/ddtrace/contrib/active_record/events/sql.rb +0 -68
  1232. data/lib/ddtrace/contrib/active_record/events.rb +0 -30
  1233. data/lib/ddtrace/contrib/active_record/ext.rb +0 -24
  1234. data/lib/ddtrace/contrib/active_record/integration.rb +0 -53
  1235. data/lib/ddtrace/contrib/active_record/patcher.rb +0 -23
  1236. data/lib/ddtrace/contrib/active_record/utils.rb +0 -123
  1237. data/lib/ddtrace/contrib/active_support/cache/instrumentation.rb +0 -258
  1238. data/lib/ddtrace/contrib/active_support/cache/patcher.rb +0 -69
  1239. data/lib/ddtrace/contrib/active_support/cache/redis.rb +0 -43
  1240. data/lib/ddtrace/contrib/active_support/configuration/settings.rb +0 -30
  1241. data/lib/ddtrace/contrib/active_support/ext.rb +0 -27
  1242. data/lib/ddtrace/contrib/active_support/integration.rb +0 -46
  1243. data/lib/ddtrace/contrib/active_support/notifications/event.rb +0 -75
  1244. data/lib/ddtrace/contrib/active_support/notifications/subscriber.rb +0 -67
  1245. data/lib/ddtrace/contrib/active_support/notifications/subscription.rb +0 -163
  1246. data/lib/ddtrace/contrib/active_support/patcher.rb +0 -23
  1247. data/lib/ddtrace/contrib/analytics.rb +0 -24
  1248. data/lib/ddtrace/contrib/auto_instrument.rb +0 -48
  1249. data/lib/ddtrace/contrib/aws/configuration/settings.rb +0 -30
  1250. data/lib/ddtrace/contrib/aws/ext.rb +0 -23
  1251. data/lib/ddtrace/contrib/aws/instrumentation.rb +0 -90
  1252. data/lib/ddtrace/contrib/aws/integration.rb +0 -42
  1253. data/lib/ddtrace/contrib/aws/parsed_context.rb +0 -56
  1254. data/lib/ddtrace/contrib/aws/patcher.rb +0 -53
  1255. data/lib/ddtrace/contrib/aws/services.rb +0 -118
  1256. data/lib/ddtrace/contrib/concurrent_ruby/configuration/settings.rb +0 -20
  1257. data/lib/ddtrace/contrib/concurrent_ruby/context_composite_executor_service.rb +0 -41
  1258. data/lib/ddtrace/contrib/concurrent_ruby/ext.rb +0 -12
  1259. data/lib/ddtrace/contrib/concurrent_ruby/future_patch.rb +0 -23
  1260. data/lib/ddtrace/contrib/concurrent_ruby/integration.rb +0 -38
  1261. data/lib/ddtrace/contrib/concurrent_ruby/patcher.rb +0 -28
  1262. data/lib/ddtrace/contrib/configurable.rb +0 -102
  1263. data/lib/ddtrace/contrib/configuration/resolver.rb +0 -81
  1264. data/lib/ddtrace/contrib/configuration/resolvers/pattern_resolver.rb +0 -39
  1265. data/lib/ddtrace/contrib/configuration/settings.rb +0 -55
  1266. data/lib/ddtrace/contrib/dalli/configuration/settings.rb +0 -30
  1267. data/lib/ddtrace/contrib/dalli/ext.rb +0 -20
  1268. data/lib/ddtrace/contrib/dalli/instrumentation.rb +0 -54
  1269. data/lib/ddtrace/contrib/dalli/integration.rb +0 -38
  1270. data/lib/ddtrace/contrib/dalli/patcher.rb +0 -25
  1271. data/lib/ddtrace/contrib/dalli/quantize.rb +0 -22
  1272. data/lib/ddtrace/contrib/delayed_job/configuration/settings.rb +0 -32
  1273. data/lib/ddtrace/contrib/delayed_job/ext.rb +0 -23
  1274. data/lib/ddtrace/contrib/delayed_job/integration.rb +0 -38
  1275. data/lib/ddtrace/contrib/delayed_job/patcher.rb +0 -28
  1276. data/lib/ddtrace/contrib/delayed_job/plugin.rb +0 -84
  1277. data/lib/ddtrace/contrib/elasticsearch/configuration/settings.rb +0 -31
  1278. data/lib/ddtrace/contrib/elasticsearch/ext.rb +0 -22
  1279. data/lib/ddtrace/contrib/elasticsearch/integration.rb +0 -39
  1280. data/lib/ddtrace/contrib/elasticsearch/patcher.rb +0 -122
  1281. data/lib/ddtrace/contrib/elasticsearch/quantize.rb +0 -81
  1282. data/lib/ddtrace/contrib/ethon/configuration/settings.rb +0 -32
  1283. data/lib/ddtrace/contrib/ethon/easy_patch.rb +0 -151
  1284. data/lib/ddtrace/contrib/ethon/ext.rb +0 -19
  1285. data/lib/ddtrace/contrib/ethon/integration.rb +0 -43
  1286. data/lib/ddtrace/contrib/ethon/multi_patch.rb +0 -84
  1287. data/lib/ddtrace/contrib/ethon/patcher.rb +0 -25
  1288. data/lib/ddtrace/contrib/excon/configuration/settings.rb +0 -33
  1289. data/lib/ddtrace/contrib/excon/ext.rb +0 -17
  1290. data/lib/ddtrace/contrib/excon/integration.rb +0 -43
  1291. data/lib/ddtrace/contrib/excon/middleware.rb +0 -163
  1292. data/lib/ddtrace/contrib/excon/patcher.rb +0 -27
  1293. data/lib/ddtrace/contrib/extensions.rb +0 -143
  1294. data/lib/ddtrace/contrib/faraday/configuration/settings.rb +0 -38
  1295. data/lib/ddtrace/contrib/faraday/connection.rb +0 -18
  1296. data/lib/ddtrace/contrib/faraday/ext.rb +0 -17
  1297. data/lib/ddtrace/contrib/faraday/integration.rb +0 -43
  1298. data/lib/ddtrace/contrib/faraday/middleware.rb +0 -85
  1299. data/lib/ddtrace/contrib/faraday/patcher.rb +0 -53
  1300. data/lib/ddtrace/contrib/faraday/rack_builder.rb +0 -18
  1301. data/lib/ddtrace/contrib/grape/configuration/settings.rb +0 -38
  1302. data/lib/ddtrace/contrib/grape/endpoint.rb +0 -236
  1303. data/lib/ddtrace/contrib/grape/ext.rb +0 -23
  1304. data/lib/ddtrace/contrib/grape/instrumentation.rb +0 -33
  1305. data/lib/ddtrace/contrib/grape/integration.rb +0 -39
  1306. data/lib/ddtrace/contrib/grape/patcher.rb +0 -31
  1307. data/lib/ddtrace/contrib/graphql/configuration/settings.rb +0 -32
  1308. data/lib/ddtrace/contrib/graphql/ext.rb +0 -16
  1309. data/lib/ddtrace/contrib/graphql/integration.rb +0 -39
  1310. data/lib/ddtrace/contrib/graphql/patcher.rb +0 -60
  1311. data/lib/ddtrace/contrib/grpc/configuration/settings.rb +0 -30
  1312. data/lib/ddtrace/contrib/grpc/datadog_interceptor/client.rb +0 -58
  1313. data/lib/ddtrace/contrib/grpc/datadog_interceptor/server.rb +0 -81
  1314. data/lib/ddtrace/contrib/grpc/datadog_interceptor.rb +0 -74
  1315. data/lib/ddtrace/contrib/grpc/ext.rb +0 -18
  1316. data/lib/ddtrace/contrib/grpc/integration.rb +0 -38
  1317. data/lib/ddtrace/contrib/grpc/intercept_with_datadog.rb +0 -49
  1318. data/lib/ddtrace/contrib/grpc/patcher.rb +0 -32
  1319. data/lib/ddtrace/contrib/http/circuit_breaker.rb +0 -37
  1320. data/lib/ddtrace/contrib/http/configuration/settings.rb +0 -32
  1321. data/lib/ddtrace/contrib/http/ext.rb +0 -17
  1322. data/lib/ddtrace/contrib/http/instrumentation.rb +0 -179
  1323. data/lib/ddtrace/contrib/http/integration.rb +0 -45
  1324. data/lib/ddtrace/contrib/http/patcher.rb +0 -26
  1325. data/lib/ddtrace/contrib/http_annotation_helper.rb +0 -10
  1326. data/lib/ddtrace/contrib/httpclient/configuration/settings.rb +0 -32
  1327. data/lib/ddtrace/contrib/httpclient/ext.rb +0 -17
  1328. data/lib/ddtrace/contrib/httpclient/instrumentation.rb +0 -147
  1329. data/lib/ddtrace/contrib/httpclient/integration.rb +0 -43
  1330. data/lib/ddtrace/contrib/httpclient/patcher.rb +0 -38
  1331. data/lib/ddtrace/contrib/httprb/configuration/settings.rb +0 -32
  1332. data/lib/ddtrace/contrib/httprb/ext.rb +0 -17
  1333. data/lib/ddtrace/contrib/httprb/instrumentation.rb +0 -157
  1334. data/lib/ddtrace/contrib/httprb/integration.rb +0 -43
  1335. data/lib/ddtrace/contrib/httprb/patcher.rb +0 -38
  1336. data/lib/ddtrace/contrib/integration.rb +0 -16
  1337. data/lib/ddtrace/contrib/kafka/configuration/settings.rb +0 -30
  1338. data/lib/ddtrace/contrib/kafka/consumer_event.rb +0 -14
  1339. data/lib/ddtrace/contrib/kafka/consumer_group_event.rb +0 -14
  1340. data/lib/ddtrace/contrib/kafka/event.rb +0 -51
  1341. data/lib/ddtrace/contrib/kafka/events/connection/request.rb +0 -34
  1342. data/lib/ddtrace/contrib/kafka/events/consumer/process_batch.rb +0 -41
  1343. data/lib/ddtrace/contrib/kafka/events/consumer/process_message.rb +0 -39
  1344. data/lib/ddtrace/contrib/kafka/events/consumer_group/heartbeat.rb +0 -39
  1345. data/lib/ddtrace/contrib/kafka/events/consumer_group/join_group.rb +0 -29
  1346. data/lib/ddtrace/contrib/kafka/events/consumer_group/leave_group.rb +0 -29
  1347. data/lib/ddtrace/contrib/kafka/events/consumer_group/sync_group.rb +0 -29
  1348. data/lib/ddtrace/contrib/kafka/events/produce_operation/send_messages.rb +0 -32
  1349. data/lib/ddtrace/contrib/kafka/events/producer/deliver_messages.rb +0 -35
  1350. data/lib/ddtrace/contrib/kafka/events.rb +0 -44
  1351. data/lib/ddtrace/contrib/kafka/ext.rb +0 -41
  1352. data/lib/ddtrace/contrib/kafka/integration.rb +0 -39
  1353. data/lib/ddtrace/contrib/kafka/patcher.rb +0 -26
  1354. data/lib/ddtrace/contrib/mongodb/configuration/settings.rb +0 -33
  1355. data/lib/ddtrace/contrib/mongodb/ext.rb +0 -23
  1356. data/lib/ddtrace/contrib/mongodb/instrumentation.rb +0 -69
  1357. data/lib/ddtrace/contrib/mongodb/integration.rb +0 -38
  1358. data/lib/ddtrace/contrib/mongodb/parsers.rb +0 -68
  1359. data/lib/ddtrace/contrib/mongodb/patcher.rb +0 -31
  1360. data/lib/ddtrace/contrib/mongodb/subscribers.rb +0 -111
  1361. data/lib/ddtrace/contrib/mysql2/configuration/settings.rb +0 -30
  1362. data/lib/ddtrace/contrib/mysql2/ext.rb +0 -18
  1363. data/lib/ddtrace/contrib/mysql2/instrumentation.rb +0 -64
  1364. data/lib/ddtrace/contrib/mysql2/integration.rb +0 -38
  1365. data/lib/ddtrace/contrib/mysql2/patcher.rb +0 -27
  1366. data/lib/ddtrace/contrib/patchable.rb +0 -70
  1367. data/lib/ddtrace/contrib/patcher.rb +0 -65
  1368. data/lib/ddtrace/contrib/presto/configuration/settings.rb +0 -30
  1369. data/lib/ddtrace/contrib/presto/ext.rb +0 -28
  1370. data/lib/ddtrace/contrib/presto/instrumentation.rb +0 -110
  1371. data/lib/ddtrace/contrib/presto/integration.rb +0 -38
  1372. data/lib/ddtrace/contrib/presto/patcher.rb +0 -33
  1373. data/lib/ddtrace/contrib/qless/configuration/settings.rb +0 -35
  1374. data/lib/ddtrace/contrib/qless/ext.rb +0 -20
  1375. data/lib/ddtrace/contrib/qless/integration.rb +0 -38
  1376. data/lib/ddtrace/contrib/qless/patcher.rb +0 -33
  1377. data/lib/ddtrace/contrib/qless/qless_job.rb +0 -73
  1378. data/lib/ddtrace/contrib/qless/tracer_cleaner.rb +0 -33
  1379. data/lib/ddtrace/contrib/que/configuration/settings.rb +0 -43
  1380. data/lib/ddtrace/contrib/que/ext.rb +0 -30
  1381. data/lib/ddtrace/contrib/que/integration.rb +0 -42
  1382. data/lib/ddtrace/contrib/que/patcher.rb +0 -24
  1383. data/lib/ddtrace/contrib/que/tracer.rb +0 -57
  1384. data/lib/ddtrace/contrib/racecar/configuration/settings.rb +0 -30
  1385. data/lib/ddtrace/contrib/racecar/event.rb +0 -76
  1386. data/lib/ddtrace/contrib/racecar/events/batch.rb +0 -27
  1387. data/lib/ddtrace/contrib/racecar/events/consume.rb +0 -27
  1388. data/lib/ddtrace/contrib/racecar/events/message.rb +0 -27
  1389. data/lib/ddtrace/contrib/racecar/events.rb +0 -32
  1390. data/lib/ddtrace/contrib/racecar/ext.rb +0 -25
  1391. data/lib/ddtrace/contrib/racecar/integration.rb +0 -39
  1392. data/lib/ddtrace/contrib/racecar/patcher.rb +0 -26
  1393. data/lib/ddtrace/contrib/rack/configuration/settings.rb +0 -46
  1394. data/lib/ddtrace/contrib/rack/ext.rb +0 -21
  1395. data/lib/ddtrace/contrib/rack/integration.rb +0 -45
  1396. data/lib/ddtrace/contrib/rack/middlewares.rb +0 -287
  1397. data/lib/ddtrace/contrib/rack/patcher.rb +0 -105
  1398. data/lib/ddtrace/contrib/rack/request_queue.rb +0 -44
  1399. data/lib/ddtrace/contrib/rails/auto_instrument_railtie.rb +0 -10
  1400. data/lib/ddtrace/contrib/rails/configuration/settings.rb +0 -93
  1401. data/lib/ddtrace/contrib/rails/ext.rb +0 -17
  1402. data/lib/ddtrace/contrib/rails/framework.rb +0 -124
  1403. data/lib/ddtrace/contrib/rails/integration.rb +0 -44
  1404. data/lib/ddtrace/contrib/rails/log_injection.rb +0 -81
  1405. data/lib/ddtrace/contrib/rails/middlewares.rb +0 -43
  1406. data/lib/ddtrace/contrib/rails/patcher.rb +0 -107
  1407. data/lib/ddtrace/contrib/rails/railtie.rb +0 -17
  1408. data/lib/ddtrace/contrib/rails/utils.rb +0 -24
  1409. data/lib/ddtrace/contrib/rake/configuration/settings.rb +0 -31
  1410. data/lib/ddtrace/contrib/rake/ext.rb +0 -21
  1411. data/lib/ddtrace/contrib/rake/instrumentation.rb +0 -90
  1412. data/lib/ddtrace/contrib/rake/integration.rb +0 -38
  1413. data/lib/ddtrace/contrib/rake/patcher.rb +0 -30
  1414. data/lib/ddtrace/contrib/redis/configuration/resolver.rb +0 -45
  1415. data/lib/ddtrace/contrib/redis/configuration/settings.rb +0 -35
  1416. data/lib/ddtrace/contrib/redis/ext.rb +0 -22
  1417. data/lib/ddtrace/contrib/redis/integration.rb +0 -42
  1418. data/lib/ddtrace/contrib/redis/patcher.rb +0 -114
  1419. data/lib/ddtrace/contrib/redis/quantize.rb +0 -75
  1420. data/lib/ddtrace/contrib/redis/tags.rb +0 -46
  1421. data/lib/ddtrace/contrib/redis/vendor/resolver.rb +0 -158
  1422. data/lib/ddtrace/contrib/registerable.rb +0 -33
  1423. data/lib/ddtrace/contrib/registry.rb +0 -42
  1424. data/lib/ddtrace/contrib/resque/configuration/settings.rb +0 -48
  1425. data/lib/ddtrace/contrib/resque/ext.rb +0 -17
  1426. data/lib/ddtrace/contrib/resque/integration.rb +0 -47
  1427. data/lib/ddtrace/contrib/resque/patcher.rb +0 -29
  1428. data/lib/ddtrace/contrib/resque/resque_job.rb +0 -103
  1429. data/lib/ddtrace/contrib/rest_client/configuration/settings.rb +0 -31
  1430. data/lib/ddtrace/contrib/rest_client/ext.rb +0 -17
  1431. data/lib/ddtrace/contrib/rest_client/integration.rb +0 -38
  1432. data/lib/ddtrace/contrib/rest_client/patcher.rb +0 -23
  1433. data/lib/ddtrace/contrib/rest_client/request_patch.rb +0 -91
  1434. data/lib/ddtrace/contrib/sequel/configuration/settings.rb +0 -28
  1435. data/lib/ddtrace/contrib/sequel/database.rb +0 -63
  1436. data/lib/ddtrace/contrib/sequel/dataset.rb +0 -63
  1437. data/lib/ddtrace/contrib/sequel/ext.rb +0 -19
  1438. data/lib/ddtrace/contrib/sequel/integration.rb +0 -38
  1439. data/lib/ddtrace/contrib/sequel/patcher.rb +0 -33
  1440. data/lib/ddtrace/contrib/sequel/utils.rb +0 -74
  1441. data/lib/ddtrace/contrib/shoryuken/configuration/settings.rb +0 -31
  1442. data/lib/ddtrace/contrib/shoryuken/ext.rb +0 -21
  1443. data/lib/ddtrace/contrib/shoryuken/integration.rb +0 -39
  1444. data/lib/ddtrace/contrib/shoryuken/patcher.rb +0 -24
  1445. data/lib/ddtrace/contrib/shoryuken/tracer.rb +0 -55
  1446. data/lib/ddtrace/contrib/sidekiq/client_tracer.rb +0 -43
  1447. data/lib/ddtrace/contrib/sidekiq/configuration/settings.rb +0 -37
  1448. data/lib/ddtrace/contrib/sidekiq/ext.rb +0 -27
  1449. data/lib/ddtrace/contrib/sidekiq/integration.rb +0 -38
  1450. data/lib/ddtrace/contrib/sidekiq/patcher.rb +0 -41
  1451. data/lib/ddtrace/contrib/sidekiq/server_tracer.rb +0 -65
  1452. data/lib/ddtrace/contrib/sidekiq/tracing.rb +0 -44
  1453. data/lib/ddtrace/contrib/sinatra/configuration/settings.rb +0 -39
  1454. data/lib/ddtrace/contrib/sinatra/env.rb +0 -57
  1455. data/lib/ddtrace/contrib/sinatra/ext.rb +0 -27
  1456. data/lib/ddtrace/contrib/sinatra/headers.rb +0 -29
  1457. data/lib/ddtrace/contrib/sinatra/integration.rb +0 -38
  1458. data/lib/ddtrace/contrib/sinatra/patcher.rb +0 -28
  1459. data/lib/ddtrace/contrib/sinatra/tracer.rb +0 -127
  1460. data/lib/ddtrace/contrib/sinatra/tracer_middleware.rb +0 -105
  1461. data/lib/ddtrace/contrib/sneakers/configuration/settings.rb +0 -33
  1462. data/lib/ddtrace/contrib/sneakers/ext.rb +0 -22
  1463. data/lib/ddtrace/contrib/sneakers/integration.rb +0 -41
  1464. data/lib/ddtrace/contrib/sneakers/patcher.rb +0 -24
  1465. data/lib/ddtrace/contrib/sneakers/tracer.rb +0 -53
  1466. data/lib/ddtrace/contrib/status_code_matcher.rb +0 -69
  1467. data/lib/ddtrace/contrib/sucker_punch/configuration/settings.rb +0 -30
  1468. data/lib/ddtrace/contrib/sucker_punch/exception_handler.rb +0 -24
  1469. data/lib/ddtrace/contrib/sucker_punch/ext.rb +0 -21
  1470. data/lib/ddtrace/contrib/sucker_punch/instrumentation.rb +0 -88
  1471. data/lib/ddtrace/contrib/sucker_punch/integration.rb +0 -38
  1472. data/lib/ddtrace/contrib/sucker_punch/patcher.rb +0 -42
  1473. data/lib/ddtrace/correlation.rb +0 -39
  1474. data/lib/ddtrace/diagnostics/environment_logger.rb +0 -279
  1475. data/lib/ddtrace/diagnostics/health.rb +0 -33
  1476. data/lib/ddtrace/distributed_tracing/headers/b3.rb +0 -44
  1477. data/lib/ddtrace/distributed_tracing/headers/b3_single.rb +0 -56
  1478. data/lib/ddtrace/distributed_tracing/headers/datadog.rb +0 -42
  1479. data/lib/ddtrace/distributed_tracing/headers/headers.rb +0 -71
  1480. data/lib/ddtrace/distributed_tracing/headers/helpers.rb +0 -43
  1481. data/lib/ddtrace/encoding.rb +0 -69
  1482. data/lib/ddtrace/environment.rb +0 -41
  1483. data/lib/ddtrace/error.rb +0 -96
  1484. data/lib/ddtrace/event.rb +0 -52
  1485. data/lib/ddtrace/ext/analytics.rb +0 -12
  1486. data/lib/ddtrace/ext/app_types.rb +0 -11
  1487. data/lib/ddtrace/ext/correlation.rb +0 -11
  1488. data/lib/ddtrace/ext/diagnostics.rb +0 -36
  1489. data/lib/ddtrace/ext/distributed.rb +0 -39
  1490. data/lib/ddtrace/ext/environment.rb +0 -16
  1491. data/lib/ddtrace/ext/errors.rb +0 -10
  1492. data/lib/ddtrace/ext/forced_tracing.rb +0 -25
  1493. data/lib/ddtrace/ext/git.rb +0 -11
  1494. data/lib/ddtrace/ext/http.rb +0 -46
  1495. data/lib/ddtrace/ext/integration.rb +0 -8
  1496. data/lib/ddtrace/ext/manual_tracing.rb +0 -9
  1497. data/lib/ddtrace/ext/metrics.rb +0 -15
  1498. data/lib/ddtrace/ext/net.rb +0 -10
  1499. data/lib/ddtrace/ext/priority.rb +0 -16
  1500. data/lib/ddtrace/ext/profiling.rb +0 -53
  1501. data/lib/ddtrace/ext/runtime.rb +0 -30
  1502. data/lib/ddtrace/ext/sampling.rb +0 -16
  1503. data/lib/ddtrace/ext/sql.rb +0 -8
  1504. data/lib/ddtrace/ext/test.rb +0 -8
  1505. data/lib/ddtrace/ext/transport.rb +0 -20
  1506. data/lib/ddtrace/forced_tracing.rb +0 -38
  1507. data/lib/ddtrace/logger.rb +0 -40
  1508. data/lib/ddtrace/metrics.rb +0 -255
  1509. data/lib/ddtrace/opentelemetry/extensions.rb +0 -13
  1510. data/lib/ddtrace/opentelemetry/span.rb +0 -33
  1511. data/lib/ddtrace/opentracer/binary_propagator.rb +0 -24
  1512. data/lib/ddtrace/opentracer/carrier.rb +0 -6
  1513. data/lib/ddtrace/opentracer/distributed_headers.rb +0 -55
  1514. data/lib/ddtrace/opentracer/global_tracer.rb +0 -15
  1515. data/lib/ddtrace/opentracer/propagator.rb +0 -22
  1516. data/lib/ddtrace/opentracer/rack_propagator.rb +0 -60
  1517. data/lib/ddtrace/opentracer/scope.rb +0 -15
  1518. data/lib/ddtrace/opentracer/scope_manager.rb +0 -6
  1519. data/lib/ddtrace/opentracer/span.rb +0 -94
  1520. data/lib/ddtrace/opentracer/span_context.rb +0 -14
  1521. data/lib/ddtrace/opentracer/span_context_factory.rb +0 -23
  1522. data/lib/ddtrace/opentracer/text_map_propagator.rb +0 -75
  1523. data/lib/ddtrace/opentracer/thread_local_scope.rb +0 -31
  1524. data/lib/ddtrace/opentracer/thread_local_scope_manager.rb +0 -40
  1525. data/lib/ddtrace/opentracer/tracer.rb +0 -208
  1526. data/lib/ddtrace/opentracer.rb +0 -21
  1527. data/lib/ddtrace/patcher.rb +0 -68
  1528. data/lib/ddtrace/pin.rb +0 -85
  1529. data/lib/ddtrace/pipeline/span_filter.rb +0 -38
  1530. data/lib/ddtrace/pipeline/span_processor.rb +0 -20
  1531. data/lib/ddtrace/pipeline.rb +0 -46
  1532. data/lib/ddtrace/profiling/backtrace_location.rb +0 -32
  1533. data/lib/ddtrace/profiling/buffer.rb +0 -41
  1534. data/lib/ddtrace/profiling/collectors/stack.rb +0 -262
  1535. data/lib/ddtrace/profiling/encoding/profile.rb +0 -37
  1536. data/lib/ddtrace/profiling/event.rb +0 -13
  1537. data/lib/ddtrace/profiling/events/stack.rb +0 -102
  1538. data/lib/ddtrace/profiling/exporter.rb +0 -23
  1539. data/lib/ddtrace/profiling/ext/cpu.rb +0 -52
  1540. data/lib/ddtrace/profiling/ext/cthread.rb +0 -155
  1541. data/lib/ddtrace/profiling/ext/forking.rb +0 -97
  1542. data/lib/ddtrace/profiling/flush.rb +0 -43
  1543. data/lib/ddtrace/profiling/pprof/builder.rb +0 -119
  1544. data/lib/ddtrace/profiling/pprof/converter.rb +0 -89
  1545. data/lib/ddtrace/profiling/pprof/message_set.rb +0 -12
  1546. data/lib/ddtrace/profiling/pprof/payload.rb +0 -18
  1547. data/lib/ddtrace/profiling/pprof/pprof_pb.rb +0 -81
  1548. data/lib/ddtrace/profiling/pprof/stack_sample.rb +0 -106
  1549. data/lib/ddtrace/profiling/pprof/string_table.rb +0 -10
  1550. data/lib/ddtrace/profiling/pprof/template.rb +0 -118
  1551. data/lib/ddtrace/profiling/profiler.rb +0 -30
  1552. data/lib/ddtrace/profiling/recorder.rb +0 -95
  1553. data/lib/ddtrace/profiling/scheduler.rb +0 -116
  1554. data/lib/ddtrace/profiling/tasks/setup.rb +0 -77
  1555. data/lib/ddtrace/profiling/transport/client.rb +0 -12
  1556. data/lib/ddtrace/profiling/transport/http/api/endpoint.rb +0 -100
  1557. data/lib/ddtrace/profiling/transport/http/api/instance.rb +0 -36
  1558. data/lib/ddtrace/profiling/transport/http/api/spec.rb +0 -40
  1559. data/lib/ddtrace/profiling/transport/http/api.rb +0 -43
  1560. data/lib/ddtrace/profiling/transport/http/builder.rb +0 -28
  1561. data/lib/ddtrace/profiling/transport/http/client.rb +0 -33
  1562. data/lib/ddtrace/profiling/transport/http/response.rb +0 -21
  1563. data/lib/ddtrace/profiling/transport/http.rb +0 -118
  1564. data/lib/ddtrace/profiling/transport/io/client.rb +0 -27
  1565. data/lib/ddtrace/profiling/transport/io/response.rb +0 -16
  1566. data/lib/ddtrace/profiling/transport/io.rb +0 -30
  1567. data/lib/ddtrace/profiling/transport/parcel.rb +0 -17
  1568. data/lib/ddtrace/profiling/transport/request.rb +0 -15
  1569. data/lib/ddtrace/profiling/transport/response.rb +0 -8
  1570. data/lib/ddtrace/profiling.rb +0 -107
  1571. data/lib/ddtrace/propagation/grpc_propagator.rb +0 -74
  1572. data/lib/ddtrace/propagation/http_propagator.rb +0 -90
  1573. data/lib/ddtrace/quantization/hash.rb +0 -103
  1574. data/lib/ddtrace/quantization/http.rb +0 -87
  1575. data/lib/ddtrace/runtime/cgroup.rb +0 -44
  1576. data/lib/ddtrace/runtime/class_count.rb +0 -17
  1577. data/lib/ddtrace/runtime/container.rb +0 -87
  1578. data/lib/ddtrace/runtime/gc.rb +0 -16
  1579. data/lib/ddtrace/runtime/identity.rb +0 -48
  1580. data/lib/ddtrace/runtime/metrics.rb +0 -112
  1581. data/lib/ddtrace/runtime/object_space.rb +0 -19
  1582. data/lib/ddtrace/runtime/socket.rb +0 -14
  1583. data/lib/ddtrace/runtime/thread_count.rb +0 -16
  1584. data/lib/ddtrace/sampler.rb +0 -292
  1585. data/lib/ddtrace/sampling/matcher.rb +0 -57
  1586. data/lib/ddtrace/sampling/rate_limiter.rb +0 -176
  1587. data/lib/ddtrace/sampling/rule.rb +0 -61
  1588. data/lib/ddtrace/sampling/rule_sampler.rb +0 -120
  1589. data/lib/ddtrace/sampling.rb +0 -2
  1590. data/lib/ddtrace/span.rb +0 -432
  1591. data/lib/ddtrace/sync_writer.rb +0 -68
  1592. data/lib/ddtrace/tasks/exec.rb +0 -48
  1593. data/lib/ddtrace/tasks/help.rb +0 -14
  1594. data/lib/ddtrace/tracer.rb +0 -457
  1595. data/lib/ddtrace/utils/compression.rb +0 -27
  1596. data/lib/ddtrace/utils/database.rb +0 -25
  1597. data/lib/ddtrace/utils/forking.rb +0 -52
  1598. data/lib/ddtrace/utils/object_set.rb +0 -39
  1599. data/lib/ddtrace/utils/only_once.rb +0 -40
  1600. data/lib/ddtrace/utils/sequence.rb +0 -17
  1601. data/lib/ddtrace/utils/string_table.rb +0 -45
  1602. data/lib/ddtrace/utils/time.rb +0 -43
  1603. data/lib/ddtrace/utils.rb +0 -68
  1604. data/lib/ddtrace/vendor/active_record/connection_specification.rb +0 -301
  1605. data/lib/ddtrace/vendor/multipart-post/multipart/post/composite_read_io.rb +0 -116
  1606. data/lib/ddtrace/vendor/multipart-post/multipart/post/multipartable.rb +0 -57
  1607. data/lib/ddtrace/vendor/multipart-post/multipart/post/parts.rb +0 -135
  1608. data/lib/ddtrace/vendor/multipart-post/multipart/post/version.rb +0 -9
  1609. data/lib/ddtrace/vendor/multipart-post/multipart/post.rb +0 -8
  1610. data/lib/ddtrace/vendor/multipart-post/multipart.rb +0 -12
  1611. data/lib/ddtrace/vendor/multipart-post/net/http/post/multipart.rb +0 -32
  1612. data/lib/ddtrace/worker.rb +0 -20
  1613. data/lib/ddtrace/workers/async.rb +0 -174
  1614. data/lib/ddtrace/workers/loop.rb +0 -131
  1615. data/lib/ddtrace/workers/polling.rb +0 -55
  1616. data/lib/ddtrace/workers/queue.rb +0 -40
  1617. data/lib/ddtrace/workers/runtime_metrics.rb +0 -64
  1618. data/lib/ddtrace/workers/trace_writer.rb +0 -199
  1619. data/lib/ddtrace/workers.rb +0 -122
  1620. data/lib/ddtrace/writer.rb +0 -199
  1621. data/tasks/release_gem.rake +0 -28
  1622. /data/lib/{ddtrace → datadog/core}/vendor/multipart-post/LICENSE +0 -0
  1623. /data/lib/{ddtrace → datadog}/profiling/pprof/pprof.proto +0 -0
  1624. /data/lib/{ddtrace/vendor/active_record → datadog/tracing/contrib/active_record/vendor}/MIT-LICENSE +0 -0
  1625. /data/lib/{ddtrace → datadog/tracing}/contrib/redis/vendor/LICENSE +0 -0
@@ -1,3 +1,5 @@
1
+ ***Version 1.0.0 is in beta! Check out our [upgrade guide](https://github.com/DataDog/dd-trace-rb/blob/master/docs/UpgradeGuide.md#from-0x-to-10) for more details.***
2
+
1
3
  # Datadog Ruby Trace Client
2
4
 
3
5
  `ddtrace` is Datadog’s tracing client for Ruby. It is used to trace requests as they flow across web servers,
@@ -9,6 +11,8 @@ For the general APM documentation, see our [setup documentation][setup docs].
9
11
 
10
12
  For more information about what APM looks like once your application is sending information to Datadog, take a look at [Visualizing your APM data][visualization docs].
11
13
 
14
+ For the library API documentation, see our [YARD documentation][yard docs].
15
+
12
16
  To contribute, check out the [contribution guidelines][contribution docs] and [development guide][development docs].
13
17
 
14
18
  [setup docs]: https://docs.datadoghq.com/tracing/
@@ -16,20 +20,27 @@ To contribute, check out the [contribution guidelines][contribution docs] and [d
16
20
  [visualization docs]: https://docs.datadoghq.com/tracing/visualization/
17
21
  [contribution docs]: https://github.com/DataDog/dd-trace-rb/blob/master/CONTRIBUTING.md
18
22
  [development docs]: https://github.com/DataDog/dd-trace-rb/blob/master/docs/DevelopmentGuide.md
23
+ [yard docs]: https://www.rubydoc.info/gems/ddtrace/
19
24
 
20
25
  ## Table of Contents
21
26
 
22
27
  - [Compatibility](#compatibility)
23
28
  - [Installation](#installation)
24
- - [Quickstart for Rails applications](#quickstart-for-rails-applications)
25
- - [Quickstart for Ruby applications](#quickstart-for-ruby-applications)
26
- - [Quickstart for OpenTracing](#quickstart-for-opentracing)
29
+ - [Setup the Datadog Agent for tracing](#setup-the-datadog-agent-for-tracing)
30
+ - [Instrument your application](#instrument-your-application)
31
+ - [Rails applications](#rails-applications)
32
+ - [Ruby applications](#ruby-applications)
33
+ - [Configuring OpenTracing](#configuring-opentracing)
34
+ - [Configuring OpenTelemetry](#configuring-opentelemetry)
35
+ - [Connect your application to the Datadog Agent](#connect-your-application-to-the-datadog-agent)
27
36
  - [Manual instrumentation](#manual-instrumentation)
28
37
  - [Integration instrumentation](#integration-instrumentation)
29
38
  - [Action Cable](#action-cable)
39
+ - [Action Mailer](#action-mailer)
40
+ - [Action Pack](#action-pack)
30
41
  - [Action View](#action-view)
42
+ - [Active Job](#active-job)
31
43
  - [Active Model Serializers](#active-model-serializers)
32
- - [Action Pack](#action-pack)
33
44
  - [Active Record](#active-record)
34
45
  - [Active Support](#active-support)
35
46
  - [AWS](#aws)
@@ -44,12 +55,13 @@ To contribute, check out the [contribution guidelines][contribution docs] and [d
44
55
  - [Grape](#grape)
45
56
  - [GraphQL](#graphql)
46
57
  - [gRPC](#grpc)
47
- - [http.rb](#http-rb)
58
+ - [http.rb](#httprb)
48
59
  - [httpclient](#httpclient)
49
60
  - [httpx](#httpx)
61
+ - [Kafka](#kafka)
50
62
  - [MongoDB](#mongodb)
51
63
  - [MySQL2](#mysql2)
52
- - [Net/HTTP](#net-http)
64
+ - [Net/HTTP](#nethttp)
53
65
  - [Presto](#presto)
54
66
  - [Qless](#qless)
55
67
  - [Que](#que)
@@ -58,20 +70,19 @@ To contribute, check out the [contribution guidelines][contribution docs] and [d
58
70
  - [Rails](#rails)
59
71
  - [Rake](#rake)
60
72
  - [Redis](#redis)
61
- - [Rest Client](#rest-client)
62
73
  - [Resque](#resque)
74
+ - [Rest Client](#rest-client)
63
75
  - [RSpec](#rspec)
64
- - [Shoryuken](#shoryuken)
65
76
  - [Sequel](#sequel)
77
+ - [Shoryuken](#shoryuken)
66
78
  - [Sidekiq](#sidekiq)
67
79
  - [Sinatra](#sinatra)
68
80
  - [Sneakers](#sneakers)
69
81
  - [Sucker Punch](#sucker-punch)
70
- - [Advanced configuration](#advanced-configuration)
71
- - [Tracer settings](#tracer-settings)
82
+ - [Additional configuration](#additional-configuration)
72
83
  - [Custom logging](#custom-logging)
73
84
  - [Environment and tags](#environment-and-tags)
74
- - [Environment variables](#environment-variables)
85
+ - [Debugging and diagnostics](#debugging-and-diagnostics)
75
86
  - [Sampling](#sampling)
76
87
  - [Application-side sampling](#application-side-sampling)
77
88
  - [Priority sampling](#priority-sampling)
@@ -86,6 +97,11 @@ To contribute, check out the [contribution guidelines][contribution docs] and [d
86
97
  - [For application runtime](#for-application-runtime)
87
98
  - [OpenTracing](#opentracing)
88
99
  - [Profiling](#profiling)
100
+ - [Troubleshooting](#troubleshooting)
101
+ - [Profiling Resque jobs](#profiling-resque-jobs)
102
+ - [Known issues and suggested configurations](#known-issues-and-suggested-configurations)
103
+ - [Payload too large](#payload-too-large)
104
+ - [Stack level too deep](#stack-level-too-deep)
89
105
 
90
106
  ## Compatibility
91
107
 
@@ -93,7 +109,8 @@ To contribute, check out the [contribution guidelines][contribution docs] and [d
93
109
 
94
110
  | Type | Documentation | Version | Support type | Gem version support |
95
111
  | ----- | -------------------------- | ----- | ------------------------------------ | ------------------- |
96
- | MRI | https://www.ruby-lang.org/ | 3.0 | Full | Latest |
112
+ | MRI | https://www.ruby-lang.org/ | 3.1 | Full | Latest |
113
+ | | | 3.0 | Full | Latest |
97
114
  | | | 2.7 | Full | Latest |
98
115
  | | | 2.6 | Full | Latest |
99
116
  | | | 2.5 | Full | Latest |
@@ -128,68 +145,106 @@ To contribute, check out the [contribution guidelines][contribution docs] and [d
128
145
 
129
146
  *EOL* indicates support is no longer provided.
130
147
 
148
+ ### Apple macOS support
149
+
150
+ Use of `ddtrace` on macOS is supported for development, but not for production deployments.
151
+
152
+ ### Microsoft Windows support
153
+
154
+ Using `ddtrace` on Microsoft Windows is currently unsupported. We'll still accept community contributions and issues,
155
+ but will consider them as having low priority.
156
+
131
157
  ## Installation
132
158
 
133
- The following steps will help you quickly start tracing your Ruby application.
159
+ Adding tracing to your Ruby application only takes a few quick steps:
134
160
 
135
- ### Configure the Datadog Agent for APM
161
+ 1. Setup the Datadog Agent for tracing
162
+ 2. Instrument your application
163
+ 3. Connect your application to the Datadog Agent
136
164
 
137
- Before downloading tracing on your application, install the Datadog Agent. The Ruby APM tracer sends trace data through the Datadog Agent.
165
+ ### Setup the Datadog Agent for tracing
138
166
 
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.
167
+ Before installing `ddtrace`, [install the Datadog Agent](https://docs.datadoghq.com/agent/), to which `ddtrace` will send trace data.
140
168
 
141
- #### Containers
169
+ Then configure the Datadog Agent to accept traces. To do this, either:
142
170
 
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).
171
+ - Set `DD_APM_ENABLED=true` in the agent's environment
144
172
 
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:
173
+ OR
146
174
 
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`.
175
+ - Add `apm_enabled: true` to the [agent's configuration file](https://docs.datadoghq.com/agent/guide/agent-configuration-files/?tab=agentv6v7#agent-main-configuration-file)
148
176
 
177
+ *Additionally, in containerized environments...*
149
178
 
150
- ### Quickstart for Rails applications
179
+ - Set `DD_APM_NON_LOCAL_TRAFFIC=true` in the agent's environment
151
180
 
152
- #### Automatic instrumentation
181
+ OR
153
182
 
154
- 1. Add the `ddtrace` gem to your Gemfile:
183
+ - Add `apm_non_local_traffic: true` to the [agent's configuration file](https://docs.datadoghq.com/agent/guide/agent-configuration-files/?tab=agentv6v7#agent-main-configuration-file).
155
184
 
156
- ```ruby
157
- source 'https://rubygems.org'
158
- gem 'ddtrace', require: 'ddtrace/auto_instrument'
159
- ```
185
+ 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.
160
186
 
161
- 2. Install the gem with `bundle install`
187
+ #### Configuring trace data ingestion
188
+
189
+ The Datadog agent will listen for traces via HTTP on port `8126` by default.
162
190
 
163
- 3. You can configure, override, or disable any specific integration settings by also adding a [Rails Manual Configuration](#rails-manual-configuration) file.
191
+ You may change the protocol or port the agent listens for trace data using the following:
164
192
 
165
- #### Manual instrumentation
193
+ **For HTTP over TCP**:
194
+
195
+ - Set `DD_APM_RECEIVER_PORT=<port>` in the agent's environment
196
+
197
+ OR
198
+
199
+ - Add `apm_config: receiver_port: <port>` to the [agent's configuration file](https://docs.datadoghq.com/agent/guide/agent-configuration-files/?tab=agentv6v7#agent-main-configuration-file)
200
+
201
+ **For Unix Domain Socket (UDS)**:
202
+
203
+ - Set `DD_APM_RECEIVER_SOCKET=<path-to-socket-file>`
204
+
205
+ OR
206
+
207
+ - Add `apm_config: receiver_socket: <path-to-socket-file>` to the [agent's configuration file](https://docs.datadoghq.com/agent/guide/agent-configuration-files/?tab=agentv6v7#agent-main-configuration-file)
208
+
209
+ ### Instrument your application
210
+
211
+ #### Rails applications
166
212
 
167
213
  1. Add the `ddtrace` gem to your Gemfile:
168
214
 
169
215
  ```ruby
170
216
  source 'https://rubygems.org'
171
- gem 'ddtrace'
217
+ gem 'ddtrace', require: 'ddtrace/auto_instrument'
172
218
  ```
173
219
 
174
220
  2. Install the gem with `bundle install`
221
+
175
222
  3. Create a `config/initializers/datadog.rb` file containing:
176
223
 
177
224
  ```ruby
178
225
  Datadog.configure do |c|
179
- # This will activate auto-instrumentation for Rails
180
- c.use :rails
226
+ # Add additional configuration here.
227
+ # Activate integrations, change tracer settings, etc...
181
228
  end
182
229
  ```
183
230
 
184
- You can also activate additional integrations here (see [Integration instrumentation](#integration-instrumentation))
231
+ Using this block you can:
232
+
233
+ - [Add additional configuration settings](#additional-configuration)
234
+ - [Activate or reconfigure instrumentation](#integration-instrumentation)
185
235
 
186
- ### Quickstart for Ruby applications
236
+ #### Ruby applications
187
237
 
188
- #### Automatic instrumentation
238
+ 1. Add the `ddtrace` gem to your Gemfile:
239
+
240
+ ```ruby
241
+ source 'https://rubygems.org'
242
+ gem 'ddtrace'
243
+ ```
189
244
 
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.
245
+ 2. Install the gem with `bundle install`
246
+ 3. `require` any [supported libraries or frameworks](#integration-instrumentation) that should be instrumented.
247
+ 4. Add `require 'ddtrace/auto_instrument'` to your application. _Note:_ This must be done _after_ requiring any supported libraries or frameworks.
193
248
 
194
249
  ```ruby
195
250
  # Example frameworks and libraries
@@ -200,41 +255,42 @@ Install and configure the Datadog Agent to receive traces from your now instrume
200
255
  require 'ddtrace/auto_instrument'
201
256
  ```
202
257
 
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
-
207
- 1. Install the gem with `gem install ddtrace`
208
- 2. Add a configuration block to your Ruby application:
258
+ 5. Add a configuration block to your application:
209
259
 
210
260
  ```ruby
211
- require 'ddtrace'
212
261
  Datadog.configure do |c|
213
- # Configure the tracer here.
262
+ # Add additional configuration here.
214
263
  # Activate integrations, change tracer settings, etc...
215
- # By default without additional configuration, nothing will be traced.
216
264
  end
217
265
  ```
218
266
 
219
- 3. Add or activate instrumentation by doing either of the following:
220
- - Activate integration instrumentation (see [Integration instrumentation](#integration-instrumentation))
221
- - Add manual instrumentation around your code (see [Manual instrumentation](#manual-instrumentation))
267
+ Using this block you can:
222
268
 
223
- ### Quickstart for OpenTracing
269
+ - [Add additional configuration settings](#additional-configuration)
270
+ - [Activate or reconfigure instrumentation](#integration-instrumentation)
224
271
 
225
- 1. Install the gem with `gem install ddtrace`
226
- 2. To your OpenTracing configuration file, add the following:
272
+ #### Configuring OpenTracing
273
+
274
+ 1. Add the `ddtrace` gem to your Gemfile:
275
+
276
+ ```ruby
277
+ source 'https://rubygems.org'
278
+ gem 'ddtrace'
279
+ ```
280
+
281
+ 2. Install the gem with `bundle install`
282
+ 3. To your OpenTracing configuration file, add the following:
227
283
 
228
284
  ```ruby
229
285
  require 'opentracing'
230
- require 'ddtrace'
231
- require 'ddtrace/opentracer'
286
+ require 'datadog/tracing'
287
+ require 'datadog/opentracer'
232
288
 
233
289
  # Activate the Datadog tracer for OpenTracing
234
290
  OpenTracing.global_tracer = Datadog::OpenTracer::Tracer.new
235
291
  ```
236
292
 
237
- 3. (Optional) Add a configuration block to your Ruby application to configure Datadog with:
293
+ 4. Add a configuration block to your application:
238
294
 
239
295
  ```ruby
240
296
  Datadog.configure do |c|
@@ -246,9 +302,29 @@ Install and configure the Datadog Agent to receive traces from your now instrume
246
302
  end
247
303
  ```
248
304
 
249
- 4. (Optional) Add or activate additional instrumentation by doing either of the following:
250
- - Activate Datadog integration instrumentation (see [Integration instrumentation](#integration-instrumentation))
251
- - Add Datadog manual instrumentation around your code (see [Manual instrumentation](#manual-instrumentation))
305
+ Using this block you can:
306
+
307
+ - [Add additional Datadog configuration settings](#additional-configuration)
308
+ - [Activate or reconfigure Datadog instrumentation](#integration-instrumentation)
309
+
310
+ #### Configuring OpenTelemetry
311
+
312
+ You can send OpenTelemetry traces directly to the Datadog agent (without `ddtrace`) by using OTLP. Check out our documentation on [OTLP ingest in the Datadog Agent](https://docs.datadoghq.com/tracing/setup_overview/open_standards/#otlp-ingest-in-datadog-agent) for details.
313
+
314
+ ### Connect your application to the Datadog Agent
315
+
316
+ By default, `ddtrace` will connect to the agent using the first available settings in the listed priority:
317
+
318
+ 1. Via any explicitly provided configuration settings (hostname/port/transport)
319
+ 2. Via Unix Domain Socket (UDS) located at `/var/run/datadog/apm.socket`
320
+ 3. Via HTTP over TCP to `127.0.0.1:8126`
321
+
322
+ If your Datadog Agent is listening at any of these locations, no further configuration should be required.
323
+
324
+ If your agent runs on a different host or container than your application, or you would like to send traces via a different protocol, you will need to configure your application accordingly.
325
+
326
+ - [How to send trace data via HTTP over TCP to agent](#changing-default-agent-hostname-and-port)
327
+ - [How to send trace data via Unix Domain Socket (UDS) to agent](#using-the-unix-domain-socket-uds-adapter)
252
328
 
253
329
  ### Final steps for installation
254
330
 
@@ -258,10 +334,10 @@ After setting up, your services will appear on the [APM services page](https://a
258
334
 
259
335
  If you aren't using a supported framework instrumentation, you may want to manually instrument your code.
260
336
 
261
- To trace any Ruby code, you can use the `Datadog.tracer.trace` method:
337
+ To trace any Ruby code, you can use the `Datadog::Tracing.trace` method:
262
338
 
263
339
  ```ruby
264
- Datadog.tracer.trace(name, options) do |span|
340
+ Datadog::Tracing.trace(name, options) do |span, trace|
265
341
  # Wrap this block around the code you want to instrument
266
342
  # Additionally, you can modify the span here.
267
343
  # e.g. Change the resource name, set tags, etc...
@@ -273,14 +349,15 @@ Where `name` should be a `String` that describes the generic kind of operation b
273
349
  And `options` is an optional `Hash` that accepts the following parameters:
274
350
 
275
351
  | Key | Type | Description | Default |
276
- | --- | --- | --- | --- |
277
- | `service` | `String` | The service name which this span belongs (e.g. `'my-web-service'`) | Tracer `default-service`, `$PROGRAM_NAME` or `'ruby'` |
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. |
279
- | `span_type` | `String` | The type of the span (such as `'http'`, `'db'`, etc.) | `nil` |
280
- | `child_of` | `Datadog::Span` / `Datadog::Context` | Parent for this span. If not provided, will automatically become current active span. | `nil` |
281
- | `start_time` | `Time` | When the span actually starts. Useful when tracing events that have already happened. | `Time.now` |
282
- | `tags` | `Hash` | Extra tags which should be added to the span. | `{}` |
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? }` |
352
+ | --------------- | ----------------------- | --- | --- |
353
+ | `autostart` | `Bool` | Whether the time measurement should be started automatically. If `false`, user must call `span.start`. | `true` |
354
+ | `continue_from` | `Datadog::TraceDigest` | Continues a trace that originated from another execution context. TraceDigest describes the continuation point. | `nil` |
355
+ | `on_error` | `Proc` | Overrides error handling behavior, when a span 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? }` |
356
+ | `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. |
357
+ | `service` | `String` | The service name which this span belongs (e.g. `'my-web-service'`) | Tracer `default-service`, `$PROGRAM_NAME` or `'ruby'` |
358
+ | `start_time` | `Time` | When the span actually starts. Useful when tracing events that have already happened. | `Time.now` |
359
+ | `tags` | `Hash` | Extra tags which should be added to the span. | `{}` |
360
+ | `type` | `String` | The type of the span (such as `'http'`, `'db'`, etc.) | `nil` |
284
361
 
285
362
  It's highly recommended you set both `service` and `resource` at a minimum. Spans without a `service` or `resource` as `nil` will be discarded by the Datadog agent.
286
363
 
@@ -288,9 +365,9 @@ Example of manual instrumentation in action:
288
365
 
289
366
  ```ruby
290
367
  get '/posts' do
291
- Datadog.tracer.trace('web.request', service: 'my-blog', resource: 'GET /posts') do |span|
368
+ Datadog::Tracing.trace('web.request', service: 'my-blog', resource: 'GET /posts') do |span|
292
369
  # Trace the activerecord call
293
- Datadog.tracer.trace('posts.fetch') do
370
+ Datadog::Tracing.trace('posts.fetch') do
294
371
  @posts = Posts.order(created_at: :desc).limit(10)
295
372
  end
296
373
 
@@ -299,7 +376,7 @@ get '/posts' do
299
376
  span.set_tag('posts.count', @posts.length)
300
377
 
301
378
  # Trace the template rendering
302
- Datadog.tracer.trace('template.render') do
379
+ Datadog::Tracing.trace('template.render') do
303
380
  erb :index
304
381
  end
305
382
  end
@@ -308,37 +385,36 @@ end
308
385
 
309
386
  ### Asynchronous tracing
310
387
 
311
- It might not always be possible to wrap `Datadog.tracer.trace` around a block of code. Some event or notification based instrumentation might only notify you when an event begins or ends.
388
+ It might not always be possible to wrap `Datadog::Tracing.trace` around a block of code. Some event or notification based instrumentation might only notify you when an event begins or ends.
312
389
 
313
- To trace these operations, you can trace code asynchronously by calling `Datadog.tracer.trace` without a block:
390
+ To trace these operations, you can trace code asynchronously by calling `Datadog::Tracing.trace` without a block:
314
391
 
315
392
  ```ruby
316
393
  # Some instrumentation framework calls this after an event finishes...
317
394
  def db_query(start, finish, query)
318
- span = Datadog.tracer.trace('database.query')
395
+ span = Datadog::Tracing.trace('database.query', start_time: start)
319
396
  span.resource = query
320
- span.start_time = start
321
397
  span.finish(finish)
322
398
  end
323
399
  ```
324
400
 
325
- Calling `Datadog.tracer.trace` without a block will cause the function to return a `Datadog::Span` that is started, but not finished. You can then modify this span however you wish, then close it `finish`.
401
+ Calling `Datadog::Tracing.trace` without a block will cause the function to return a `Datadog::SpanOperation` that is started, but not finished. You can then modify this span however you wish, then close it `finish`.
326
402
 
327
403
  *You must not leave any unfinished spans.* If any spans are left open when the trace completes, the trace will be discarded. You can [activate debug mode](#tracer-settings) to check for warnings if you suspect this might be happening.
328
404
 
329
- To avoid this scenario when handling start/finish events, you can use `Datadog.tracer.active_span` to get the current active span.
405
+ To avoid this scenario when handling start/finish events, you can use `Datadog::Tracing.active_span` to get the current active span.
330
406
 
331
407
  ```ruby
332
408
  # e.g. ActiveSupport::Notifications calls this when an event starts
333
409
  def start(name, id, payload)
334
410
  # Start a span
335
- Datadog.tracer.trace(name)
411
+ Datadog::Tracing.trace(name)
336
412
  end
337
413
 
338
414
  # e.g. ActiveSupport::Notifications calls this when an event finishes
339
415
  def finish(name, id, payload)
340
416
  # Retrieve current active span (thread-safe)
341
- current_span = Datadog.tracer.active_span
417
+ current_span = Datadog::Tracing.active_span
342
418
  unless current_span.nil?
343
419
  current_span.resource = payload[:query]
344
420
  current_span.finish
@@ -352,17 +428,16 @@ You can tag additional information to the current active span from any method. N
352
428
  ```ruby
353
429
  # e.g. adding tag to active span
354
430
 
355
- current_span = Datadog.tracer.active_span
431
+ current_span = Datadog::Tracing.active_span
356
432
  current_span.set_tag('my_tag', 'my_value') unless current_span.nil?
357
433
  ```
358
434
 
359
- You can also get the root span of the current active trace using the `active_root_span` method. This method will return `nil` if there is no active trace.
435
+ You can also get the current active trace using the `active_trace` method. This method will return `nil` if there is no active trace.
360
436
 
361
437
  ```ruby
362
- # e.g. adding tag to active root span
438
+ # e.g. accessing active trace
363
439
 
364
- current_root_span = Datadog.tracer.active_root_span
365
- current_root_span.set_tag('my_tag', 'my_value') unless current_root_span.nil?
440
+ current_trace = Datadog::Tracing.active_trace
366
441
  ```
367
442
 
368
443
  ## Integration instrumentation
@@ -372,7 +447,7 @@ Many popular libraries and frameworks are supported out-of-the-box, which can be
372
447
  ```ruby
373
448
  Datadog.configure do |c|
374
449
  # Activates and configures an integration
375
- c.use :integration_name, options
450
+ c.tracing.instrument :integration_name, options
376
451
  end
377
452
  ```
378
453
 
@@ -380,51 +455,71 @@ end
380
455
 
381
456
  For a list of available integrations, and their configuration options, please refer to the following:
382
457
 
383
- | Name | Key | Versions Supported: MRI | Versions Supported: JRuby | How to configure | Gem source |
384
- | ------------------------ | -------------------------- | ------------------------ | --------------------------| ----------------------------------- | ------------------------------------------------------------------------------ |
385
- | Action Cable | `action_cable` | `>= 5.0` | `>= 5.0` | *[Link](#action-cable)* | *[Link](https://github.com/rails/rails/tree/master/actioncable)* |
386
- | Action View | `action_view` | `>= 3.0` | `>= 3.0` | *[Link](#action-view)* | *[Link](https://github.com/rails/rails/tree/master/actionview)* |
387
- | Active Model Serializers | `active_model_serializers` | `>= 0.9` | `>= 0.9` | *[Link](#active-model-serializers)* | *[Link](https://github.com/rails-api/active_model_serializers)* |
388
- | Action Pack | `action_pack` | `>= 3.0` | `>= 3.0` | *[Link](#action-pack)* | *[Link](https://github.com/rails/rails/tree/master/actionpack)* |
389
- | Active Record | `active_record` | `>= 3.0` | `>= 3.0` | *[Link](#active-record)* | *[Link](https://github.com/rails/rails/tree/master/activerecord)* |
390
- | Active Support | `active_support` | `>= 3.0` | `>= 3.0` | *[Link](#active-support)* | *[Link](https://github.com/rails/rails/tree/master/activesupport)* |
391
- | AWS | `aws` | `>= 2.0` | `>= 2.0` | *[Link](#aws)* | *[Link](https://github.com/aws/aws-sdk-ruby)* |
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)* |
394
- | Dalli | `dalli` | `>= 2.0` | `>= 2.0` | *[Link](#dalli)* | *[Link](https://github.com/petergoldstein/dalli)* |
395
- | DelayedJob | `delayed_job` | `>= 4.1` | `>= 4.1` | *[Link](#delayedjob)* | *[Link](https://github.com/collectiveidea/delayed_job)* |
396
- | Elasticsearch | `elasticsearch` | `>= 1.0` | `>= 1.0` | *[Link](#elasticsearch)* | *[Link](https://github.com/elastic/elasticsearch-ruby)* |
397
- | Ethon | `ethon` | `>= 0.11` | `>= 0.11` | *[Link](#ethon)* | *[Link](https://github.com/typhoeus/ethon)* |
398
- | Excon | `excon` | `>= 0.50` | `>= 0.50` | *[Link](#excon)* | *[Link](https://github.com/excon/excon)* |
399
- | Faraday | `faraday` | `>= 0.14` | `>= 0.14` | *[Link](#faraday)* | *[Link](https://github.com/lostisland/faraday)* |
400
- | Grape | `grape` | `>= 1.0` | `>= 1.0` | *[Link](#grape)* | *[Link](https://github.com/ruby-grape/grape)* |
401
- | GraphQL | `graphql` | `>= 1.7.9` | `>= 1.7.9` | *[Link](#graphql)* | *[Link](https://github.com/rmosolgo/graphql-ruby)* |
402
- | gRPC | `grpc` | `>= 1.7` | *gem not available* | *[Link](#grpc)* | *[Link](https://github.com/grpc/grpc/tree/master/src/rubyc)* |
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)* |
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)* |
408
- | MongoDB | `mongo` | `>= 2.1` | `>= 2.1` | *[Link](#mongodb)* | *[Link](https://github.com/mongodb/mongo-ruby-driver)* |
409
- | MySQL2 | `mysql2` | `>= 0.3.21` | *gem not available* | *[Link](#mysql2)* | *[Link](https://github.com/brianmario/mysql2)* |
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)* |
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)* |
413
- | Que | `que` | `>= 1.0.0.beta2` | `>= 1.0.0.beta2` | *[Link](#que)* | *[Link](https://github.com/que-rb/que)* |
414
- | Racecar | `racecar` | `>= 0.3.5` | `>= 0.3.5` | *[Link](#racecar)* | *[Link](https://github.com/zendesk/racecar)* |
415
- | Rack | `rack` | `>= 1.1` | `>= 1.1` | *[Link](#rack)* | *[Link](https://github.com/rack/rack)* |
416
- | Rails | `rails` | `>= 3.0` | `>= 3.0` | *[Link](#rails)* | *[Link](https://github.com/rails/rails)* |
417
- | Rake | `rake` | `>= 12.0` | `>= 12.0` | *[Link](#rake)* | *[Link](https://github.com/ruby/rake)* |
418
- | Redis | `redis` | `>= 3.2` | `>= 3.2` | *[Link](#redis)* | *[Link](https://github.com/redis/redis-rb)* |
419
- | Resque | `resque` | `>= 1.0` | `>= 1.0` | *[Link](#resque)* | *[Link](https://github.com/resque/resque)* |
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)* |
422
- | Sequel | `sequel` | `>= 3.41` | `>= 3.41` | *[Link](#sequel)* | *[Link](https://github.com/jeremyevans/sequel)* |
423
- | Shoryuken | `shoryuken` | `>= 3.2` | `>= 3.2` | *[Link](#shoryuken)* | *[Link](https://github.com/phstc/shoryuken)* |
424
- | Sidekiq | `sidekiq` | `>= 3.5.4` | `>= 3.5.4` | *[Link](#sidekiq)* | *[Link](https://github.com/mperham/sidekiq)* |
425
- | Sinatra | `sinatra` | `>= 1.4` | `>= 1.4` | *[Link](#sinatra)* | *[Link](https://github.com/sinatra/sinatra)* |
426
- | Sneakers | `sneakers` | `>= 2.12.0` | `>= 2.12.0` | *[Link](#sneakers)* | *[Link](https://github.com/jondot/sneakers)* |
427
- | Sucker Punch | `sucker_punch` | `>= 2.0` | `>= 2.0` | *[Link](#sucker-punch)* | *[Link](https://github.com/brandonhilkert/sucker_punch)* |
458
+ | Name | Key | Versions Supported: MRI | Versions Supported: JRuby | How to configure | Gem source |
459
+ | -------------------------- | -------------------------- | ------------------------ | --------------------------| ----------------------------------- | ------------------------------------------------------------------------------ |
460
+ | Action Cable | `action_cable` | `>= 5.0` | `>= 5.0` | *[Link](#action-cable)* | *[Link](https://github.com/rails/rails/tree/master/actioncable)* |
461
+ | Action Mailer | `action_mailer` | `>= 5.0` | `>= 5.0` | *[Link](#action-mailer)* | *[Link](https://github.com/rails/rails/tree/master/actionmailer)* |
462
+ | Action Pack | `action_pack` | `>= 3.2` | `>= 3.2` | *[Link](#action-pack)* | *[Link](https://github.com/rails/rails/tree/master/actionpack)* |
463
+ | Action View | `action_view` | `>= 3.2` | `>= 3.2` | *[Link](#action-view)* | *[Link](https://github.com/rails/rails/tree/master/actionview)* |
464
+ | Active Job | `active_job` | `>= 4.2` | `>= 4.2` | *[Link](#active-job)* | *[Link](https://github.com/rails/rails/tree/master/activejob)* |
465
+ | Active Model Serializers | `active_model_serializers` | `>= 0.9` | `>= 0.9` | *[Link](#active-model-serializers)* | *[Link](https://github.com/rails-api/active_model_serializers)* |
466
+ | Active Record | `active_record` | `>= 3.2` | `>= 3.2` | *[Link](#active-record)* | *[Link](https://github.com/rails/rails/tree/master/activerecord)* |
467
+ | Active Support | `active_support` | `>= 3.2` | `>= 3.2` | *[Link](#active-support)* | *[Link](https://github.com/rails/rails/tree/master/activesupport)* |
468
+ | AWS | `aws` | `>= 2.0` | `>= 2.0` | *[Link](#aws)* | *[Link](https://github.com/aws/aws-sdk-ruby)* |
469
+ | Concurrent Ruby | `concurrent_ruby` | `>= 0.9` | `>= 0.9` | *[Link](#concurrent-ruby)* | *[Link](https://github.com/ruby-concurrency/concurrent-ruby)* |
470
+ | Dalli | `dalli` | `>= 2.0` | `>= 2.0` | *[Link](#dalli)* | *[Link](https://github.com/petergoldstein/dalli)* |
471
+ | DelayedJob | `delayed_job` | `>= 4.1` | `>= 4.1` | *[Link](#delayedjob)* | *[Link](https://github.com/collectiveidea/delayed_job)* |
472
+ | Elasticsearch | `elasticsearch` | `>= 1.0` | `>= 1.0` | *[Link](#elasticsearch)* | *[Link](https://github.com/elastic/elasticsearch-ruby)* |
473
+ | Ethon | `ethon` | `>= 0.11` | `>= 0.11` | *[Link](#ethon)* | *[Link](https://github.com/typhoeus/ethon)* |
474
+ | Excon | `excon` | `>= 0.50` | `>= 0.50` | *[Link](#excon)* | *[Link](https://github.com/excon/excon)* |
475
+ | Faraday | `faraday` | `>= 0.14` | `>= 0.14` | *[Link](#faraday)* | *[Link](https://github.com/lostisland/faraday)* |
476
+ | Grape | `grape` | `>= 1.0` | `>= 1.0` | *[Link](#grape)* | *[Link](https://github.com/ruby-grape/grape)* |
477
+ | GraphQL | `graphql` | `>= 1.7.9` | `>= 1.7.9` | *[Link](#graphql)* | *[Link](https://github.com/rmosolgo/graphql-ruby)* |
478
+ | gRPC | `grpc` | `>= 1.7` | *gem not available* | *[Link](#grpc)* | *[Link](https://github.com/grpc/grpc/tree/master/src/rubyc)* |
479
+ | http.rb | `httprb` | `>= 2.0` | `>= 2.0` | *[Link](#httprb)* | *[Link](https://github.com/httprb/http)* |
480
+ | httpclient | `httpclient` | `>= 2.2` | `>= 2.2` | *[Link](#httpclient)* | *[Link](https://github.com/nahi/httpclient)* |
481
+ | httpx | `httpx` | `>= 0.11` | `>= 0.11` | *[Link](#httpx)* | *[Link](https://gitlab.com/honeyryderchuck/httpx)* |
482
+ | Kafka | `ruby-kafka` | `>= 0.7.10` | `>= 0.7.10` | *[Link](#kafka)* | *[Link](https://github.com/zendesk/ruby-kafka)* |
483
+ | Makara (via Active Record) | `makara` | `>= 0.3.5` | `>= 0.3.5` | *[Link](#active-record)* | *[Link](https://github.com/instacart/makara)* |
484
+ | MongoDB | `mongo` | `>= 2.1` | `>= 2.1` | *[Link](#mongodb)* | *[Link](https://github.com/mongodb/mongo-ruby-driver)* |
485
+ | MySQL2 | `mysql2` | `>= 0.3.21` | *gem not available* | *[Link](#mysql2)* | *[Link](https://github.com/brianmario/mysql2)* |
486
+ | 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)* |
487
+ | Presto | `presto` | `>= 0.5.14` | `>= 0.5.14` | *[Link](#presto)* | *[Link](https://github.com/treasure-data/presto-client-ruby)* |
488
+ | Qless | `qless` | `>= 0.10.0` | `>= 0.10.0` | *[Link](#qless)* | *[Link](https://github.com/seomoz/qless)* |
489
+ | Que | `que` | `>= 1.0.0.beta2` | `>= 1.0.0.beta2` | *[Link](#que)* | *[Link](https://github.com/que-rb/que)* |
490
+ | Racecar | `racecar` | `>= 0.3.5` | `>= 0.3.5` | *[Link](#racecar)* | *[Link](https://github.com/zendesk/racecar)* |
491
+ | Rack | `rack` | `>= 1.1` | `>= 1.1` | *[Link](#rack)* | *[Link](https://github.com/rack/rack)* |
492
+ | Rails | `rails` | `>= 3.2` | `>= 3.2` | *[Link](#rails)* | *[Link](https://github.com/rails/rails)* |
493
+ | Rake | `rake` | `>= 12.0` | `>= 12.0` | *[Link](#rake)* | *[Link](https://github.com/ruby/rake)* |
494
+ | Redis | `redis` | `>= 3.2` | `>= 3.2` | *[Link](#redis)* | *[Link](https://github.com/redis/redis-rb)* |
495
+ | Resque | `resque` | `>= 1.0` | `>= 1.0` | *[Link](#resque)* | *[Link](https://github.com/resque/resque)* |
496
+ | Rest Client | `rest-client` | `>= 1.8` | `>= 1.8` | *[Link](#rest-client)* | *[Link](https://github.com/rest-client/rest-client)* |
497
+ | Sequel | `sequel` | `>= 3.41` | `>= 3.41` | *[Link](#sequel)* | *[Link](https://github.com/jeremyevans/sequel)* |
498
+ | Shoryuken | `shoryuken` | `>= 3.2` | `>= 3.2` | *[Link](#shoryuken)* | *[Link](https://github.com/phstc/shoryuken)* |
499
+ | Sidekiq | `sidekiq` | `>= 3.5.4` | `>= 3.5.4` | *[Link](#sidekiq)* | *[Link](https://github.com/mperham/sidekiq)* |
500
+ | Sinatra | `sinatra` | `>= 1.4` | `>= 1.4` | *[Link](#sinatra)* | *[Link](https://github.com/sinatra/sinatra)* |
501
+ | Sneakers | `sneakers` | `>= 2.12.0` | `>= 2.12.0` | *[Link](#sneakers)* | *[Link](https://github.com/jondot/sneakers)* |
502
+ | Sucker Punch | `sucker_punch` | `>= 2.0` | `>= 2.0` | *[Link](#sucker-punch)* | *[Link](https://github.com/brandonhilkert/sucker_punch)* |
503
+
504
+ #### CI Visibility
505
+
506
+ For Datadog CI Visibility, library instrumentation can be activated and configured by using the following `Datadog.configure` API:
507
+
508
+ ```ruby
509
+ Datadog.configure do |c|
510
+ # Activates and configures an integration
511
+ c.ci.instrument :integration_name, options
512
+ end
513
+ ```
514
+
515
+ `options` is a `Hash` of integration-specific configuration settings.
516
+
517
+ These are the available CI Visibility integrations:
518
+
519
+ | Name | Key | Versions Supported: MRI | Versions Supported: JRuby | How to configure | Gem source |
520
+ |-----------|------------|-------------------------|---------------------------|---------------------|-----------------------------------------------------|
521
+ | Cucumber | `cucumber` | `>= 3.0` | `>= 1.7.16` | *[Link](#cucumber)* | *[Link](https://github.com/cucumber/cucumber-ruby)* |
522
+ | RSpec | `rspec` | `>= 3.0.0` | `>= 3.0.0` | *[Link](#rspec)* | *[Link](https://github.com/rspec/rspec)* |
428
523
 
429
524
  ### Action Cable
430
525
 
@@ -436,7 +531,20 @@ You can enable it through `Datadog.configure`:
436
531
  require 'ddtrace'
437
532
 
438
533
  Datadog.configure do |c|
439
- c.use :action_cable, options
534
+ c.tracing.instrument :action_cable
535
+ end
536
+ ```
537
+
538
+ ### Action Mailer
539
+
540
+ The Action Mailer integration provides tracing for Rails 5 ActionMailer actions.
541
+
542
+ You can enable it through `Datadog.configure`:
543
+
544
+ ```ruby
545
+ require 'ddtrace'
546
+ Datadog.configure do |c|
547
+ c.tracing.instrument :action_mailer, options
440
548
  end
441
549
  ```
442
550
 
@@ -444,18 +552,32 @@ Where `options` is an optional `Hash` that accepts the following parameters:
444
552
 
445
553
  | Key | Description | Default |
446
554
  | --- | ----------- | ------- |
447
- | `service_name` | Service name used for `action_cable` instrumentation | `'action_cable'` |
555
+ | `analytics_enabled` | Enable analytics for spans produced by this integration. `true` for on, `nil` to defer to global setting, `false` for off. | `false` |
556
+ | `email_data` | Whether or not to append additional email payload metadata to `action_mailer.deliver` spans. Fields include `['subject', 'to', 'from', 'bcc', 'cc', 'date', 'perform_deliveries']`. | `false` |
557
+
558
+ ### Action Pack
559
+
560
+ Most of the time, Action Pack is set up as part of Rails, but it can be activated separately:
561
+
562
+ ```ruby
563
+ require 'actionpack'
564
+ require 'ddtrace'
565
+
566
+ Datadog.configure do |c|
567
+ c.tracing.instrument :action_pack
568
+ end
569
+ ```
448
570
 
449
571
  ### Action View
450
572
 
451
- Most of the time, Active Support is set up as part of Rails, but it can be activated separately:
573
+ Most of the time, Action View is set up as part of Rails, but it can be activated separately:
452
574
 
453
575
  ```ruby
454
576
  require 'actionview'
455
577
  require 'ddtrace'
456
578
 
457
579
  Datadog.configure do |c|
458
- c.use :action_view, options
580
+ c.tracing.instrument :action_view, options
459
581
  end
460
582
  ```
461
583
 
@@ -463,47 +585,38 @@ Where `options` is an optional `Hash` that accepts the following parameters:
463
585
 
464
586
  | Key | Description | Default |
465
587
  | ---| --- | --- |
466
- | `service_name` | Service name used for rendering instrumentation. | `action_view` |
467
588
  | `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/'` |
468
589
 
469
- ### Active Model Serializers
590
+ ### Active Job
470
591
 
471
- The Active Model Serializers integration traces the `serialize` event for version 0.9+ and the `render` event for version 0.10+.
592
+ Most of the time, Active Job is set up as part of Rails, but it can be activated separately:
472
593
 
473
594
  ```ruby
474
- require 'active_model_serializers'
595
+ require 'active_job'
475
596
  require 'ddtrace'
476
597
 
477
598
  Datadog.configure do |c|
478
- c.use :active_model_serializers, options
599
+ c.tracing.instrument :active_job
479
600
  end
480
601
 
481
- my_object = MyModel.new(name: 'my object')
482
- ActiveModelSerializers::SerializableResource.new(test_obj).serializable_hash
602
+ ExampleJob.perform_later
483
603
  ```
484
604
 
485
- | Key | Description | Default |
486
- | --- | ----------- | ------- |
487
- | `service_name` | Service name used for `active_model_serializers` instrumentation. | `'active_model_serializers'` |
488
-
489
- ### Action Pack
605
+ ### Active Model Serializers
490
606
 
491
- Most of the time, Action Pack is set up as part of Rails, but it can be activated separately:
607
+ The Active Model Serializers integration traces the `serialize` event for version 0.9+ and the `render` event for version 0.10+.
492
608
 
493
609
  ```ruby
494
- require 'actionpack'
610
+ require 'active_model_serializers'
495
611
  require 'ddtrace'
496
612
 
497
613
  Datadog.configure do |c|
498
- c.use :action_pack, options
614
+ c.tracing.instrument :active_model_serializers
499
615
  end
500
- ```
501
-
502
- Where `options` is an optional `Hash` that accepts the following parameters:
503
616
 
504
- | Key | Description | Default |
505
- | ---| --- | --- |
506
- | `service_name` | Service name used for rendering instrumentation. | `action_pack` |
617
+ my_object = MyModel.new(name: 'my object')
618
+ ActiveModelSerializers::SerializableResource.new(test_obj).serializable_hash
619
+ ```
507
620
 
508
621
  ### Active Record
509
622
 
@@ -516,7 +629,7 @@ require 'active_record'
516
629
  require 'ddtrace'
517
630
 
518
631
  Datadog.configure do |c|
519
- c.use :active_record, options
632
+ c.tracing.instrument :active_record, options
520
633
  end
521
634
 
522
635
  Dir::Tmpname.create(['test', '.sqlite']) do |db|
@@ -530,7 +643,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
530
643
 
531
644
  | Key | Description | Default |
532
645
  | ---| --- | --- |
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'`) |
534
646
  | `service_name` | Service name used for database portion of `active_record` instrumentation. | Name of database adapter (e.g. `'mysql2'`) |
535
647
 
536
648
  **Configuring trace settings per database**
@@ -546,22 +658,22 @@ You can configure trace settings per database connection by using the `describes
546
658
  Datadog.configure do |c|
547
659
  # Symbol matching your database connection in config/database.yml
548
660
  # Only available if you are using Rails with ActiveRecord.
549
- c.use :active_record, describes: :secondary_database, service_name: 'secondary-db'
661
+ c.tracing.instrument :active_record, describes: :secondary_database, service_name: 'secondary-db'
550
662
 
551
663
  # Block configuration pattern.
552
- c.use :active_record, describes: :secondary_database do |second_db|
664
+ c.tracing.instrument :active_record, describes: :secondary_database do |second_db|
553
665
  second_db.service_name = 'secondary-db'
554
666
  end
555
667
 
556
668
  # Connection string with the following connection settings:
557
669
  # adapter, username, host, port, database
558
670
  # Other fields are ignored.
559
- c.use :active_record, describes: 'mysql2://root@127.0.0.1:3306/mysql', service_name: 'secondary-db'
671
+ c.tracing.instrument :active_record, describes: 'mysql2://root@127.0.0.1:3306/mysql', service_name: 'secondary-db'
560
672
 
561
673
  # Hash with following connection settings:
562
674
  # adapter, username, host, port, database
563
675
  # Other fields are ignored.
564
- c.use :active_record, describes: {
676
+ c.tracing.instrument :active_record, describes: {
565
677
  adapter: 'mysql2',
566
678
  host: '127.0.0.1',
567
679
  port: '3306',
@@ -571,8 +683,8 @@ Datadog.configure do |c|
571
683
  service_name: 'secondary-db'
572
684
 
573
685
  # 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'
686
+ c.tracing.instrument :active_record, describes: { makara_role: 'primary' }, service_name: 'primary-db'
687
+ c.tracing.instrument :active_record, describes: { makara_role: 'replica' }, service_name: 'secondary-db'
576
688
  end
577
689
  ```
578
690
 
@@ -581,23 +693,23 @@ You can also create configurations based on partial matching of database connect
581
693
  ```ruby
582
694
  Datadog.configure do |c|
583
695
  # Matches any connection on host `127.0.0.1`.
584
- c.use :active_record, describes: { host: '127.0.0.1' }, service_name: 'local-db'
696
+ c.tracing.instrument :active_record, describes: { host: '127.0.0.1' }, service_name: 'local-db'
585
697
 
586
698
  # Matches any `mysql2` connection.
587
- c.use :active_record, describes: { adapter: 'mysql2'}, service_name: 'mysql-db'
699
+ c.tracing.instrument :active_record, describes: { adapter: 'mysql2'}, service_name: 'mysql-db'
588
700
 
589
701
  # Matches any `mysql2` connection to the `reports` database.
590
702
  #
591
703
  # In case of multiple matching `describe` configurations, the latest one applies.
592
704
  # In this case a connection with both adapter `mysql` and database `reports`
593
705
  # 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'
706
+ c.tracing.instrument :active_record, describes: { adapter: 'mysql2', database: 'reports'}, service_name: 'reports-db'
595
707
  end
596
708
  ```
597
709
 
598
710
  When multiple `describes` configurations match a connection, the latest configured rule that matches will be applied.
599
711
 
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.
712
+ 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.tracing.instrument :active_record` instead.
601
713
 
602
714
  ### Active Support
603
715
 
@@ -608,7 +720,7 @@ require 'activesupport'
608
720
  require 'ddtrace'
609
721
 
610
722
  Datadog.configure do |c|
611
- c.use :active_support, options
723
+ c.tracing.instrument :active_support, options
612
724
  end
613
725
 
614
726
  cache = ActiveSupport::Cache::MemoryStore.new
@@ -630,7 +742,7 @@ require 'aws-sdk'
630
742
  require 'ddtrace'
631
743
 
632
744
  Datadog.configure do |c|
633
- c.use :aws, options
745
+ c.tracing.instrument :aws, options
634
746
  end
635
747
 
636
748
  # Perform traced call
@@ -654,21 +766,15 @@ To activate your integration, use the `Datadog.configure` method:
654
766
  # Inside Rails initializer or equivalent
655
767
  Datadog.configure do |c|
656
768
  # Patches ::Concurrent::Future to use ExecutorService that propagates context
657
- c.use :concurrent_ruby, options
769
+ c.tracing.instrument :concurrent_ruby
658
770
  end
659
771
 
660
772
  # Pass context into code executed within Concurrent::Future
661
- Datadog.tracer.trace('outer') do
662
- Concurrent::Future.execute { Datadog.tracer.trace('inner') { } }.wait
773
+ Datadog::Tracing.trace('outer') do
774
+ Concurrent::Future.execute { Datadog::Tracing.trace('inner') { } }.wait
663
775
  end
664
776
  ```
665
777
 
666
- Where `options` is an optional `Hash` that accepts the following parameters:
667
-
668
- | Key | Description | Default |
669
- | --- | ----------- | ------- |
670
- | `service_name` | Service name used for `concurrent-ruby` instrumentation | `'concurrent-ruby'` |
671
-
672
778
  ### Cucumber
673
779
 
674
780
  Cucumber integration will trace all executions of scenarios and steps when using `cucumber` framework.
@@ -681,7 +787,7 @@ require 'ddtrace'
681
787
 
682
788
  # Configure default Cucumber integration
683
789
  Datadog.configure do |c|
684
- c.use :cucumber, options
790
+ c.ci.instrument :cucumber, options
685
791
  end
686
792
 
687
793
  # Example of how to attach tags from scenario to active span
@@ -714,7 +820,7 @@ require 'ddtrace'
714
820
 
715
821
  # Configure default Dalli tracing behavior
716
822
  Datadog.configure do |c|
717
- c.use :dalli, options
823
+ c.tracing.instrument :dalli, options
718
824
  end
719
825
 
720
826
  # Configure Dalli tracing behavior for single client
@@ -738,7 +844,7 @@ You can enable it through `Datadog.configure`:
738
844
  require 'ddtrace'
739
845
 
740
846
  Datadog.configure do |c|
741
- c.use :delayed_job, options
847
+ c.tracing.instrument :delayed_job, options
742
848
  end
743
849
  ```
744
850
 
@@ -746,8 +852,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
746
852
 
747
853
  | Key | Description | Default |
748
854
  | --- | ----------- | ------- |
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
855
  | `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? }` |
752
856
 
753
857
  ### Elasticsearch
@@ -759,7 +863,7 @@ require 'elasticsearch/transport'
759
863
  require 'ddtrace'
760
864
 
761
865
  Datadog.configure do |c|
762
- c.use :elasticsearch, options
866
+ c.tracing.instrument :elasticsearch, options
763
867
  end
764
868
 
765
869
  # Perform a query to Elasticsearch
@@ -782,10 +886,10 @@ The `ethon` integration will trace any HTTP request through `Easy` or `Multi` ob
782
886
  require 'ddtrace'
783
887
 
784
888
  Datadog.configure do |c|
785
- c.use :ethon, options
889
+ c.tracing.instrument :ethon, options
786
890
 
787
891
  # optionally, specify a different service name for hostnames matching a regex
788
- c.use :ethon, describes: /user-[^.]+\.example\.com/ do |ethon|
892
+ c.tracing.instrument :ethon, describes: /user-[^.]+\.example\.com/ do |ethon|
789
893
  ethon.service_name = 'user.example.com'
790
894
  ethon.split_by_domain = false # Only necessary if split_by_domain is true by default
791
895
  end
@@ -810,10 +914,10 @@ require 'ddtrace'
810
914
 
811
915
  # Configure default Excon tracing behavior
812
916
  Datadog.configure do |c|
813
- c.use :excon, options
917
+ c.tracing.instrument :excon, options
814
918
 
815
919
  # optionally, specify a different service name for hostnames matching a regex
816
- c.use :excon, describes: /user-[^.]+\.example\.com/ do |excon|
920
+ c.tracing.instrument :excon, describes: /user-[^.]+\.example\.com/ do |excon|
817
921
  excon.service_name = 'user.example.com'
818
922
  excon.split_by_domain = false # Only necessary if split_by_domain is true by default
819
923
  end
@@ -840,7 +944,7 @@ If you use multiple connections with Excon, you can give each of them different
840
944
  # Wrap the Datadog tracing middleware around the default middleware stack
841
945
  Excon.new(
842
946
  'http://example.com',
843
- middlewares: Datadog::Contrib::Excon::Middleware.with(options).around_default_stack
947
+ middlewares: Datadog::Tracing::Contrib::Excon::Middleware.with(options).around_default_stack
844
948
  )
845
949
 
846
950
  # Insert the middleware into a custom middleware stack.
@@ -849,7 +953,7 @@ Excon.new(
849
953
  'http://example.com',
850
954
  middlewares: [
851
955
  Excon::Middleware::ResponseParser,
852
- Datadog::Contrib::Excon::Middleware.with(options),
956
+ Datadog::Tracing::Contrib::Excon::Middleware.with(options),
853
957
  Excon::Middleware::Idempotent
854
958
  ]
855
959
  )
@@ -867,10 +971,10 @@ require 'ddtrace'
867
971
 
868
972
  # Configure default Faraday tracing behavior
869
973
  Datadog.configure do |c|
870
- c.use :faraday, options
974
+ c.tracing.instrument :faraday, options
871
975
 
872
976
  # optionally, specify a different service name for hostnames matching a regex
873
- c.use :faraday, describes: /user-[^.]+\.example\.com/ do |faraday|
977
+ c.tracing.instrument :faraday, describes: /user-[^.]+\.example\.com/ do |faraday|
874
978
  faraday.service_name = 'user.example.com'
875
979
  faraday.split_by_domain = false # Only necessary if split_by_domain is true by default
876
980
  end
@@ -906,7 +1010,7 @@ require 'grape'
906
1010
  require 'ddtrace'
907
1011
 
908
1012
  Datadog.configure do |c|
909
- c.use :grape, options
1013
+ c.tracing.instrument :grape, options
910
1014
  end
911
1015
 
912
1016
  # Then define your application
@@ -923,7 +1027,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
923
1027
  | Key | Description | Default |
924
1028
  | --- | ----------- | ------- |
925
1029
  | `enabled` | Defines whether Grape should be traced. Useful for temporarily disabling tracing. `true` or `false` | `true` |
926
- | `service_name` | Service name used for `grape` instrumentation | `'grape'` |
927
1030
  | `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` |
928
1031
 
929
1032
  ### GraphQL
@@ -935,7 +1038,7 @@ To activate your integration, use the `Datadog.configure` method:
935
1038
  ```ruby
936
1039
  # Inside Rails initializer or equivalent
937
1040
  Datadog.configure do |c|
938
- c.use :graphql, schemas: [YourSchema], options
1041
+ c.tracing.instrument :graphql, schemas: [YourSchema], options
939
1042
  end
940
1043
 
941
1044
  # Then run a GraphQL query
@@ -946,7 +1049,6 @@ The `use :graphql` method accepts the following parameters. Additional options c
946
1049
 
947
1050
  | Key | Description | Default |
948
1051
  | --- | ----------- | ------- |
949
- | `service_name` | Service name used for `graphql` instrumentation | `'ruby-graphql'` |
950
1052
  | `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. | `[]` |
951
1053
 
952
1054
  **Manually configuring GraphQL schemas**
@@ -1006,7 +1108,7 @@ require 'grpc'
1006
1108
  require 'ddtrace'
1007
1109
 
1008
1110
  Datadog.configure do |c|
1009
- c.use :grpc, options
1111
+ c.tracing.instrument :grpc, options
1010
1112
  end
1011
1113
 
1012
1114
  # Server side
@@ -1025,13 +1127,14 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1025
1127
  | Key | Description | Default |
1026
1128
  | --- | ----------- | ------- |
1027
1129
  | `service_name` | Service name used for `grpc` instrumentation | `'grpc'` |
1130
+ | `error_handler` | Custom error handler invoked when a request is an error. A `Proc` that accepts `span` and `error` parameters. Sets error on the span by default. | `proc { |span, error| span.set_error(error) unless span.nil? }` |
1028
1131
 
1029
1132
  **Configuring clients to use different settings**
1030
1133
 
1031
1134
  In situations where you have multiple clients calling multiple distinct services, you may pass the Datadog interceptor directly, like so
1032
1135
 
1033
1136
  ```ruby
1034
- configured_interceptor = Datadog::Contrib::GRPC::DatadogInterceptor::Client.new do |c|
1137
+ configured_interceptor = Datadog::Tracing::Contrib::GRPC::DatadogInterceptor::Client.new do |c|
1035
1138
  c.service_name = "Alternate"
1036
1139
  end
1037
1140
 
@@ -1052,9 +1155,9 @@ The http.rb integration will trace any HTTP call using the Http.rb gem.
1052
1155
  require 'http'
1053
1156
  require 'ddtrace'
1054
1157
  Datadog.configure do |c|
1055
- c.use :httprb, options
1158
+ c.tracing.instrument :httprb, options
1056
1159
  # optionally, specify a different service name for hostnames matching a regex
1057
- c.use :httprb, describes: /user-[^.]+\.example\.com/ do |httprb|
1160
+ c.tracing.instrument :httprb, describes: /user-[^.]+\.example\.com/ do |httprb|
1058
1161
  httprb.service_name = 'user.example.com'
1059
1162
  httprb.split_by_domain = false # Only necessary if split_by_domain is true by default
1060
1163
  end
@@ -1077,9 +1180,9 @@ The httpclient integration will trace any HTTP call using the httpclient gem.
1077
1180
  require 'httpclient'
1078
1181
  require 'ddtrace'
1079
1182
  Datadog.configure do |c|
1080
- c.use :httpclient, options
1183
+ c.tracing.instrument :httpclient, options
1081
1184
  # optionally, specify a different service name for hostnames matching a regex
1082
- c.use :httpclient, describes: /user-[^.]+\.example\.com/ do |httpclient|
1185
+ c.tracing.instrument :httpclient, describes: /user-[^.]+\.example\.com/ do |httpclient|
1083
1186
  httpclient.service_name = 'user.example.com'
1084
1187
  httpclient.split_by_domain = false # Only necessary if split_by_domain is true by default
1085
1188
  end
@@ -1103,10 +1206,10 @@ require "ddtrace"
1103
1206
  require "httpx/adapters/datadog"
1104
1207
 
1105
1208
  Datadog.configure do |c|
1106
- c.use :httpx
1209
+ c.tracing.instrument :httpx
1107
1210
 
1108
1211
  # optionally, specify a different service name for hostnames matching a regex
1109
- c.use :httpx, describes: /user-[^.]+\.example\.com/ do |http|
1212
+ c.tracing.instrument :httpx, describes: /user-[^.]+\.example\.com/ do |http|
1110
1213
  http.service_name = 'user.example.com'
1111
1214
  http.split_by_domain = false # Only necessary if split_by_domain is true by default
1112
1215
  end
@@ -1125,17 +1228,10 @@ require 'kafka'
1125
1228
  require 'ddtrace'
1126
1229
 
1127
1230
  Datadog.configure do |c|
1128
- c.use :kafka, options
1231
+ c.tracing.instrument :kafka
1129
1232
  end
1130
1233
  ```
1131
1234
 
1132
- Where `options` is an optional `Hash` that accepts the following parameters:
1133
-
1134
- | Key | Description | Default |
1135
- | --- | ----------- | ------- |
1136
- | `service_name` | Service name used for `kafka` instrumentation | `'kafka'` |
1137
- | `tracer` | `Datadog::Tracer` used to perform instrumentation. Usually you don't need to set this. | `Datadog.tracer` |
1138
-
1139
1235
  ### MongoDB
1140
1236
 
1141
1237
  The integration traces any `Command` that is sent from the [MongoDB Ruby Driver](https://github.com/mongodb/mongo-ruby-driver) to a MongoDB cluster. By extension, Object Document Mappers (ODM) such as Mongoid are automatically instrumented if they use the official Ruby driver. To activate the integration, simply:
@@ -1145,7 +1241,7 @@ require 'mongo'
1145
1241
  require 'ddtrace'
1146
1242
 
1147
1243
  Datadog.configure do |c|
1148
- c.use :mongo, options
1244
+ c.tracing.instrument :mongo, options
1149
1245
  end
1150
1246
 
1151
1247
  # Create a MongoDB client and use it as usual
@@ -1154,7 +1250,7 @@ collection = client[:people]
1154
1250
  collection.insert_one({ name: 'Steve' })
1155
1251
 
1156
1252
  # In case you want to override the global configuration for a certain client instance
1157
- Datadog.configure(client, options)
1253
+ Datadog.configure_onto(client, **options)
1158
1254
  ```
1159
1255
 
1160
1256
  Where `options` is an optional `Hash` that accepts the following parameters:
@@ -1164,6 +1260,37 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1164
1260
  | `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] }` |
1165
1261
  | `service_name` | Service name used for `mongo` instrumentation | `'mongodb'` |
1166
1262
 
1263
+ **Configuring trace settings per connection**
1264
+
1265
+ You can configure trace settings per connection by using the `describes` option:
1266
+
1267
+ ```ruby
1268
+ # Provide a `:describes` option with a connection key.
1269
+ # Any of the following keys are acceptable and equivalent to one another.
1270
+ # If a block is provided, it yields a Settings object that
1271
+ # accepts any of the configuration options listed above.
1272
+
1273
+ Datadog.configure do |c|
1274
+ # Network connection string
1275
+ c.tracing.instrument :mongo, describes: '127.0.0.1:27017', service_name: 'mongo-primary'
1276
+
1277
+ # Network connection regular expression
1278
+ c.tracing.instrument :mongo, describes: /localhost.*/, service_name: 'mongo-secondary'
1279
+ end
1280
+
1281
+ client = Mongo::Client.new([ '127.0.0.1:27017' ], :database => 'artists')
1282
+ collection = client[:people]
1283
+ collection.insert_one({ name: 'Steve' })
1284
+ # Traced call will belong to `mongo-primary` service
1285
+
1286
+ client = Mongo::Client.new([ 'localhost:27017' ], :database => 'artists')
1287
+ collection = client[:people]
1288
+ collection.insert_one({ name: 'Steve' })
1289
+ # Traced call will belong to `mongo-secondary` service
1290
+ ```
1291
+
1292
+ When multiple `describes` configurations match a connection, the latest configured rule that matches will be applied.
1293
+
1167
1294
  ### MySQL2
1168
1295
 
1169
1296
  The MySQL2 integration traces any SQL command sent through `mysql2` gem.
@@ -1173,7 +1300,7 @@ require 'mysql2'
1173
1300
  require 'ddtrace'
1174
1301
 
1175
1302
  Datadog.configure do |c|
1176
- c.use :mysql2, options
1303
+ c.tracing.instrument :mysql2, options
1177
1304
  end
1178
1305
 
1179
1306
  client = Mysql2::Client.new(:host => "localhost", :username => "root")
@@ -1195,10 +1322,10 @@ require 'net/http'
1195
1322
  require 'ddtrace'
1196
1323
 
1197
1324
  Datadog.configure do |c|
1198
- c.use :http, options
1325
+ c.tracing.instrument :http, options
1199
1326
 
1200
1327
  # optionally, specify a different service name for hostnames matching a regex
1201
- c.use :http, describes: /user-[^.]+\.example\.com/ do |http|
1328
+ c.tracing.instrument :http, describes: /user-[^.]+\.example\.com/ do |http|
1202
1329
  http.service_name = 'user.example.com'
1203
1330
  http.split_by_domain = false # Only necessary if split_by_domain is true by default
1204
1331
  end
@@ -1220,11 +1347,11 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1220
1347
  | `service_name` | Service name used for `http` instrumentation | `'net/http'` |
1221
1348
  | `split_by_domain` | Uses the request domain as the service name when set to `true`. | `false` |
1222
1349
 
1223
- If you wish to configure each connection object individually, you may use the `Datadog.configure` as it follows:
1350
+ If you wish to configure each connection object individually, you may use the `Datadog.configure_onto` as it follows:
1224
1351
 
1225
1352
  ```ruby
1226
1353
  client = Net::HTTP.new(host, port)
1227
- Datadog.configure(client, options)
1354
+ Datadog.configure_onto(client, **options)
1228
1355
  ```
1229
1356
 
1230
1357
  ### Presto
@@ -1236,7 +1363,7 @@ require 'presto-client'
1236
1363
  require 'ddtrace'
1237
1364
 
1238
1365
  Datadog.configure do |c|
1239
- c.use :presto, options
1366
+ c.tracing.instrument :presto, options
1240
1367
  end
1241
1368
 
1242
1369
  client = Presto::Client.new(
@@ -1268,7 +1395,7 @@ To add tracing to a Qless job:
1268
1395
  require 'ddtrace'
1269
1396
 
1270
1397
  Datadog.configure do |c|
1271
- c.use :qless, options
1398
+ c.tracing.instrument :qless, options
1272
1399
  end
1273
1400
  ```
1274
1401
 
@@ -1276,7 +1403,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1276
1403
 
1277
1404
  | Key | Description | Default |
1278
1405
  | --- | ----------- | ------- |
1279
- | `service_name` | Service name used for `qless` instrumentation | `'qless'` |
1280
1406
  | `tag_job_data` | Enable tagging with job arguments. true for on, false for off. | `false` |
1281
1407
  | `tag_job_tags` | Enable tagging with job tags. true for on, false for off. | `false` |
1282
1408
 
@@ -1290,7 +1416,7 @@ You can enable it through `Datadog.configure`:
1290
1416
  require 'ddtrace'
1291
1417
 
1292
1418
  Datadog.configure do |c|
1293
- c.use :que, options
1419
+ c.tracing.instrument :que, options
1294
1420
  end
1295
1421
  ```
1296
1422
 
@@ -1299,7 +1425,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1299
1425
  | Key | Description | Default |
1300
1426
  | --- | ----------- | ------- |
1301
1427
  | `enabled` | Defines whether Que should be traced. Useful for temporarily disabling tracing. `true` or `false` | `true` |
1302
- | `service_name` | Service name used for `que` instrumentation | `'que'` |
1303
1428
  | `tag_args` | Enable tagging of a job's args field. `true` for on, `false` for off. | `false` |
1304
1429
  | `tag_data` | Enable tagging of a job's data field. `true` for on, `false` for off. | `false` |
1305
1430
  | `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? }` |
@@ -1314,7 +1439,7 @@ You can enable it through `Datadog.configure`:
1314
1439
  require 'ddtrace'
1315
1440
 
1316
1441
  Datadog.configure do |c|
1317
- c.use :racecar, options
1442
+ c.tracing.instrument :racecar, options
1318
1443
  end
1319
1444
  ```
1320
1445
 
@@ -1335,10 +1460,10 @@ This integration is automatically activated with web frameworks like Rails. If y
1335
1460
  require 'ddtrace'
1336
1461
 
1337
1462
  Datadog.configure do |c|
1338
- c.use :rack, options
1463
+ c.tracing.instrument :rack, options
1339
1464
  end
1340
1465
 
1341
- use Datadog::Contrib::Rack::TraceMiddleware
1466
+ use Datadog::Tracing::Contrib::Rack::TraceMiddleware
1342
1467
 
1343
1468
  app = proc do |env|
1344
1469
  [ 200, {'Content-Type' => 'text/plain'}, ['OK'] ]
@@ -1361,7 +1486,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1361
1486
  | `quantize.query.exclude` | Defines which values should be removed entirely. Excludes nothing by default. May be an Array of strings, or `:all` to remove the query string entirely. Option must be nested inside the `query` option. | `nil` |
1362
1487
  | `quantize.fragment` | Defines behavior for URL fragments. Removes fragments by default. May be `:show` to show URL fragments. Option must be nested inside the `quantize` option. | `nil` |
1363
1488
  | `request_queuing` | Track HTTP request time spent in the queue of the frontend server. See [HTTP request queuing](#http-request-queuing) for setup details. Set to `true` to enable. | `false` |
1364
- | `service_name` | Service name used for `rack` instrumentation | `'rack'` |
1365
1489
  | `web_service_name` | Service name for frontend server request queuing spans. (e.g. `'nginx'`) | `'web-server'` |
1366
1490
 
1367
1491
  **Configuring URL quantization behavior**
@@ -1374,23 +1498,23 @@ Datadog.configure do |c|
1374
1498
 
1375
1499
  # Show values for any query string parameter matching 'category_id' exactly
1376
1500
  # http://example.com/path?category_id=1&sort_by=asc#featured --> http://example.com/path?category_id=1&sort_by
1377
- c.use :rack, quantize: { query: { show: ['category_id'] } }
1501
+ c.tracing.instrument :rack, quantize: { query: { show: ['category_id'] } }
1378
1502
 
1379
1503
  # Show all values for all query string parameters
1380
1504
  # http://example.com/path?category_id=1&sort_by=asc#featured --> http://example.com/path?category_id=1&sort_by=asc
1381
- c.use :rack, quantize: { query: { show: :all } }
1505
+ c.tracing.instrument :rack, quantize: { query: { show: :all } }
1382
1506
 
1383
1507
  # Totally exclude any query string parameter matching 'sort_by' exactly
1384
1508
  # http://example.com/path?category_id=1&sort_by=asc#featured --> http://example.com/path?category_id
1385
- c.use :rack, quantize: { query: { exclude: ['sort_by'] } }
1509
+ c.tracing.instrument :rack, quantize: { query: { exclude: ['sort_by'] } }
1386
1510
 
1387
1511
  # Remove the query string entirely
1388
1512
  # http://example.com/path?category_id=1&sort_by=asc#featured --> http://example.com/path
1389
- c.use :rack, quantize: { query: { exclude: :all } }
1513
+ c.tracing.instrument :rack, quantize: { query: { exclude: :all } }
1390
1514
 
1391
1515
  # Show URL fragments
1392
1516
  # http://example.com/path?category_id=1&sort_by=asc#featured --> http://example.com/path?category_id&sort_by#featured
1393
- c.use :rack, quantize: { fragment: :show }
1517
+ c.tracing.instrument :rack, quantize: { fragment: :show }
1394
1518
  end
1395
1519
  ```
1396
1520
 
@@ -1405,7 +1529,7 @@ To enable the Rails instrumentation, create an initializer file in your `config/
1405
1529
  require 'ddtrace'
1406
1530
 
1407
1531
  Datadog.configure do |c|
1408
- c.use :rails, options
1532
+ c.tracing.instrument :rails, options
1409
1533
  end
1410
1534
  ```
1411
1535
 
@@ -1414,7 +1538,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1414
1538
  | Key | Description | Default |
1415
1539
  | --- | ----------- | ------- |
1416
1540
  | `cache_service` | Cache service name used when tracing cache activity | `'<app_name>-cache'` |
1417
- | `controller_service` | Service name used when tracing a Rails action controller | `'<app_name>'` |
1418
1541
  | `database_service` | Database service name used when tracing database activity | `'<app_name>-<adapter_name>'` |
1419
1542
  | `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` |
1420
1543
  | `exception_controller` | Class or Module which identifies a custom exception controller class. Tracer provides improved error behavior when it can identify custom exception controllers. By default, without this option, it 'guesses' what a custom exception controller looks like. Providing this option aids this identification. | `nil` |
@@ -1422,15 +1545,13 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1422
1545
  | `middleware_names` | Enables any short-circuited middleware requests to display the middleware name as a resource for the trace. | `false` |
1423
1546
  | `service_name` | Service name used when tracing application requests (on the `rack` level) | `'<app_name>'` (inferred from your Rails application namespace) |
1424
1547
  | `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/'` |
1425
- | `log_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. | `false` |
1426
1548
 
1427
1549
  **Supported versions**
1428
1550
 
1429
1551
  | MRI Versions | JRuby Versions | Rails Versions |
1430
1552
  | ------------- | -------------- | -------------- |
1431
- | 2.0 | | 3.0 - 3.2 |
1432
- | 2.1 | | 3.0 - 4.2 |
1433
- | 2.2 - 2.3 | | 3.0 - 5.2 |
1553
+ | 2.1 | | 3.2 - 4.2 |
1554
+ | 2.2 - 2.3 | | 3.2 - 5.2 |
1434
1555
  | 2.4 | | 4.2.8 - 5.2 |
1435
1556
  | 2.5 | | 4.2.8 - 6.1 |
1436
1557
  | 2.6 - 2.7 | 9.2 | 5.0 - 6.1 |
@@ -1448,7 +1569,7 @@ require 'rake'
1448
1569
  require 'ddtrace'
1449
1570
 
1450
1571
  Datadog.configure do |c|
1451
- c.use :rake, options
1572
+ c.tracing.instrument :rake, options
1452
1573
  end
1453
1574
 
1454
1575
  task :my_task do
@@ -1476,27 +1597,27 @@ Datadog.configure do |c|
1476
1597
  # Default behavior: all arguments are quantized.
1477
1598
  # `rake.invoke.args` tag --> ['?']
1478
1599
  # `rake.execute.args` tag --> { one: '?', two: '?', three: '?' }
1479
- c.use :rake
1600
+ c.tracing.instrument :rake
1480
1601
 
1481
1602
  # Show values for any argument matching :two exactly
1482
1603
  # `rake.invoke.args` tag --> ['?']
1483
1604
  # `rake.execute.args` tag --> { one: '?', two: 'bar', three: '?' }
1484
- c.use :rake, quantize: { args: { show: [:two] } }
1605
+ c.tracing.instrument :rake, quantize: { args: { show: [:two] } }
1485
1606
 
1486
1607
  # Show all values for all arguments.
1487
1608
  # `rake.invoke.args` tag --> ['foo', 'bar', 'baz']
1488
1609
  # `rake.execute.args` tag --> { one: 'foo', two: 'bar', three: 'baz' }
1489
- c.use :rake, quantize: { args: { show: :all } }
1610
+ c.tracing.instrument :rake, quantize: { args: { show: :all } }
1490
1611
 
1491
1612
  # Totally exclude any argument matching :three exactly
1492
1613
  # `rake.invoke.args` tag --> ['?']
1493
1614
  # `rake.execute.args` tag --> { one: '?', two: '?' }
1494
- c.use :rake, quantize: { args: { exclude: [:three] } }
1615
+ c.tracing.instrument :rake, quantize: { args: { exclude: [:three] } }
1495
1616
 
1496
1617
  # Remove the arguments entirely
1497
1618
  # `rake.invoke.args` tag --> ['?']
1498
1619
  # `rake.execute.args` tag --> {}
1499
- c.use :rake, quantize: { args: { exclude: :all } }
1620
+ c.tracing.instrument :rake, quantize: { args: { exclude: :all } }
1500
1621
  end
1501
1622
  ```
1502
1623
 
@@ -1509,7 +1630,7 @@ require 'redis'
1509
1630
  require 'ddtrace'
1510
1631
 
1511
1632
  Datadog.configure do |c|
1512
- c.use :redis, options
1633
+ c.tracing.instrument :redis, options
1513
1634
  end
1514
1635
 
1515
1636
  # Perform Redis commands
@@ -1531,14 +1652,14 @@ require 'redis'
1531
1652
  require 'ddtrace'
1532
1653
 
1533
1654
  Datadog.configure do |c|
1534
- c.use :redis # Enabling integration instrumentation is still required
1655
+ c.tracing.instrument :redis # Enabling integration instrumentation is still required
1535
1656
  end
1536
1657
 
1537
1658
  customer_cache = Redis.new
1538
1659
  invoice_cache = Redis.new
1539
1660
 
1540
- Datadog.configure(customer_cache, service_name: 'customer-cache')
1541
- Datadog.configure(invoice_cache, service_name: 'invoice-cache')
1661
+ Datadog.configure_onto(customer_cache, service_name: 'customer-cache')
1662
+ Datadog.configure_onto(invoice_cache, service_name: 'invoice-cache')
1542
1663
 
1543
1664
  # Traced call will belong to `customer-cache` service
1544
1665
  customer_cache.get(...)
@@ -1558,23 +1679,23 @@ You can configure trace settings per connection by using the `describes` option:
1558
1679
 
1559
1680
  Datadog.configure do |c|
1560
1681
  # The default configuration for any redis client
1561
- c.use :redis, service_name: 'redis-default'
1682
+ c.tracing.instrument :redis, service_name: 'redis-default'
1562
1683
 
1563
1684
  # The configuration matching a given unix socket.
1564
- c.use :redis, describes: { url: 'unix://path/to/file' }, service_name: 'redis-unix'
1685
+ c.tracing.instrument :redis, describes: { url: 'unix://path/to/file' }, service_name: 'redis-unix'
1565
1686
 
1566
1687
  # For network connections, only these fields are considered during matching:
1567
1688
  # scheme, host, port, db
1568
1689
  # Other fields are ignored.
1569
1690
 
1570
1691
  # 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'
1692
+ c.tracing.instrument :redis, describes: 'redis://127.0.0.1:6379/0', service_name: 'redis-connection-string'
1693
+ c.tracing.instrument :redis, describes: { url: 'redis://127.0.0.1:6379/1' }, service_name: 'redis-connection-url'
1573
1694
  # Network client hash
1574
- c.use :redis, describes: { host: 'my-host.com', port: 6379, db: 1, scheme: 'redis' }, service_name: 'redis-connection-hash'
1695
+ c.tracing.instrument :redis, describes: { host: 'my-host.com', port: 6379, db: 1, scheme: 'redis' }, service_name: 'redis-connection-hash'
1575
1696
  # Only a subset of the connection hash
1576
- c.use :redis, describes: { host: ENV['APP_CACHE_HOST'], port: ENV['APP_CACHE_PORT'] }, service_name: 'redis-cache'
1577
- c.use :redis, describes: { host: ENV['SIDEKIQ_CACHE_HOST'] }, service_name: 'redis-sidekiq'
1697
+ c.tracing.instrument :redis, describes: { host: ENV['APP_CACHE_HOST'], port: ENV['APP_CACHE_PORT'] }, service_name: 'redis-cache'
1698
+ c.tracing.instrument :redis, describes: { host: ENV['SIDEKIQ_CACHE_HOST'] }, service_name: 'redis-sidekiq'
1578
1699
  end
1579
1700
  ```
1580
1701
 
@@ -1591,7 +1712,7 @@ require 'resque'
1591
1712
  require 'ddtrace'
1592
1713
 
1593
1714
  Datadog.configure do |c|
1594
- c.use :resque, **options
1715
+ c.tracing.instrument :resque, **options
1595
1716
  end
1596
1717
  ```
1597
1718
 
@@ -1599,9 +1720,7 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1599
1720
 
1600
1721
  | Key | Description | Default |
1601
1722
  | --- | ----------- | ------- |
1602
- | `service_name` | Service name used for `resque` instrumentation | `'resque'` |
1603
1723
  | `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` |
1605
1724
 
1606
1725
  ### Rest Client
1607
1726
 
@@ -1612,7 +1731,7 @@ require 'rest_client'
1612
1731
  require 'ddtrace'
1613
1732
 
1614
1733
  Datadog.configure do |c|
1615
- c.use :rest_client, options
1734
+ c.tracing.instrument :rest_client, options
1616
1735
  end
1617
1736
  ```
1618
1737
 
@@ -1635,7 +1754,7 @@ require 'ddtrace'
1635
1754
 
1636
1755
  # Configure default RSpec integration
1637
1756
  Datadog.configure do |c|
1638
- c.use :rspec, options
1757
+ c.ci.instrument :rspec, options
1639
1758
  end
1640
1759
  ```
1641
1760
 
@@ -1665,7 +1784,7 @@ database.create_table :articles do
1665
1784
  end
1666
1785
 
1667
1786
  Datadog.configure do |c|
1668
- c.use :sequel, options
1787
+ c.tracing.instrument :sequel, options
1669
1788
  end
1670
1789
 
1671
1790
  # Perform a query
@@ -1688,8 +1807,8 @@ sqlite_database = Sequel.sqlite
1688
1807
  postgres_database = Sequel.connect('postgres://user:password@host:port/database_name')
1689
1808
 
1690
1809
  # Configure each database with different service names
1691
- Datadog.configure(sqlite_database, service_name: 'my-sqlite-db')
1692
- Datadog.configure(postgres_database, service_name: 'my-postgres-db')
1810
+ Datadog.configure_onto(sqlite_database, service_name: 'my-sqlite-db')
1811
+ Datadog.configure_onto(postgres_database, service_name: 'my-postgres-db')
1693
1812
  ```
1694
1813
 
1695
1814
  ### Shoryuken
@@ -1702,7 +1821,7 @@ You can enable it through `Datadog.configure`:
1702
1821
  require 'ddtrace'
1703
1822
 
1704
1823
  Datadog.configure do |c|
1705
- c.use :shoryuken, options
1824
+ c.tracing.instrument :shoryuken, options
1706
1825
  end
1707
1826
  ```
1708
1827
 
@@ -1710,7 +1829,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1710
1829
 
1711
1830
  | Key | Description | Default |
1712
1831
  | --- | ----------- | ------- |
1713
- | `service_name` | Service name used for `shoryuken` instrumentation | `'shoryuken'` |
1714
1832
  | `tag_body` | Tag spans with the SQS message body `true` or `false` | `false` |
1715
1833
  | `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? }` |
1716
1834
 
@@ -1724,7 +1842,7 @@ You can enable it through `Datadog.configure`:
1724
1842
  require 'ddtrace'
1725
1843
 
1726
1844
  Datadog.configure do |c|
1727
- c.use :sidekiq, options
1845
+ c.tracing.instrument :sidekiq, options
1728
1846
  end
1729
1847
  ```
1730
1848
 
@@ -1732,8 +1850,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1732
1850
 
1733
1851
  | Key | Description | Default |
1734
1852
  | --- | ----------- | ------- |
1735
- | `client_service_name` | Service name used for client-side `sidekiq` instrumentation | `'sidekiq-client'` |
1736
- | `service_name` | Service name used for server-side `sidekiq` instrumentation | `'sidekiq'` |
1737
1853
  | `tag_args` | Enable tagging of job arguments. `true` for on, `false` for off. | `false` |
1738
1854
  | `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? }` |
1739
1855
 
@@ -1750,7 +1866,7 @@ require 'sinatra'
1750
1866
  require 'ddtrace'
1751
1867
 
1752
1868
  Datadog.configure do |c|
1753
- c.use :sinatra, options
1869
+ c.tracing.instrument :sinatra, options
1754
1870
  end
1755
1871
 
1756
1872
  get '/' do
@@ -1765,11 +1881,11 @@ require 'sinatra/base'
1765
1881
  require 'ddtrace'
1766
1882
 
1767
1883
  Datadog.configure do |c|
1768
- c.use :sinatra, options
1884
+ c.tracing.instrument :sinatra, options
1769
1885
  end
1770
1886
 
1771
1887
  class NestedApp < Sinatra::Base
1772
- register Datadog::Contrib::Sinatra::Tracer
1888
+ register Datadog::Tracing::Contrib::Sinatra::Tracer
1773
1889
 
1774
1890
  get '/nested' do
1775
1891
  'Hello from nested app!'
@@ -1777,7 +1893,7 @@ class NestedApp < Sinatra::Base
1777
1893
  end
1778
1894
 
1779
1895
  class App < Sinatra::Base
1780
- register Datadog::Contrib::Sinatra::Tracer
1896
+ register Datadog::Tracing::Contrib::Sinatra::Tracer
1781
1897
 
1782
1898
  use NestedApp
1783
1899
 
@@ -1787,7 +1903,7 @@ class App < Sinatra::Base
1787
1903
  end
1788
1904
  ```
1789
1905
 
1790
- Ensure you register `Datadog::Contrib::Sinatra::Tracer` as a middleware before you mount your nested applications.
1906
+ Ensure you register `Datadog::Tracing::Contrib::Sinatra::Tracer` as a middleware before you mount your nested applications.
1791
1907
 
1792
1908
  #### Instrumentation options
1793
1909
 
@@ -1798,7 +1914,6 @@ Ensure you register `Datadog::Contrib::Sinatra::Tracer` as a middleware before y
1798
1914
  | `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` |
1799
1915
  | `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'] }` |
1800
1916
  | `resource_script_names` | Prepend resource names with script name | `false` |
1801
- | `service_name` | Service name used for `sinatra` instrumentation | `'sinatra'` |
1802
1917
 
1803
1918
  ### Sneakers
1804
1919
 
@@ -1810,7 +1925,7 @@ You can enable it through `Datadog.configure`:
1810
1925
  require 'ddtrace'
1811
1926
 
1812
1927
  Datadog.configure do |c|
1813
- c.use :sneakers, options
1928
+ c.tracing.instrument :sneakers, options
1814
1929
  end
1815
1930
  ```
1816
1931
 
@@ -1819,7 +1934,6 @@ Where `options` is an optional `Hash` that accepts the following parameters:
1819
1934
  | Key | Description | Default |
1820
1935
  | --- | ----------- | ------- |
1821
1936
  | `enabled` | Defines whether Sneakers should be traced. Useful for temporarily disabling tracing. `true` or `false` | `true` |
1822
- | `service_name` | Service name used for `sneakers` instrumentation | `'sneakers'` |
1823
1937
  | `tag_body` | Enable tagging of job message. `true` for on, `false` for off. | `false` |
1824
1938
  | `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? }` |
1825
1939
 
@@ -1831,63 +1945,57 @@ The `sucker_punch` integration traces all scheduled jobs:
1831
1945
  require 'ddtrace'
1832
1946
 
1833
1947
  Datadog.configure do |c|
1834
- c.use :sucker_punch, options
1948
+ c.tracing.instrument :sucker_punch
1835
1949
  end
1836
1950
 
1837
1951
  # Execution of this job is traced
1838
1952
  LogJob.perform_async('login')
1839
1953
  ```
1840
1954
 
1841
- Where `options` is an optional `Hash` that accepts the following parameters:
1842
-
1843
- | Key | Description | Default |
1844
- | --- | ----------- | ------- |
1845
- | `service_name` | Service name used for `sucker_punch` instrumentation | `'sucker_punch'` |
1846
-
1847
- ## Advanced configuration
1955
+ ## Additional configuration
1848
1956
 
1849
- ### Tracer settings
1850
-
1851
- To change the default behavior of the Datadog tracer, you can provide custom options inside the `Datadog.configure` block as in:
1957
+ To change the default behavior of Datadog tracing, you can set environment variables, or provide custom options inside a `Datadog.configure` block, e.g.:
1852
1958
 
1853
1959
  ```ruby
1854
- # config/initializers/datadog-tracer.rb
1855
-
1856
1960
  Datadog.configure do |c|
1857
- c.tracer.enabled = true
1858
- c.tracer.hostname = 'my-agent'
1859
- c.tracer.port = 8126
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)
1865
- c.tracer.sampler = Datadog::AllSampler.new
1866
-
1867
- # Breaks down very large traces into smaller batches
1868
- c.tracer.partial_flush.enabled = false
1869
-
1870
- # You can specify your own tracer
1871
- c.tracer.instance = Datadog::Tracer.new
1872
-
1873
- # To enable debug mode
1874
- c.diagnostics.debug = true
1875
- end
1876
- ```
1877
-
1878
- Available options are:
1879
-
1880
- - `enabled`: defines if the `tracer` is enabled or not. If set to `false` instrumentation will still run, but no spans are sent to the trace agent. Can be configured through the `DD_TRACE_ENABLED` environment variable. Defaults to `true`.
1881
- - `hostname`: set the hostname of the trace agent.
1882
- - `instance`: set to a custom `Datadog::Tracer` instance. If provided, other trace settings are ignored (you must configure it manually.)
1883
- - `partial_flush.enabled`: set to `true` to enable partial trace flushing (for long running traces.) Disabled by default. *Experimental.*
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.
1887
- - `sampler`: set to a custom `Datadog::Sampler` instance. If provided, the tracer will use this sampler to determine sampling behavior.
1888
- - `diagnostics.startup_logs.enabled`: Startup configuration and diagnostic log. Defaults to `true`. Can be configured through the `DD_TRACE_STARTUP_LOGS` environment variable.
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 }`.
1961
+ c.service = 'billing-api'
1962
+ c.env = ENV['RACK_ENV']
1963
+
1964
+ c.tracing.report_hostname = true
1965
+ c.tracing.test_mode.enabled = (ENV['RACK_ENV'] == 'test')
1966
+ end
1967
+ ```
1968
+
1969
+ **Available configuration options:**
1970
+
1971
+ | Setting | Env Var | Default | Description |
1972
+ |---------------------------------------------------------|--------------------------------|-------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
1973
+ | **Global** | | | |
1974
+ | `agent.host` | `DD_AGENT_HOST` | `127.0.0.1` | Hostname of agent to where trace data will be sent. |
1975
+ | `agent.port` | `DD_TRACE_AGENT_PORT` | `8126` | Port of agent host to where trace data will be sent. |
1976
+ | | `DD_TRACE_AGENT_URL` | `nil` | Sets the URL endpoint where traces are sent. Has priority over `agent.host` and `agent.port`. |
1977
+ | `diagnostics.debug` | `DD_TRACE_DEBUG` | `false` | Enables or disables debug mode. Prints verbose logs. **NOT recommended for production or other sensitive environments.** See [Debugging and diagnostics](#debugging-and-diagnostics) for more details. |
1978
+ | `diagnostics.startup_logs.enabled` | `DD_TRACE_STARTUP_LOGS` | `nil` | Prints startup configuration and diagnostics to log. For assessing state of tracing at application startup. See [Debugging and diagnostics](#debugging-and-diagnostics) for more details. |
1979
+ | `env` | `DD_ENV` | `nil` | Your application environment. (e.g. `production`, `staging`, etc.) This value is set as a tag on all traces. |
1980
+ | `service` | `DD_SERVICE` | *Ruby filename* | Your application's default service name. (e.g. `billing-api`) This value is set as a tag on all traces. |
1981
+ | `tags` | `DD_TAGS` | `nil` | Custom tags in value pairs separated by `,` (e.g. `layer:api,team:intake`) These tags are set on all traces. See [Environment and tags](#environment-and-tags) for more details. |
1982
+ | `time_now_provider` | | `->{ Time.now }` | Changes how time is retrieved. See [Setting the time provider](#Setting the time provider) for more details. |
1983
+ | `version` | `DD_VERSION` | `nil` | Your application version (e.g. `2.5`, `202003181415`, `1.3-alpha`, etc.) This value is set as a tag on all traces. |
1984
+ | **Tracing** | | | |
1985
+ | `tracing.analytics.enabled` | `DD_TRACE_ANALYTICS_ENABLED` | `nil` | Enables or disables trace analytics. See [Sampling](#sampling) for more details. |
1986
+ | `tracing.distributed_tracing.propagation_extract_style` | `DD_PROPAGATION_STYLE_EXTRACT` | `['Datadog','B3','B3 single header']` | Distributed tracing header formats to extract. See [Distributed Tracing](#distributed-tracing) for more details. |
1987
+ | `tracing.distributed_tracing.propagation_inject_style` | `DD_PROPAGATION_STYLE_INJECT` | `['Datadog']` | Distributed tracing header formats to inject. See [Distributed Tracing](#distributed-tracing) for more details. |
1988
+ | `tracing.enabled` | `DD_TRACE_ENABLED` | `true` | Enables or disables tracing. If set to `false` instrumentation will still run, but no traces are sent to the trace agent. |
1989
+ | `tracing.instrument(<integration-name>, <options...>)` | | | Activates instrumentation for a specific library. See [Integration instrumentation](#integration-instrumentation) for more details. |
1990
+ | `tracing.log_injection` | `DD_LOGS_INJECTION` | `true` | Injects [Trace Correlation](#trace-correlation) information into Rails logs if present. Supports the default logger (`ActiveSupport::TaggedLogging`), `lograge`, and `semantic_logger`. |
1991
+ | `tracing.partial_flush.enabled` | | `false` | Enables or disables partial flushing. Partial flushing submits completed portions of a trace to the agent. Used when tracing instruments long running tasks (e.g. jobs) with many spans. |
1992
+ | `tracing.partial_flush.min_spans_threshold` | | `500` | The number of spans that must be completed in a trace before partial flushing submits those completed spans. |
1993
+ | `tracing.sampler` | | `nil` | Advanced usage only. Sets a custom `Datadog::Tracing::Sampling::Sampler` instance. If provided, the tracer will use this sampler to determine sampling behavior. See [Application-side sampling](#application-side-sampling) for details. |
1994
+ | `tracing.sampling.default_rate` | `DD_TRACE_SAMPLE_RATE` | `nil` | Sets the trace sampling rate between `0.0` (0%) and `1.0` (100%). See [Application-side sampling](#application-side-sampling) for details. |
1995
+ | `tracing.sampling.rate_limit` | `DD_TRACE_RATE_LIMIT` | `100` (per second) | Sets a maximum number of traces per second to sample. Set a rate limit to avoid the ingestion volume overages in the case of traffic spikes. |
1996
+ | `tracing.report_hostname` | `DD_TRACE_REPORT_HOSTNAME` | `false` | Adds hostname tag to traces. |
1997
+ | `tracing.test_mode.enabled` | `DD_TRACE_TEST_MODE_ENABLED` | `false` | Enables or disables test mode, for use of tracing in test suites. |
1998
+ | `tracing.test_mode.trace_flush` | | `nil` | Object that determines trace flushing behavior. |
1891
1999
 
1892
2000
  #### Custom logging
1893
2001
 
@@ -1900,18 +2008,16 @@ Additionally, it is possible to override the default logger and replace it by a
1900
2008
  ```ruby
1901
2009
  f = File.new("my-custom.log", "w+") # Log messages should go there
1902
2010
  Datadog.configure do |c|
1903
- c.logger = Logger.new(f) # Overriding the default logger
2011
+ c.logger.instance = Logger.new(f) # Overriding the default logger
1904
2012
  c.logger.level = ::Logger::INFO
1905
2013
  end
1906
2014
 
1907
2015
  Datadog.logger.info { "this is typically called by tracing code" }
1908
2016
  ```
1909
2017
 
1910
- ### Environment and tags
2018
+ #### Environment and tags
1911
2019
 
1912
- By default, the trace agent (not this library, but the program running in the background collecting data from various clients) uses the tags set in the agent config file, see our [environments tutorial](https://app.datadoghq.com/apm/docs/tutorials/environments) for details.
1913
-
1914
- You can configure the application to automatically tag your traces and metrics, using the following environment variables:
2020
+ By default, the trace agent (not this library, but the program running in the background collecting data from various clients) uses the tags set in the agent config file. You can configure the application to automatically tag your traces and metrics, using the following environment variables:
1915
2021
 
1916
2022
  - `DD_ENV`: Your application environment (e.g. `production`, `staging`, etc.)
1917
2023
  - `DD_SERVICE`: Your application's default service name (e.g. `billing-api`)
@@ -1935,69 +2041,100 @@ This enables you to set this value on a per application basis, so you can have f
1935
2041
 
1936
2042
  Tags can also be set directly on individual spans, which will supersede any conflicting tags defined at the application level.
1937
2043
 
1938
- ### Environment variables
2044
+ #### Debugging and diagnostics
1939
2045
 
1940
- Other Environment Variables:
2046
+ There are two different suggested means of producing diagnostics for tracing:
1941
2047
 
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`.
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.
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.
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`.
2048
+ ##### Enabling debug mode
1946
2049
 
1947
- ### Sampling
2050
+ Switching the library into debug mode will produce verbose, detailed logs about tracing activity, including any suppressed errors. This output can be helpful in identifying errors, or confirming trace output to the agent.
2051
+
2052
+ You can enable this via `diagnostics.debug = true` or `DD_TRACE_DEBUG`.
2053
+
2054
+ ```ruby
2055
+ Datadog.configure { |c| c.diagnostics.debug = true }
2056
+ ```
2057
+
2058
+ **We do NOT recommend use of this feature in production or other sensitive environments**, as it can be very verbose under load. It's best to use this in a controlled environment where you can control application load.
2059
+
2060
+ ##### Enabling startup logs
2061
+
2062
+ Startup logs produce a report of tracing state when the application is initially configured. This can be helpful for confirming that configuration and instrumentation is activated correctly.
1948
2063
 
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/).
2064
+ You can enable this via `diagnostics.startup_logs.enabled = true` or `DD_TRACE_STARTUP_LOGS`.
1950
2065
 
1951
- We recommend setting the environment variable `DD_TRACE_SAMPLE_RATE=1.0` in all new applications using `ddtrace`.
2066
+ ```ruby
2067
+ Datadog.configure { |c| c.diagnostics.startup_logs.enabled = true }
2068
+ ```
1952
2069
 
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/).
2070
+ By default, this will be activated whenever `ddtrace` detects the application is running in a non-development environment.
2071
+
2072
+ ### Sampling
1954
2073
 
1955
2074
  #### Application-side sampling
1956
2075
 
1957
2076
  While the trace agent can sample traces to reduce bandwidth usage, application-side sampling reduces the performance overhead.
1958
2077
 
1959
- This will **reduce visibility and is not recommended**. See [DD_TRACE_SAMPLE_RATE](#environment-variables) for the recommended sampling approach.
2078
+ The default sampling rate can be set between `0.0` (0%) and `1.0` (100%). Configure the rate in order to control the volume of traces sent to Datadog. When this configuration is not set, the Datadog agent will distribute a default sampling rate of 10 traces per second.
2079
+
2080
+ Set this value via `DD_TRACE_SAMPLE_RATE` or `Datadog.configure { |c| c.tracing.sampling.default_rate = <value> }`.
1960
2081
 
1961
- `Datadog::RateSampler` samples a ratio of the traces. For example:
2082
+ Alternatively, you may provide your own sampler. The `Datadog::Tracing::Sampling::RateSampler` samples a ratio of the traces. For example:
1962
2083
 
1963
2084
  ```ruby
1964
2085
  # Sample rate is between 0 (nothing sampled) to 1 (everything sampled).
1965
- sampler = Datadog::RateSampler.new(0.5) # sample 50% of the traces
2086
+ sampler = Datadog::Tracing::Sampling::RateSampler.new(0.5) # sample 50% of the traces
1966
2087
 
1967
2088
  Datadog.configure do |c|
1968
- c.tracer.sampler = sampler
2089
+ c.tracing.sampler = sampler
1969
2090
  end
1970
2091
  ```
1971
2092
 
2093
+ See [Additional Configuration](#additional-configuration) for more details about these settings.
2094
+
1972
2095
  #### Priority sampling
1973
2096
 
1974
2097
  Priority sampling decides whether to keep a trace by using a priority attribute propagated for distributed traces. Its value indicates to the Agent and the backend about how important the trace is.
1975
2098
 
1976
2099
  The sampler can set the priority to the following values:
1977
2100
 
1978
- - `Datadog::Ext::Priority::AUTO_REJECT`: the sampler automatically decided to reject the trace.
1979
- - `Datadog::Ext::Priority::AUTO_KEEP`: the sampler automatically decided to keep the trace.
2101
+ - `Datadog::Tracing::Sampling::Ext::Priority::AUTO_REJECT`: the sampler automatically decided to reject the trace.
2102
+ - `Datadog::Tracing::Sampling::Ext::Priority::AUTO_KEEP`: the sampler automatically decided to keep the trace.
1980
2103
 
1981
2104
  Priority sampling is enabled by default. Enabling it ensures that your sampled distributed traces will be complete. Once enabled, the sampler will automatically assign a priority of 0 or 1 to traces, depending on their service and volume.
1982
2105
 
1983
- You can also set this priority manually to either drop a non-interesting trace or to keep an important one. For that, set the `context#sampling_priority` to:
2106
+ You can also set this priority manually to either drop a non-interesting trace or to keep an important one. For that, set the `TraceOperation#sampling_priority` to:
1984
2107
 
1985
- - `Datadog::Ext::Priority::USER_REJECT`: the user asked to reject the trace.
1986
- - `Datadog::Ext::Priority::USER_KEEP`: the user asked to keep the trace.
2108
+ - `Datadog::Tracing::Sampling::Ext::Priority::USER_REJECT`: the user asked to reject the trace.
2109
+ - `Datadog::Tracing::Sampling::Ext::Priority::USER_KEEP`: the user asked to keep the trace.
1987
2110
 
1988
2111
  When not using [distributed tracing](#distributed-tracing), you may change the priority at any time, as long as the trace incomplete. But it has to be done before any context propagation (fork, RPC calls) to be useful in a distributed context. Changing the priority after the context has been propagated causes different parts of a distributed trace to use different priorities. Some parts might be kept, some parts might be rejected, and this can cause the trace to be partially stored and remain incomplete.
1989
2112
 
1990
- If you change the priority, we recommend you do it as soon as possible - when the root span has just been created.
2113
+ For this reason, if you change the priority, we recommend you do it as early as possible.
2114
+
2115
+ To change the sampling priority, you can use the following methods:
2116
+
2117
+ ```ruby
2118
+ # Rejects the active trace
2119
+ Datadog::Tracing.reject!
2120
+
2121
+ # Keeps the active trace
2122
+ Datadog::Tracing.keep!
2123
+ ```
2124
+
2125
+ It's safe to use `Datadog::Tracing.reject!` and `Datadog::Tracing.keep!` when no trace is active.
2126
+
2127
+ You can also reject a specific trace instance:
1991
2128
 
1992
2129
  ```ruby
1993
2130
  # First, grab the active span
1994
- span = Datadog.tracer.active_span
2131
+ trace = Datadog::Tracing.active_trace
1995
2132
 
1996
- # Indicate to reject the trace
1997
- span.context.sampling_priority = Datadog::Ext::Priority::USER_REJECT
2133
+ # Rejects the trace
2134
+ trace.reject!
1998
2135
 
1999
- # Indicate to keep the trace
2000
- span.context.sampling_priority = Datadog::Ext::Priority::USER_KEEP
2136
+ # Keeps the trace
2137
+ trace.keep!
2001
2138
  ```
2002
2139
 
2003
2140
  ### Distributed Tracing
@@ -2102,6 +2239,33 @@ Service C:
2102
2239
  Priority: 1
2103
2240
  ```
2104
2241
 
2242
+ **Distributed header formats**
2243
+
2244
+ Tracing supports the following distributed trace formats:
2245
+
2246
+ - `Datadog::Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_DATADOG` (Default)
2247
+ - `Datadog::Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_B3`
2248
+ - `Datadog::Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_B3_SINGLE_HEADER`
2249
+
2250
+ You can enable/disable the use of these formats via `Datadog.configure`:
2251
+
2252
+ ```ruby
2253
+ Datadog.configure do |c|
2254
+ # List of header formats that should be extracted
2255
+ c.tracing.distributed_tracing.propagation_extract_style = [
2256
+ Datadog::Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_DATADOG,
2257
+ Datadog::Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_B3,
2258
+ Datadog::Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_B3_SINGLE_HEADER
2259
+
2260
+ ]
2261
+
2262
+ # List of header formats that should be injected
2263
+ c.tracing.distributed_tracing.propagation_inject_style = [
2264
+ Datadog::Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_DATADOG
2265
+ ]
2266
+ end
2267
+ ```
2268
+
2105
2269
  **Activating distributed tracing for integrations**
2106
2270
 
2107
2271
  Many integrations included in `ddtrace` support distributed tracing. Distributed tracing is enabled by default in Agent v7 and most versions of Agent v6. If needed, you can activate distributed tracing with configuration settings.
@@ -2119,30 +2283,30 @@ For more details on how to activate distributed tracing for integrations, see th
2119
2283
  - [Rack](#rack)
2120
2284
  - [Rails](#rails)
2121
2285
  - [Sinatra](#sinatra)
2122
- - [http.rb](#http-rb)
2286
+ - [http.rb](#httprb)
2123
2287
  - [httpclient](#httpclient)
2124
2288
  - [httpx](#httpx)
2125
2289
 
2126
2290
  **Using the HTTP propagator**
2127
2291
 
2128
- To make the process of propagating this metadata easier, you can use the `Datadog::HTTPPropagator` module.
2292
+ To make the process of propagating this metadata easier, you can use the `Datadog::Tracing::Propagation::HTTP` module.
2129
2293
 
2130
2294
  On the client:
2131
2295
 
2132
2296
  ```ruby
2133
- Datadog.tracer.trace('web.call') do |span|
2134
- # Inject span context into headers (`env` must be a Hash)
2135
- Datadog::HTTPPropagator.inject!(span.context, env)
2297
+ Datadog::Tracing.trace('web.call') do |span, trace|
2298
+ # Inject trace headers into request headers (`env` must be a Hash)
2299
+ Datadog::Tracing::Propagation::HTTP.inject!(trace.to_digest, env)
2136
2300
  end
2137
2301
  ```
2138
2302
 
2139
2303
  On the server:
2140
2304
 
2141
2305
  ```ruby
2142
- Datadog.tracer.trace('web.work') do |span|
2143
- # Build a context from headers (`env` must be a Hash)
2144
- context = HTTPPropagator.extract(request.env)
2145
- Datadog.tracer.provider.context = context if context.trace_id
2306
+ trace_digest = Datadog::Tracing::Propagation::HTTP.extract(request.env)
2307
+
2308
+ Datadog::Tracing.trace('web.work', continue_from: trace_digest) do |span|
2309
+ # Do web work...
2146
2310
  end
2147
2311
  ```
2148
2312
 
@@ -2168,149 +2332,87 @@ Then you must enable the request queuing feature, by setting `request_queuing: t
2168
2332
 
2169
2333
  ### Processing Pipeline
2170
2334
 
2171
- Some applications might require that traces be altered or filtered out before they are sent upstream. The processing pipeline allows users to create *processors* to define such behavior.
2172
-
2173
- Processors can be any object that responds to `#call` accepting `trace` as an argument (which is an `Array` of `Datadog::Span`s.)
2174
-
2175
- For example:
2176
-
2177
- ```ruby
2178
- lambda_processor = ->(trace) do
2179
- # Processing logic...
2180
- trace
2181
- end
2182
-
2183
- class MyCustomProcessor
2184
- def call(trace)
2185
- # Processing logic...
2186
- trace
2187
- end
2188
- end
2189
- custom_processor = MyFancyProcessor.new
2190
- ```
2191
-
2192
- `#call` blocks of processors *must* return the `trace` object; this return value will be passed to the next processor in the pipeline.
2193
-
2194
- These processors must then be added to the pipeline via `Datadog::Pipeline.before_flush`:
2195
-
2196
- ```ruby
2197
- Datadog::Pipeline.before_flush(lambda_processor, custom_processor)
2198
- ```
2199
-
2200
- You can also define processors using the short-hand block syntax for `Datadog::Pipeline.before_flush`:
2201
-
2202
- ```ruby
2203
- Datadog::Pipeline.before_flush do |trace|
2204
- trace.delete_if { |span| span.name =~ /forbidden/ }
2205
- end
2206
- ```
2335
+ Some applications might require that traces be altered or filtered out before they are sent to Datadog. The processing pipeline allows you to create *processors* to define such behavior.
2207
2336
 
2208
2337
  #### Filtering
2209
2338
 
2210
- You can use the `Datadog::Pipeline::SpanFilter` processor to remove spans, when the block evaluates as truthy:
2339
+ You can use the `Datadog::Tracing::Pipeline::SpanFilter` processor to remove spans, when the block evaluates as truthy:
2211
2340
 
2212
2341
  ```ruby
2213
- Datadog::Pipeline.before_flush(
2342
+ Datadog::Tracing.before_flush(
2214
2343
  # Remove spans that match a particular resource
2215
- Datadog::Pipeline::SpanFilter.new { |span| span.resource =~ /PingController/ },
2344
+ Datadog::Tracing::Pipeline::SpanFilter.new { |span| span.resource =~ /PingController/ },
2216
2345
  # Remove spans that are trafficked to localhost
2217
- Datadog::Pipeline::SpanFilter.new { |span| span.get_tag('host') == 'localhost' }
2346
+ Datadog::Tracing::Pipeline::SpanFilter.new { |span| span.get_tag('host') == 'localhost' }
2218
2347
  )
2219
2348
  ```
2220
2349
 
2221
2350
  #### Processing
2222
2351
 
2223
- You can use the `Datadog::Pipeline::SpanProcessor` processor to modify spans:
2352
+ You can use the `Datadog::Tracing::Pipeline::SpanProcessor` processor to modify spans:
2224
2353
 
2225
2354
  ```ruby
2226
- Datadog::Pipeline.before_flush(
2355
+ Datadog::Tracing.before_flush(
2227
2356
  # Strip matching text from the resource field
2228
- Datadog::Pipeline::SpanProcessor.new { |span| span.resource.gsub!(/password=.*/, '') }
2357
+ Datadog::Tracing::Pipeline::SpanProcessor.new { |span| span.resource.gsub!(/password=.*/, '') }
2229
2358
  )
2230
2359
  ```
2231
2360
 
2232
- ### Trace correlation
2233
-
2234
- In many cases, such as logging, it may be useful to correlate trace IDs to other events or data streams, for easier cross-referencing.
2235
-
2236
- #### For logging in Rails applications
2361
+ #### Custom processor
2237
2362
 
2238
- ##### Automatic
2363
+ Processors can be any object that responds to `#call` accepting `trace` as an argument (which is an `Array` of `Datadog::Span`s.)
2239
2364
 
2240
- For Rails applications using the default logger (`ActiveSupport::TaggedLogging`) or `lograge`, you can automatically enable trace correlation injection by setting the `rails` instrumentation configuration option `log_injection` to `true` or by setting environment variable `DD_LOGS_INJECTION=true`:
2365
+ For example, using the short-hand block syntax:
2241
2366
 
2242
2367
  ```ruby
2243
- # config/initializers/datadog.rb
2244
- require 'ddtrace'
2245
-
2246
- Datadog.configure do |c|
2247
- c.use :rails, log_injection: true
2368
+ Datadog::Tracing.before_flush do |trace|
2369
+ # Processing logic...
2370
+ trace
2248
2371
  end
2249
2372
  ```
2250
2373
 
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
-
2253
- ##### Manual (Lograge)
2254
-
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.
2374
+ For a custom processor class:
2256
2375
 
2257
2376
  ```ruby
2258
- config.lograge.custom_options = lambda do |event|
2259
- # Retrieves trace information for current thread
2260
- correlation = Datadog.tracer.active_correlation
2261
-
2262
- {
2263
- # Adds IDs as tags to log output
2264
- :dd => {
2265
- # To preserve precision during JSON serialization, use strings for large numbers
2266
- :trace_id => correlation.trace_id.to_s,
2267
- :span_id => correlation.span_id.to_s,
2268
- :env => correlation.env.to_s,
2269
- :service => correlation.service.to_s,
2270
- :version => correlation.version.to_s
2271
- },
2272
- :ddsource => ["ruby"],
2273
- :params => event.payload[:params].reject { |k| %w(controller action).include? k }
2274
- }
2377
+ class MyCustomProcessor
2378
+ def call(trace)
2379
+ # Processing logic...
2380
+ trace
2381
+ end
2275
2382
  end
2383
+
2384
+ Datadog::Tracing.before_flush(MyCustomProcessor.new)
2276
2385
  ```
2277
2386
 
2278
- ##### Manual (ActiveSupport::TaggedLogging)
2387
+ In both cases, the processor method *must* return the `trace` object; this return value will be passed to the next processor in the pipeline.
2388
+
2389
+ ### Trace correlation
2279
2390
 
2280
- Rails applications which are configured with the default `ActiveSupport::TaggedLogging` logger can append correlation IDs as tags to log output. To enable Trace Correlation with `ActiveSupport::TaggedLogging`, in your Rails environment configuration file, add the following:
2391
+ In many cases, such as logging, it may be useful to correlate trace IDs to other events or data streams, for easier cross-referencing.
2281
2392
 
2282
- ```ruby
2283
- Rails.application.configure do
2284
- config.log_tags = [proc { Datadog.tracer.active_correlation.to_s }]
2285
- end
2393
+ #### For logging in Rails applications
2286
2394
 
2287
- # Given:
2288
- # DD_ENV = 'production' (The name of the environment your application is running in.)
2289
- # DD_SERVICE = 'billing-api' (Default service name of your application.)
2290
- # DD_VERSION = '2.5.17' (The version of your application.)
2395
+ ##### Automatic
2291
2396
 
2292
- # Web requests will produce:
2293
- # [dd.env=production dd.service=billing-api dd.version=2.5.17 dd.trace_id=7110975754844687674 dd.span_id=7518426836986654206] Started GET "/articles" for 172.22.0.1 at 2019-01-16 18:50:57 +0000
2294
- # [dd.env=production dd.service=billing-api dd.version=2.5.17 dd.trace_id=7110975754844687674 dd.span_id=7518426836986654206] Processing by ArticlesController#index as */*
2295
- # [dd.env=production dd.service=billing-api dd.version=2.5.17 dd.trace_id=7110975754844687674 dd.span_id=7518426836986654206] Article Load (0.5ms) SELECT "articles".* FROM "articles"
2296
- # [dd.env=production dd.service=billing-api dd.version=2.5.17 dd.trace_id=7110975754844687674 dd.span_id=7518426836986654206] Completed 200 OK in 7ms (Views: 5.5ms | ActiveRecord: 0.5ms)
2297
- ```
2397
+ For Rails applications using the default logger (`ActiveSupport::TaggedLogging`), `lograge` or `semantic_logger`, trace correlation injection is enabled by default.
2398
+
2399
+ It can be disabled by setting the environment variable `DD_LOGS_INJECTION=false`.
2298
2400
 
2299
2401
  #### For logging in Ruby applications
2300
2402
 
2301
- To add correlation IDs to your logger, add a log formatter which retrieves the correlation IDs with `Datadog.tracer.active_correlation`, then add them to the message.
2403
+ To add correlation IDs to your logger, add a log formatter which retrieves the correlation IDs with `Datadog::Tracing.correlation`, then add them to the message.
2302
2404
 
2303
2405
  To properly correlate with Datadog logging, be sure the following is present in the log message, in order as they appear:
2304
2406
 
2305
- - `dd.env=<ENV>`: Where `<ENV>` is equal to `Datadog.tracer.active_correlation.env`. Omit if no environment is configured.
2306
- - `dd.service=<SERVICE>`: Where `<SERVICE>` is equal to `Datadog.tracer.active_correlation.service`. Omit if no default service name is configured.
2307
- - `dd.version=<VERSION>`: Where `<VERSION>` is equal to `Datadog.tracer.active_correlation.version`. Omit if no application version is configured.
2308
- - `dd.trace_id=<TRACE_ID>`: Where `<TRACE_ID>` is equal to `Datadog.tracer.active_correlation.trace_id` or `0` if no trace is active during logging.
2309
- - `dd.span_id=<SPAN_ID>`: Where `<SPAN_ID>` is equal to `Datadog.tracer.active_correlation.span_id` or `0` if no trace is active during logging.
2407
+ - `dd.env=<ENV>`: Where `<ENV>` is equal to `Datadog::Tracing.correlation.env`. Omit if no environment is configured.
2408
+ - `dd.service=<SERVICE>`: Where `<SERVICE>` is equal to `Datadog::Tracing.correlation.service`. Omit if no default service name is configured.
2409
+ - `dd.version=<VERSION>`: Where `<VERSION>` is equal to `Datadog::Tracing.correlation.version`. Omit if no application version is configured.
2410
+ - `dd.trace_id=<TRACE_ID>`: Where `<TRACE_ID>` is equal to `Datadog::Tracing.correlation.trace_id` or `0` if no trace is active during logging.
2411
+ - `dd.span_id=<SPAN_ID>`: Where `<SPAN_ID>` is equal to `Datadog::Tracing.correlation.span_id` or `0` if no trace is active during logging.
2310
2412
 
2311
- By default, `Datadog::Correlation::Identifier#to_s` will return `dd.env=<ENV> dd.service=<SERVICE> dd.version=<VERSION> dd.trace_id=<TRACE_ID> dd.span_id=<SPAN_ID>`.
2413
+ `Datadog::Tracing.log_correlation` will return `dd.env=<ENV> dd.service=<SERVICE> dd.version=<VERSION> dd.trace_id=<TRACE_ID> dd.span_id=<SPAN_ID>`.
2312
2414
 
2313
- If a trace is not active and the application environment & version is not configured, it will return `dd.trace_id=0 dd.span_id=0 dd.env= dd.version=`.
2415
+ If a trace is not active and the application environment & version is not configured, it will return `dd.env= dd.service= dd.version= dd.trace_id=0 dd.span_id=0`.
2314
2416
 
2315
2417
  An example of this in practice:
2316
2418
 
@@ -2325,7 +2427,7 @@ ENV['DD_VERSION'] = '2.5.17'
2325
2427
  logger = Logger.new(STDOUT)
2326
2428
  logger.progname = 'my_app'
2327
2429
  logger.formatter = proc do |severity, datetime, progname, msg|
2328
- "[#{datetime}][#{progname}][#{severity}][#{Datadog.tracer.active_correlation}] #{msg}\n"
2430
+ "[#{datetime}][#{progname}][#{severity}][#{Datadog::Tracing.log_correlation}] #{msg}\n"
2329
2431
  end
2330
2432
 
2331
2433
  # When no trace is active
@@ -2333,15 +2435,34 @@ logger.warn('This is an untraced operation.')
2333
2435
  # [2019-01-16 18:38:41 +0000][my_app][WARN][dd.env=production dd.service=billing-api dd.version=2.5.17 dd.trace_id=0 dd.span_id=0] This is an untraced operation.
2334
2436
 
2335
2437
  # When a trace is active
2336
- Datadog.tracer.trace('my.operation') { logger.warn('This is a traced operation.') }
2438
+ Datadog::Tracing.trace('my.operation') { logger.warn('This is a traced operation.') }
2337
2439
  # [2019-01-16 18:38:41 +0000][my_app][WARN][dd.env=production dd.service=billing-api dd.version=2.5.17 dd.trace_id=8545847825299552251 dd.span_id=3711755234730770098] This is a traced operation.
2338
2440
  ```
2339
2441
 
2340
2442
  ### Configuring the transport layer
2341
2443
 
2342
- By default, the tracer submits trace data using `Net::HTTP` to `127.0.0.1:8126`, the default location for the Datadog trace agent process. However, the tracer can be configured to send its trace data to alternative destinations, or by alternative protocols.
2444
+ By default, `ddtrace` will connect to the agent using the first available settings in the listed priority:
2445
+
2446
+ 1. Via any explicitly provided configuration settings (hostname/port/transport)
2447
+ 2. Via Unix Domain Socket (UDS) located at `/var/run/datadog/apm.socket`
2448
+ 3. Via HTTP over TCP to `127.0.0.1:8126`
2343
2449
 
2344
- Some basic settings, such as hostname and port, can be configured using [tracer settings](#tracer-settings).
2450
+ However, the tracer can be configured to send its trace data to alternative destinations, or by alternative protocols.
2451
+
2452
+ #### Changing default agent hostname and port
2453
+
2454
+ To change the agent host or port, provide `DD_AGENT_HOST` and `DD_TRACE_AGENT_PORT`.
2455
+
2456
+ OR within a `Datadog.configure` block, provide the following settings:
2457
+
2458
+ ```ruby
2459
+ Datadog.configure do |c|
2460
+ c.agent.host = '127.0.0.1'
2461
+ c.agent.port = 8126
2462
+ end
2463
+ ```
2464
+
2465
+ See [Additional Configuration](#additional-configuration) for more details.
2345
2466
 
2346
2467
  #### Using the Net::HTTP adapter
2347
2468
 
@@ -2349,14 +2470,14 @@ The `Net` adapter submits traces using `Net::HTTP` over TCP. It is the default t
2349
2470
 
2350
2471
  ```ruby
2351
2472
  Datadog.configure do |c|
2352
- c.tracer.transport_options = proc { |t|
2473
+ c.tracing.transport_options = proc { |t|
2353
2474
  # Hostname, port, and additional options. :timeout is in seconds.
2354
2475
  t.adapter :net_http, '127.0.0.1', 8126, { timeout: 1 }
2355
2476
  }
2356
2477
  end
2357
2478
  ```
2358
2479
 
2359
- #### Using the Unix socket adapter
2480
+ #### Using the Unix Domain Socket (UDS) adapter
2360
2481
 
2361
2482
  The `UnixSocket` adapter submits traces using `Net::HTTP` over Unix socket.
2362
2483
 
@@ -2364,8 +2485,8 @@ To use, first configure your trace agent to listen by Unix socket, then configur
2364
2485
 
2365
2486
  ```ruby
2366
2487
  Datadog.configure do |c|
2367
- c.tracer.transport_options = proc { |t|
2368
- # Provide filepath to trace agent Unix socket
2488
+ c.tracing.transport_options = proc { |t|
2489
+ # Provide local path to trace agent Unix socket
2369
2490
  t.adapter :unix, '/tmp/ddagent/trace.sock'
2370
2491
  }
2371
2492
  end
@@ -2377,7 +2498,7 @@ The `Test` adapter is a no-op transport that can optionally buffer requests. For
2377
2498
 
2378
2499
  ```ruby
2379
2500
  Datadog.configure do |c|
2380
- c.tracer.transport_options = proc { |t|
2501
+ c.tracing.transport_options = proc { |t|
2381
2502
  # Set transport to no-op mode. Does not retain traces.
2382
2503
  t.adapter :test
2383
2504
 
@@ -2394,7 +2515,7 @@ Custom adapters can be configured with:
2394
2515
 
2395
2516
  ```ruby
2396
2517
  Datadog.configure do |c|
2397
- c.tracer.transport_options = proc { |t|
2518
+ c.tracing.transport_options = proc { |t|
2398
2519
  # Initialize and pass an instance of the adapter
2399
2520
  custom_adapter = CustomAdapter.new
2400
2521
  t.adapter custom_adapter
@@ -2402,6 +2523,23 @@ Datadog.configure do |c|
2402
2523
  end
2403
2524
  ```
2404
2525
 
2526
+ ### Setting the time provider
2527
+
2528
+ By default, tracing uses a monotonic clock to measure the duration of spans, and timestamps (`->{ Time.now }`) for the start and end time.
2529
+
2530
+ When testing, it might be helpful to use a different time provider.
2531
+
2532
+ To change the function that provides timestamps, configure the following:
2533
+
2534
+ ```ruby
2535
+ Datadog.configure do |c|
2536
+ # For Timecop, for example, `->{ Time.now_without_mock_time }` allows the tracer to use the real wall time.
2537
+ c.time_now_provider = -> { Time.now_without_mock_time }
2538
+ end
2539
+ ```
2540
+
2541
+ Span duration calculation will still use the system monotonic clock when available, thus not being affected by this setting.
2542
+
2405
2543
  ### Metrics
2406
2544
 
2407
2545
  The tracer and its integrations can produce some additional metrics that can provide useful insight into the performance of your application. These metrics are collected with `dogstatsd-ruby`, and can be sent to the same Datadog agent to which you send your traces.
@@ -2409,7 +2547,7 @@ The tracer and its integrations can produce some additional metrics that can pro
2409
2547
  To configure your application for metrics collection:
2410
2548
 
2411
2549
  1. [Configure your Datadog agent for StatsD](https://docs.datadoghq.com/developers/dogstatsd/#setup)
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))
2550
+ 2. Add `gem 'dogstatsd-ruby', '~> 5.3'` to your Gemfile
2413
2551
 
2414
2552
  #### For application runtime
2415
2553
 
@@ -2438,11 +2576,13 @@ See the [Dogstatsd documentation](https://www.rubydoc.info/github/DataDog/dogsta
2438
2576
 
2439
2577
  The stats are VM specific and will include:
2440
2578
 
2441
- | Name | Type | Description |
2442
- | -------------------------- | ------- | -------------------------------------------------------- |
2443
- | `runtime.ruby.class_count` | `gauge` | Number of classes in memory space. |
2444
- | `runtime.ruby.thread_count` | `gauge` | Number of threads. |
2445
- | `runtime.ruby.gc.*`. | `gauge` | Garbage collection statistics: collected from `GC.stat`. |
2579
+ | Name | Type | Description | Available on |
2580
+ | -------------------------- | ------- | -------------------------------------------------------- | ------------ |
2581
+ | `runtime.ruby.class_count` | `gauge` | Number of classes in memory space. | CRuby |
2582
+ | `runtime.ruby.gc.*` | `gauge` | Garbage collection statistics: collected from `GC.stat`. | All runtimes |
2583
+ | `runtime.ruby.thread_count` | `gauge` | Number of threads. | All runtimes |
2584
+ | `runtime.ruby.global_constant_state` | `gauge` | Global constant cache generation. | CRuby |
2585
+ | `runtime.ruby.global_method_state` | `gauge` | [Global method cache generation.](https://tenderlovemaking.com/2015/12/23/inline-caching-in-mri.html) | [CRuby < 3.0.0](https://docs.ruby-lang.org/en/3.0.0/NEWS_md.html#label-Implementation+improvements) |
2446
2586
 
2447
2587
  In addition, all metrics include the following tags:
2448
2588
 
@@ -2453,7 +2593,7 @@ In addition, all metrics include the following tags:
2453
2593
 
2454
2594
  ### OpenTracing
2455
2595
 
2456
- For setting up Datadog with OpenTracing, see out [Quickstart for OpenTracing](#quickstart-for-opentracing) section for details.
2596
+ For setting up Datadog with OpenTracing, see our [Configuring OpenTracing](#configuring-opentracing) section for details.
2457
2597
 
2458
2598
  **Configuring Datadog tracer settings**
2459
2599
 
@@ -2461,10 +2601,10 @@ The underlying Datadog tracer can be configured by passing options (which match
2461
2601
 
2462
2602
  ```ruby
2463
2603
  # Where `options` is a Hash of options provided to Datadog::Tracer
2464
- OpenTracing.global_tracer = Datadog::OpenTracer::Tracer.new(options)
2604
+ OpenTracing.global_tracer = Datadog::OpenTracer::Tracer.new(**options)
2465
2605
  ```
2466
2606
 
2467
- It can also be configured by using `Datadog.configure` described in the [Tracer settings](#tracer-settings) section.
2607
+ It can also be configured by using `Datadog.configure` described in the [Additional Configuration](#additional-configuration) section.
2468
2608
 
2469
2609
  **Activating and configuring integrations**
2470
2610
 
@@ -2488,10 +2628,44 @@ However, additional instrumentation provided by Datadog can be activated alongsi
2488
2628
 
2489
2629
  **Setup**
2490
2630
 
2491
- To get started with profiling, follow the [Profiler Getting Started Guide](https://docs.datadoghq.com/tracing/profiler/getting_started/?code-lang=ruby).
2631
+ To get started with profiling, follow the [Enabling the Ruby Profiler](https://docs.datadoghq.com/tracing/profiler/enabling/ruby/) guide.
2632
+
2633
+ #### Troubleshooting
2634
+
2635
+ If you run into issues with profiling, please check the [Profiler Troubleshooting Guide](https://docs.datadoghq.com/tracing/profiler/profiler_troubleshooting/?code-lang=ruby).
2492
2636
 
2493
2637
  #### Profiling Resque jobs
2494
2638
 
2495
2639
  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
2640
 
2497
2641
  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.
2642
+
2643
+ ## Known issues and suggested configurations
2644
+
2645
+ ### Payload too large
2646
+
2647
+ By default, Datadog limits the size of trace payloads to prevent memory overhead within instrumented applications. As a result, traces containing thousands of operations may not be sent to Datadog.
2648
+
2649
+ If traces are missing, enable [debug mode](#debugging-and-diagnostics) to check if messages containing `"Dropping trace. Payload too large"` are logged.
2650
+
2651
+ Since debug mode is verbose, **Datadog does not recommend leaving this enabled or enabling this in production.** Disable it after confirming. You can inspect the [Datadog Agent logs](https://docs.datadoghq.com/agent/guide/agent-log-files/) for similar messages.
2652
+
2653
+ If you have confirmed that traces are dropped due to large payloads, then enable the [partial_flush](#additional-configuration) setting to break down large traces into smaller chunks.
2654
+
2655
+ ### Stack level too deep
2656
+
2657
+ Datadog tracing collects trace data by adding instrumentation into other common libraries (e.g. Rails, Rack, etc.) Some libraries provide APIs to add this instrumentation, but some do not. In order to add instrumentation into libraries lacking an instrumentation API, Datadog uses a technique called "monkey-patching" to modify the code of that library.
2658
+
2659
+ In Ruby version 1.9.3 and earlier, "monkey-patching" often involved the use of [`alias_method`](https://ruby-doc.org/core-3.0.0/Module.html#method-i-alias_method), also known as *method rewriting*, to destructively replace existing Ruby methods. However, this practice would often create conflicts & errors if two libraries attempted to "rewrite" the same method. (e.g. two different APM packages trying to instrument the same method.)
2660
+
2661
+ In Ruby 2.0, the [`Module#prepend`](https://ruby-doc.org/core-3.0.0/Module.html#method-i-prepend) feature was introduced. This feature avoids destructive method rewriting and allows multiple "monkey patches" on the same method. Consequently, it has become the safest, preferred means to "monkey patch" code.
2662
+
2663
+ Datadog instrumentation almost exclusively uses the `Module#prepend` feature to add instrumentation non-destructively. However, some other libraries (typically those supporting Ruby < 2.0) still use `alias_method` which can create conflicts with Datadog instrumentation, often resulting in `SystemStackError` or `stack level too deep` errors.
2664
+
2665
+ As the implementation of `alias_method` exists within those libraries, Datadog generally cannot fix them. However, some libraries have known workarounds:
2666
+
2667
+ * `rack-mini-profiler`: [Net::HTTP stack level too deep errors](https://github.com/MiniProfiler/rack-mini-profiler#nethttp-stack-level-too-deep-errors).
2668
+
2669
+ For libraries without a known workaround, consider removing the library using `alias` or `Module#alias_method` or separating libraries into different environments for testing.
2670
+
2671
+ For any further questions or to report an occurence of this issue, please [reach out to Datadog support](https://docs.datadoghq.com/help)