ddtrace 0.48.0 → 0.49.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +209 -2
- data/.dockerignore +0 -1
- data/.gitignore +2 -1
- data/.rubocop.yml +13 -1
- data/Appraisals +10 -0
- data/CHANGELOG.md +32 -0
- data/Rakefile +10 -0
- data/benchmarks/profiler_sample_loop.rb +69 -0
- data/ddtrace.gemspec +1 -1
- data/docker-compose.yml +0 -24
- data/docs/GettingStarted.md +1 -1
- data/gemfiles/jruby_9.2.0.0_contrib.gemfile +79 -0
- data/gemfiles/jruby_9.2.0.0_contrib.gemfile.lock +1518 -0
- data/gemfiles/jruby_9.2.0.0_contrib_old.gemfile +35 -0
- data/gemfiles/jruby_9.2.0.0_contrib_old.gemfile.lock +157 -0
- data/gemfiles/jruby_9.2.0.0_core_old.gemfile +34 -0
- data/gemfiles/jruby_9.2.0.0_core_old.gemfile.lock +153 -0
- data/gemfiles/jruby_9.2.0.0_cucumber3.gemfile +35 -0
- data/gemfiles/jruby_9.2.0.0_cucumber3.gemfile.lock +174 -0
- data/gemfiles/jruby_9.2.0.0_cucumber4.gemfile +35 -0
- data/gemfiles/jruby_9.2.0.0_cucumber4.gemfile.lock +206 -0
- data/gemfiles/jruby_9.2.0.0_cucumber5.gemfile +35 -0
- data/gemfiles/jruby_9.2.0.0_cucumber5.gemfile.lock +206 -0
- data/gemfiles/jruby_9.2.0.0_rails5_mysql2.gemfile +40 -0
- data/gemfiles/jruby_9.2.0.0_rails5_mysql2.gemfile.lock +271 -0
- data/gemfiles/jruby_9.2.0.0_rails5_postgres.gemfile +40 -0
- data/gemfiles/jruby_9.2.0.0_rails5_postgres.gemfile.lock +271 -0
- data/gemfiles/jruby_9.2.0.0_rails5_postgres_redis.gemfile +41 -0
- data/gemfiles/jruby_9.2.0.0_rails5_postgres_redis.gemfile.lock +273 -0
- data/gemfiles/jruby_9.2.0.0_rails5_postgres_redis_activesupport.gemfile +41 -0
- data/gemfiles/jruby_9.2.0.0_rails5_postgres_redis_activesupport.gemfile.lock +273 -0
- data/gemfiles/jruby_9.2.0.0_rails5_postgres_sidekiq.gemfile +42 -0
- data/gemfiles/jruby_9.2.0.0_rails5_postgres_sidekiq.gemfile.lock +279 -0
- data/gemfiles/jruby_9.2.0.0_rails61_mysql2.gemfile +40 -0
- data/gemfiles/jruby_9.2.0.0_rails61_mysql2.gemfile.lock +290 -0
- data/gemfiles/jruby_9.2.0.0_rails61_postgres.gemfile +40 -0
- data/gemfiles/jruby_9.2.0.0_rails61_postgres.gemfile.lock +290 -0
- data/gemfiles/jruby_9.2.0.0_rails61_postgres_redis.gemfile +41 -0
- data/gemfiles/jruby_9.2.0.0_rails61_postgres_redis.gemfile.lock +292 -0
- data/gemfiles/jruby_9.2.0.0_rails61_postgres_sidekiq.gemfile +41 -0
- data/gemfiles/jruby_9.2.0.0_rails61_postgres_sidekiq.gemfile.lock +297 -0
- data/gemfiles/jruby_9.2.0.0_rails6_mysql2.gemfile +40 -0
- data/gemfiles/jruby_9.2.0.0_rails6_mysql2.gemfile.lock +287 -0
- data/gemfiles/jruby_9.2.0.0_rails6_postgres.gemfile +40 -0
- data/gemfiles/jruby_9.2.0.0_rails6_postgres.gemfile.lock +287 -0
- data/gemfiles/jruby_9.2.0.0_rails6_postgres_redis.gemfile +41 -0
- data/gemfiles/jruby_9.2.0.0_rails6_postgres_redis.gemfile.lock +289 -0
- data/gemfiles/jruby_9.2.0.0_rails6_postgres_redis_activesupport.gemfile +41 -0
- data/gemfiles/jruby_9.2.0.0_rails6_postgres_redis_activesupport.gemfile.lock +289 -0
- data/gemfiles/jruby_9.2.0.0_rails6_postgres_sidekiq.gemfile +42 -0
- data/gemfiles/jruby_9.2.0.0_rails6_postgres_sidekiq.gemfile.lock +295 -0
- data/gemfiles/jruby_9.2.0.0_resque2_redis3.gemfile +36 -0
- data/gemfiles/jruby_9.2.0.0_resque2_redis3.gemfile.lock +180 -0
- data/gemfiles/jruby_9.2.0.0_resque2_redis4.gemfile +36 -0
- data/gemfiles/jruby_9.2.0.0_resque2_redis4.gemfile.lock +180 -0
- data/gemfiles/jruby_9.2.11.1_contrib.gemfile +79 -0
- data/gemfiles/jruby_9.2.11.1_contrib.gemfile.lock +1518 -0
- data/gemfiles/jruby_9.2.11.1_contrib_old.gemfile +35 -0
- data/gemfiles/jruby_9.2.11.1_contrib_old.gemfile.lock +157 -0
- data/gemfiles/jruby_9.2.11.1_core_old.gemfile +34 -0
- data/gemfiles/jruby_9.2.11.1_core_old.gemfile.lock +153 -0
- data/gemfiles/jruby_9.2.11.1_cucumber3.gemfile +35 -0
- data/gemfiles/jruby_9.2.11.1_cucumber3.gemfile.lock +174 -0
- data/gemfiles/jruby_9.2.11.1_cucumber4.gemfile +35 -0
- data/gemfiles/jruby_9.2.11.1_cucumber4.gemfile.lock +206 -0
- data/gemfiles/jruby_9.2.11.1_cucumber5.gemfile +35 -0
- data/gemfiles/jruby_9.2.11.1_cucumber5.gemfile.lock +206 -0
- data/gemfiles/jruby_9.2.11.1_rails5_mysql2.gemfile +40 -0
- data/gemfiles/jruby_9.2.11.1_rails5_mysql2.gemfile.lock +271 -0
- data/gemfiles/jruby_9.2.11.1_rails5_postgres.gemfile +40 -0
- data/gemfiles/jruby_9.2.11.1_rails5_postgres.gemfile.lock +271 -0
- data/gemfiles/jruby_9.2.11.1_rails5_postgres_redis.gemfile +41 -0
- data/gemfiles/jruby_9.2.11.1_rails5_postgres_redis.gemfile.lock +273 -0
- data/gemfiles/jruby_9.2.11.1_rails5_postgres_redis_activesupport.gemfile +41 -0
- data/gemfiles/jruby_9.2.11.1_rails5_postgres_redis_activesupport.gemfile.lock +273 -0
- data/gemfiles/jruby_9.2.11.1_rails5_postgres_sidekiq.gemfile +42 -0
- data/gemfiles/jruby_9.2.11.1_rails5_postgres_sidekiq.gemfile.lock +279 -0
- data/gemfiles/jruby_9.2.11.1_rails61_mysql2.gemfile +40 -0
- data/gemfiles/jruby_9.2.11.1_rails61_mysql2.gemfile.lock +290 -0
- data/gemfiles/jruby_9.2.11.1_rails61_postgres.gemfile +40 -0
- data/gemfiles/jruby_9.2.11.1_rails61_postgres.gemfile.lock +290 -0
- data/gemfiles/jruby_9.2.11.1_rails61_postgres_redis.gemfile +41 -0
- data/gemfiles/jruby_9.2.11.1_rails61_postgres_redis.gemfile.lock +292 -0
- data/gemfiles/jruby_9.2.11.1_rails61_postgres_sidekiq.gemfile +41 -0
- data/gemfiles/jruby_9.2.11.1_rails61_postgres_sidekiq.gemfile.lock +297 -0
- data/gemfiles/jruby_9.2.11.1_rails6_mysql2.gemfile +40 -0
- data/gemfiles/jruby_9.2.11.1_rails6_mysql2.gemfile.lock +287 -0
- data/gemfiles/jruby_9.2.11.1_rails6_postgres.gemfile +40 -0
- data/gemfiles/jruby_9.2.11.1_rails6_postgres.gemfile.lock +287 -0
- data/gemfiles/jruby_9.2.11.1_rails6_postgres_redis.gemfile +41 -0
- data/gemfiles/jruby_9.2.11.1_rails6_postgres_redis.gemfile.lock +289 -0
- data/gemfiles/jruby_9.2.11.1_rails6_postgres_redis_activesupport.gemfile +41 -0
- data/gemfiles/jruby_9.2.11.1_rails6_postgres_redis_activesupport.gemfile.lock +289 -0
- data/gemfiles/jruby_9.2.11.1_rails6_postgres_sidekiq.gemfile +42 -0
- data/gemfiles/jruby_9.2.11.1_rails6_postgres_sidekiq.gemfile.lock +295 -0
- data/gemfiles/jruby_9.2.11.1_resque2_redis3.gemfile +36 -0
- data/gemfiles/jruby_9.2.11.1_resque2_redis3.gemfile.lock +180 -0
- data/gemfiles/jruby_9.2.11.1_resque2_redis4.gemfile +36 -0
- data/gemfiles/jruby_9.2.11.1_resque2_redis4.gemfile.lock +180 -0
- data/gemfiles/ruby_2.0.0_contrib_old.gemfile +64 -0
- data/gemfiles/ruby_2.0.0_contrib_old.gemfile.lock +290 -0
- data/gemfiles/ruby_2.0.0_core_old.gemfile +33 -0
- data/gemfiles/ruby_2.0.0_core_old.gemfile.lock +118 -0
- data/gemfiles/ruby_2.0.0_rails30_postgres.gemfile +39 -0
- data/gemfiles/ruby_2.0.0_rails30_postgres.gemfile.lock +196 -0
- data/gemfiles/ruby_2.0.0_rails30_postgres_sidekiq.gemfile +40 -0
- data/gemfiles/ruby_2.0.0_rails30_postgres_sidekiq.gemfile.lock +205 -0
- data/gemfiles/ruby_2.0.0_rails32_mysql2.gemfile +43 -0
- data/gemfiles/ruby_2.0.0_rails32_mysql2.gemfile.lock +217 -0
- data/gemfiles/ruby_2.0.0_rails32_postgres.gemfile +39 -0
- data/gemfiles/ruby_2.0.0_rails32_postgres.gemfile.lock +204 -0
- data/gemfiles/ruby_2.0.0_rails32_postgres_redis.gemfile +41 -0
- data/gemfiles/ruby_2.0.0_rails32_postgres_redis.gemfile.lock +223 -0
- data/gemfiles/ruby_2.0.0_rails32_postgres_sidekiq.gemfile +40 -0
- data/gemfiles/ruby_2.0.0_rails32_postgres_sidekiq.gemfile.lock +213 -0
- data/gemfiles/ruby_2.1.10_contrib_old.gemfile +66 -0
- data/gemfiles/ruby_2.1.10_contrib_old.gemfile.lock +305 -0
- data/gemfiles/ruby_2.1.10_core_old.gemfile +33 -0
- data/gemfiles/ruby_2.1.10_core_old.gemfile.lock +118 -0
- data/gemfiles/ruby_2.1.10_rails30_postgres.gemfile +39 -0
- data/gemfiles/ruby_2.1.10_rails30_postgres.gemfile.lock +196 -0
- data/gemfiles/ruby_2.1.10_rails30_postgres_sidekiq.gemfile +40 -0
- data/gemfiles/ruby_2.1.10_rails30_postgres_sidekiq.gemfile.lock +205 -0
- data/gemfiles/ruby_2.1.10_rails32_mysql2.gemfile +42 -0
- data/gemfiles/ruby_2.1.10_rails32_mysql2.gemfile.lock +215 -0
- data/gemfiles/ruby_2.1.10_rails32_postgres.gemfile +39 -0
- data/gemfiles/ruby_2.1.10_rails32_postgres.gemfile.lock +204 -0
- data/gemfiles/ruby_2.1.10_rails32_postgres_redis.gemfile +41 -0
- data/gemfiles/ruby_2.1.10_rails32_postgres_redis.gemfile.lock +223 -0
- data/gemfiles/ruby_2.1.10_rails32_postgres_sidekiq.gemfile +40 -0
- data/gemfiles/ruby_2.1.10_rails32_postgres_sidekiq.gemfile.lock +213 -0
- data/gemfiles/ruby_2.1.10_rails4_mysql2.gemfile +38 -0
- data/gemfiles/ruby_2.1.10_rails4_mysql2.gemfile.lock +218 -0
- data/gemfiles/ruby_2.1.10_rails4_postgres.gemfile +38 -0
- data/gemfiles/ruby_2.1.10_rails4_postgres.gemfile.lock +218 -0
- data/gemfiles/ruby_2.1.10_rails4_postgres_redis.gemfile +40 -0
- data/gemfiles/ruby_2.1.10_rails4_postgres_redis.gemfile.lock +237 -0
- data/gemfiles/ruby_2.2.10_contrib.gemfile +73 -0
- data/gemfiles/ruby_2.2.10_contrib.gemfile.lock +1450 -0
- data/gemfiles/ruby_2.2.10_core_old.gemfile +33 -0
- data/gemfiles/ruby_2.2.10_core_old.gemfile.lock +118 -0
- data/gemfiles/ruby_2.2.10_rails30_postgres.gemfile +39 -0
- data/gemfiles/ruby_2.2.10_rails30_postgres.gemfile.lock +196 -0
- data/gemfiles/ruby_2.2.10_rails30_postgres_sidekiq.gemfile +40 -0
- data/gemfiles/ruby_2.2.10_rails30_postgres_sidekiq.gemfile.lock +205 -0
- data/gemfiles/ruby_2.2.10_rails32_mysql2.gemfile +41 -0
- data/gemfiles/ruby_2.2.10_rails32_mysql2.gemfile.lock +212 -0
- data/gemfiles/ruby_2.2.10_rails32_postgres.gemfile +39 -0
- data/gemfiles/ruby_2.2.10_rails32_postgres.gemfile.lock +204 -0
- data/gemfiles/ruby_2.2.10_rails32_postgres_redis.gemfile +41 -0
- data/gemfiles/ruby_2.2.10_rails32_postgres_redis.gemfile.lock +223 -0
- data/gemfiles/ruby_2.2.10_rails32_postgres_sidekiq.gemfile +40 -0
- data/gemfiles/ruby_2.2.10_rails32_postgres_sidekiq.gemfile.lock +213 -0
- data/gemfiles/ruby_2.2.10_rails4_mysql2.gemfile +38 -0
- data/gemfiles/ruby_2.2.10_rails4_mysql2.gemfile.lock +218 -0
- data/gemfiles/ruby_2.2.10_rails4_postgres.gemfile +38 -0
- data/gemfiles/ruby_2.2.10_rails4_postgres.gemfile.lock +218 -0
- data/gemfiles/ruby_2.2.10_rails4_postgres_redis.gemfile +40 -0
- data/gemfiles/ruby_2.2.10_rails4_postgres_redis.gemfile.lock +237 -0
- data/gemfiles/ruby_2.2.10_rails4_postgres_sidekiq.gemfile +40 -0
- data/gemfiles/ruby_2.2.10_rails4_postgres_sidekiq.gemfile.lock +229 -0
- data/gemfiles/ruby_2.2.10_rails5_mysql2.gemfile +38 -0
- data/gemfiles/ruby_2.2.10_rails5_mysql2.gemfile.lock +234 -0
- data/gemfiles/ruby_2.2.10_rails5_postgres.gemfile +38 -0
- data/gemfiles/ruby_2.2.10_rails5_postgres.gemfile.lock +234 -0
- data/gemfiles/ruby_2.2.10_rails5_postgres_redis.gemfile +39 -0
- data/gemfiles/ruby_2.2.10_rails5_postgres_redis.gemfile.lock +236 -0
- data/gemfiles/ruby_2.2.10_rails5_postgres_redis_activesupport.gemfile +39 -0
- data/gemfiles/ruby_2.2.10_rails5_postgres_redis_activesupport.gemfile.lock +236 -0
- data/gemfiles/ruby_2.2.10_rails5_postgres_sidekiq.gemfile +40 -0
- data/gemfiles/ruby_2.2.10_rails5_postgres_sidekiq.gemfile.lock +245 -0
- data/gemfiles/ruby_2.3.8_contrib.gemfile +73 -0
- data/gemfiles/ruby_2.3.8_contrib.gemfile.lock +1459 -0
- data/gemfiles/ruby_2.3.8_contrib_old.gemfile +34 -0
- data/gemfiles/ruby_2.3.8_contrib_old.gemfile.lock +127 -0
- data/gemfiles/ruby_2.3.8_core_old.gemfile +33 -0
- data/gemfiles/ruby_2.3.8_core_old.gemfile.lock +123 -0
- data/gemfiles/ruby_2.3.8_cucumber3.gemfile +34 -0
- data/gemfiles/ruby_2.3.8_cucumber3.gemfile.lock +144 -0
- data/gemfiles/ruby_2.3.8_cucumber4.gemfile +34 -0
- data/gemfiles/ruby_2.3.8_cucumber4.gemfile.lock +174 -0
- data/gemfiles/ruby_2.3.8_rails30_postgres.gemfile +39 -0
- data/gemfiles/ruby_2.3.8_rails30_postgres.gemfile.lock +201 -0
- data/gemfiles/ruby_2.3.8_rails30_postgres_sidekiq.gemfile +40 -0
- data/gemfiles/ruby_2.3.8_rails30_postgres_sidekiq.gemfile.lock +210 -0
- data/gemfiles/ruby_2.3.8_rails32_mysql2.gemfile +41 -0
- data/gemfiles/ruby_2.3.8_rails32_mysql2.gemfile.lock +217 -0
- data/gemfiles/ruby_2.3.8_rails32_postgres.gemfile +39 -0
- data/gemfiles/ruby_2.3.8_rails32_postgres.gemfile.lock +209 -0
- data/gemfiles/ruby_2.3.8_rails32_postgres_redis.gemfile +41 -0
- data/gemfiles/ruby_2.3.8_rails32_postgres_redis.gemfile.lock +228 -0
- data/gemfiles/ruby_2.3.8_rails32_postgres_sidekiq.gemfile +40 -0
- data/gemfiles/ruby_2.3.8_rails32_postgres_sidekiq.gemfile.lock +218 -0
- data/gemfiles/ruby_2.3.8_rails4_mysql2.gemfile +38 -0
- data/gemfiles/ruby_2.3.8_rails4_mysql2.gemfile.lock +223 -0
- data/gemfiles/ruby_2.3.8_rails4_postgres.gemfile +38 -0
- data/gemfiles/ruby_2.3.8_rails4_postgres.gemfile.lock +223 -0
- data/gemfiles/ruby_2.3.8_rails4_postgres_redis.gemfile +40 -0
- data/gemfiles/ruby_2.3.8_rails4_postgres_redis.gemfile.lock +242 -0
- data/gemfiles/ruby_2.3.8_rails4_postgres_sidekiq.gemfile +40 -0
- data/gemfiles/ruby_2.3.8_rails4_postgres_sidekiq.gemfile.lock +234 -0
- data/gemfiles/ruby_2.3.8_rails5_mysql2.gemfile +37 -0
- data/gemfiles/ruby_2.3.8_rails5_mysql2.gemfile.lock +234 -0
- data/gemfiles/ruby_2.3.8_rails5_postgres.gemfile +37 -0
- data/gemfiles/ruby_2.3.8_rails5_postgres.gemfile.lock +234 -0
- data/gemfiles/ruby_2.3.8_rails5_postgres_redis.gemfile +38 -0
- data/gemfiles/ruby_2.3.8_rails5_postgres_redis.gemfile.lock +236 -0
- data/gemfiles/ruby_2.3.8_rails5_postgres_redis_activesupport.gemfile +38 -0
- data/gemfiles/ruby_2.3.8_rails5_postgres_redis_activesupport.gemfile.lock +236 -0
- data/gemfiles/ruby_2.3.8_rails5_postgres_sidekiq.gemfile +39 -0
- data/gemfiles/ruby_2.3.8_rails5_postgres_sidekiq.gemfile.lock +245 -0
- data/gemfiles/ruby_2.3.8_resque2_redis3.gemfile +35 -0
- data/gemfiles/ruby_2.3.8_resque2_redis3.gemfile.lock +150 -0
- data/gemfiles/ruby_2.3.8_resque2_redis4.gemfile +35 -0
- data/gemfiles/ruby_2.3.8_resque2_redis4.gemfile.lock +150 -0
- data/gemfiles/ruby_2.4.6_contrib.gemfile +78 -0
- data/gemfiles/ruby_2.4.6_contrib.gemfile.lock +1513 -0
- data/gemfiles/ruby_2.4.6_contrib_old.gemfile +38 -0
- data/gemfiles/ruby_2.4.6_contrib_old.gemfile.lock +155 -0
- data/gemfiles/ruby_2.4.6_core_old.gemfile +37 -0
- data/gemfiles/ruby_2.4.6_core_old.gemfile.lock +151 -0
- data/gemfiles/ruby_2.4.6_cucumber3.gemfile +38 -0
- data/gemfiles/ruby_2.4.6_cucumber3.gemfile.lock +172 -0
- data/gemfiles/ruby_2.4.6_cucumber4.gemfile +38 -0
- data/gemfiles/ruby_2.4.6_cucumber4.gemfile.lock +202 -0
- data/gemfiles/ruby_2.4.6_rails5_mysql2.gemfile +41 -0
- data/gemfiles/ruby_2.4.6_rails5_mysql2.gemfile.lock +262 -0
- data/gemfiles/ruby_2.4.6_rails5_postgres.gemfile +41 -0
- data/gemfiles/ruby_2.4.6_rails5_postgres.gemfile.lock +262 -0
- data/gemfiles/ruby_2.4.6_rails5_postgres_redis.gemfile +42 -0
- data/gemfiles/ruby_2.4.6_rails5_postgres_redis.gemfile.lock +264 -0
- data/gemfiles/ruby_2.4.6_rails5_postgres_redis_activesupport.gemfile +42 -0
- data/gemfiles/ruby_2.4.6_rails5_postgres_redis_activesupport.gemfile.lock +264 -0
- data/gemfiles/ruby_2.4.6_rails5_postgres_sidekiq.gemfile +43 -0
- data/gemfiles/ruby_2.4.6_rails5_postgres_sidekiq.gemfile.lock +273 -0
- data/gemfiles/ruby_2.4.6_resque2_redis3.gemfile +39 -0
- data/gemfiles/ruby_2.4.6_resque2_redis3.gemfile.lock +178 -0
- data/gemfiles/ruby_2.4.6_resque2_redis4.gemfile +39 -0
- data/gemfiles/ruby_2.4.6_resque2_redis4.gemfile.lock +178 -0
- data/gemfiles/ruby_2.5.6_contrib.gemfile +83 -0
- data/gemfiles/ruby_2.5.6_contrib.gemfile.lock +1526 -0
- data/gemfiles/ruby_2.5.6_contrib_old.gemfile +39 -0
- data/gemfiles/ruby_2.5.6_contrib_old.gemfile.lock +165 -0
- data/gemfiles/ruby_2.5.6_core_old.gemfile +38 -0
- data/gemfiles/ruby_2.5.6_core_old.gemfile.lock +161 -0
- data/gemfiles/ruby_2.5.6_cucumber3.gemfile +39 -0
- data/gemfiles/ruby_2.5.6_cucumber3.gemfile.lock +182 -0
- data/gemfiles/ruby_2.5.6_cucumber4.gemfile +39 -0
- data/gemfiles/ruby_2.5.6_cucumber4.gemfile.lock +214 -0
- data/gemfiles/ruby_2.5.6_cucumber5.gemfile +39 -0
- data/gemfiles/ruby_2.5.6_cucumber5.gemfile.lock +214 -0
- data/gemfiles/ruby_2.5.6_rails5_mysql2.gemfile +44 -0
- data/gemfiles/ruby_2.5.6_rails5_mysql2.gemfile.lock +276 -0
- data/gemfiles/ruby_2.5.6_rails5_postgres.gemfile +44 -0
- data/gemfiles/ruby_2.5.6_rails5_postgres.gemfile.lock +276 -0
- data/gemfiles/ruby_2.5.6_rails5_postgres_redis.gemfile +45 -0
- data/gemfiles/ruby_2.5.6_rails5_postgres_redis.gemfile.lock +278 -0
- data/gemfiles/ruby_2.5.6_rails5_postgres_redis_activesupport.gemfile +45 -0
- data/gemfiles/ruby_2.5.6_rails5_postgres_redis_activesupport.gemfile.lock +278 -0
- data/gemfiles/ruby_2.5.6_rails5_postgres_sidekiq.gemfile +46 -0
- data/gemfiles/ruby_2.5.6_rails5_postgres_sidekiq.gemfile.lock +284 -0
- data/gemfiles/ruby_2.5.6_rails61_mysql2.gemfile +44 -0
- data/gemfiles/ruby_2.5.6_rails61_mysql2.gemfile.lock +295 -0
- data/gemfiles/ruby_2.5.6_rails61_postgres.gemfile +44 -0
- data/gemfiles/ruby_2.5.6_rails61_postgres.gemfile.lock +295 -0
- data/gemfiles/ruby_2.5.6_rails61_postgres_redis.gemfile +45 -0
- data/gemfiles/ruby_2.5.6_rails61_postgres_redis.gemfile.lock +297 -0
- data/gemfiles/ruby_2.5.6_rails61_postgres_sidekiq.gemfile +45 -0
- data/gemfiles/ruby_2.5.6_rails61_postgres_sidekiq.gemfile.lock +302 -0
- data/gemfiles/ruby_2.5.6_rails6_mysql2.gemfile +44 -0
- data/gemfiles/ruby_2.5.6_rails6_mysql2.gemfile.lock +292 -0
- data/gemfiles/ruby_2.5.6_rails6_postgres.gemfile +44 -0
- data/gemfiles/ruby_2.5.6_rails6_postgres.gemfile.lock +292 -0
- data/gemfiles/ruby_2.5.6_rails6_postgres_redis.gemfile +45 -0
- data/gemfiles/ruby_2.5.6_rails6_postgres_redis.gemfile.lock +294 -0
- data/gemfiles/ruby_2.5.6_rails6_postgres_redis_activesupport.gemfile +45 -0
- data/gemfiles/ruby_2.5.6_rails6_postgres_redis_activesupport.gemfile.lock +294 -0
- data/gemfiles/ruby_2.5.6_rails6_postgres_sidekiq.gemfile +46 -0
- data/gemfiles/ruby_2.5.6_rails6_postgres_sidekiq.gemfile.lock +300 -0
- data/gemfiles/ruby_2.5.6_resque2_redis3.gemfile +40 -0
- data/gemfiles/ruby_2.5.6_resque2_redis3.gemfile.lock +188 -0
- data/gemfiles/ruby_2.5.6_resque2_redis4.gemfile +40 -0
- data/gemfiles/ruby_2.5.6_resque2_redis4.gemfile.lock +188 -0
- data/gemfiles/ruby_2.6.4_contrib.gemfile +79 -0
- data/gemfiles/ruby_2.6.4_contrib.gemfile.lock +1524 -0
- data/gemfiles/ruby_2.6.4_contrib_old.gemfile +39 -0
- data/gemfiles/ruby_2.6.4_contrib_old.gemfile.lock +167 -0
- data/gemfiles/ruby_2.6.4_core_old.gemfile +38 -0
- data/gemfiles/ruby_2.6.4_core_old.gemfile.lock +163 -0
- data/gemfiles/ruby_2.6.4_cucumber3.gemfile +39 -0
- data/gemfiles/ruby_2.6.4_cucumber3.gemfile.lock +184 -0
- data/gemfiles/ruby_2.6.4_cucumber4.gemfile +39 -0
- data/gemfiles/ruby_2.6.4_cucumber4.gemfile.lock +216 -0
- data/gemfiles/ruby_2.6.4_cucumber5.gemfile +39 -0
- data/gemfiles/ruby_2.6.4_cucumber5.gemfile.lock +216 -0
- data/gemfiles/ruby_2.6.4_rails5_mysql2.gemfile +42 -0
- data/gemfiles/ruby_2.6.4_rails5_mysql2.gemfile.lock +276 -0
- data/gemfiles/ruby_2.6.4_rails5_postgres.gemfile +42 -0
- data/gemfiles/ruby_2.6.4_rails5_postgres.gemfile.lock +276 -0
- data/gemfiles/ruby_2.6.4_rails5_postgres_redis.gemfile +43 -0
- data/gemfiles/ruby_2.6.4_rails5_postgres_redis.gemfile.lock +278 -0
- data/gemfiles/ruby_2.6.4_rails5_postgres_redis_activesupport.gemfile +43 -0
- data/gemfiles/ruby_2.6.4_rails5_postgres_redis_activesupport.gemfile.lock +278 -0
- data/gemfiles/ruby_2.6.4_rails5_postgres_sidekiq.gemfile +44 -0
- data/gemfiles/ruby_2.6.4_rails5_postgres_sidekiq.gemfile.lock +284 -0
- data/gemfiles/ruby_2.6.4_rails61_mysql2.gemfile +42 -0
- data/gemfiles/ruby_2.6.4_rails61_mysql2.gemfile.lock +295 -0
- data/gemfiles/ruby_2.6.4_rails61_postgres.gemfile +42 -0
- data/gemfiles/ruby_2.6.4_rails61_postgres.gemfile.lock +295 -0
- data/gemfiles/ruby_2.6.4_rails61_postgres_redis.gemfile +43 -0
- data/gemfiles/ruby_2.6.4_rails61_postgres_redis.gemfile.lock +297 -0
- data/gemfiles/ruby_2.6.4_rails61_postgres_sidekiq.gemfile +43 -0
- data/gemfiles/ruby_2.6.4_rails61_postgres_sidekiq.gemfile.lock +302 -0
- data/gemfiles/ruby_2.6.4_rails6_mysql2.gemfile +42 -0
- data/gemfiles/ruby_2.6.4_rails6_mysql2.gemfile.lock +292 -0
- data/gemfiles/ruby_2.6.4_rails6_postgres.gemfile +42 -0
- data/gemfiles/ruby_2.6.4_rails6_postgres.gemfile.lock +292 -0
- data/gemfiles/ruby_2.6.4_rails6_postgres_redis.gemfile +43 -0
- data/gemfiles/ruby_2.6.4_rails6_postgres_redis.gemfile.lock +294 -0
- data/gemfiles/ruby_2.6.4_rails6_postgres_redis_activesupport.gemfile +43 -0
- data/gemfiles/ruby_2.6.4_rails6_postgres_redis_activesupport.gemfile.lock +294 -0
- data/gemfiles/ruby_2.6.4_rails6_postgres_sidekiq.gemfile +44 -0
- data/gemfiles/ruby_2.6.4_rails6_postgres_sidekiq.gemfile.lock +300 -0
- data/gemfiles/ruby_2.6.4_resque2_redis3.gemfile +40 -0
- data/gemfiles/ruby_2.6.4_resque2_redis3.gemfile.lock +190 -0
- data/gemfiles/ruby_2.6.4_resque2_redis4.gemfile +40 -0
- data/gemfiles/ruby_2.6.4_resque2_redis4.gemfile.lock +190 -0
- data/gemfiles/ruby_2.7.0_contrib.gemfile +78 -0
- data/gemfiles/ruby_2.7.0_contrib.gemfile.lock +1523 -0
- data/gemfiles/ruby_2.7.0_contrib_old.gemfile +39 -0
- data/gemfiles/ruby_2.7.0_contrib_old.gemfile.lock +167 -0
- data/gemfiles/ruby_2.7.0_core_old.gemfile +38 -0
- data/gemfiles/ruby_2.7.0_core_old.gemfile.lock +163 -0
- data/gemfiles/ruby_2.7.0_cucumber3.gemfile +39 -0
- data/gemfiles/ruby_2.7.0_cucumber3.gemfile.lock +184 -0
- data/gemfiles/ruby_2.7.0_cucumber4.gemfile +39 -0
- data/gemfiles/ruby_2.7.0_cucumber4.gemfile.lock +216 -0
- data/gemfiles/ruby_2.7.0_cucumber5.gemfile +39 -0
- data/gemfiles/ruby_2.7.0_cucumber5.gemfile.lock +216 -0
- data/gemfiles/ruby_2.7.0_rails5_mysql2.gemfile +42 -0
- data/gemfiles/ruby_2.7.0_rails5_mysql2.gemfile.lock +276 -0
- data/gemfiles/ruby_2.7.0_rails5_postgres.gemfile +42 -0
- data/gemfiles/ruby_2.7.0_rails5_postgres.gemfile.lock +276 -0
- data/gemfiles/ruby_2.7.0_rails5_postgres_redis.gemfile +44 -0
- data/gemfiles/ruby_2.7.0_rails5_postgres_redis.gemfile.lock +295 -0
- data/gemfiles/ruby_2.7.0_rails5_postgres_redis_activesupport.gemfile +44 -0
- data/gemfiles/ruby_2.7.0_rails5_postgres_redis_activesupport.gemfile.lock +295 -0
- data/gemfiles/ruby_2.7.0_rails5_postgres_sidekiq.gemfile +44 -0
- data/gemfiles/ruby_2.7.0_rails5_postgres_sidekiq.gemfile.lock +284 -0
- data/gemfiles/ruby_2.7.0_rails61_mysql2.gemfile +42 -0
- data/gemfiles/ruby_2.7.0_rails61_mysql2.gemfile.lock +295 -0
- data/gemfiles/ruby_2.7.0_rails61_postgres.gemfile +42 -0
- data/gemfiles/ruby_2.7.0_rails61_postgres.gemfile.lock +295 -0
- data/gemfiles/ruby_2.7.0_rails61_postgres_redis.gemfile +43 -0
- data/gemfiles/ruby_2.7.0_rails61_postgres_redis.gemfile.lock +297 -0
- data/gemfiles/ruby_2.7.0_rails61_postgres_sidekiq.gemfile +43 -0
- data/gemfiles/ruby_2.7.0_rails61_postgres_sidekiq.gemfile.lock +302 -0
- data/gemfiles/ruby_2.7.0_rails6_mysql2.gemfile +42 -0
- data/gemfiles/ruby_2.7.0_rails6_mysql2.gemfile.lock +292 -0
- data/gemfiles/ruby_2.7.0_rails6_postgres.gemfile +42 -0
- data/gemfiles/ruby_2.7.0_rails6_postgres.gemfile.lock +292 -0
- data/gemfiles/ruby_2.7.0_rails6_postgres_redis.gemfile +44 -0
- data/gemfiles/ruby_2.7.0_rails6_postgres_redis.gemfile.lock +311 -0
- data/gemfiles/ruby_2.7.0_rails6_postgres_redis_activesupport.gemfile +44 -0
- data/gemfiles/ruby_2.7.0_rails6_postgres_redis_activesupport.gemfile.lock +311 -0
- data/gemfiles/ruby_2.7.0_rails6_postgres_sidekiq.gemfile +44 -0
- data/gemfiles/ruby_2.7.0_rails6_postgres_sidekiq.gemfile.lock +300 -0
- data/gemfiles/ruby_2.7.0_resque2_redis3.gemfile +40 -0
- data/gemfiles/ruby_2.7.0_resque2_redis3.gemfile.lock +190 -0
- data/gemfiles/ruby_2.7.0_resque2_redis4.gemfile +40 -0
- data/gemfiles/ruby_2.7.0_resque2_redis4.gemfile.lock +190 -0
- data/gemfiles/ruby_3.0.0_contrib.gemfile +77 -0
- data/gemfiles/ruby_3.0.0_contrib.gemfile.lock +1534 -0
- data/gemfiles/ruby_3.0.0_core_old.gemfile +39 -0
- data/gemfiles/ruby_3.0.0_core_old.gemfile.lock +165 -0
- data/gemfiles/ruby_3.0.0_cucumber3.gemfile +40 -0
- data/gemfiles/ruby_3.0.0_cucumber3.gemfile.lock +186 -0
- data/gemfiles/ruby_3.0.0_cucumber4.gemfile +40 -0
- data/gemfiles/ruby_3.0.0_cucumber4.gemfile.lock +218 -0
- data/gemfiles/ruby_3.0.0_cucumber5.gemfile +40 -0
- data/gemfiles/ruby_3.0.0_cucumber5.gemfile.lock +218 -0
- data/gemfiles/ruby_3.0.0_rails61_mysql2.gemfile +43 -0
- data/gemfiles/ruby_3.0.0_rails61_mysql2.gemfile.lock +295 -0
- data/gemfiles/ruby_3.0.0_rails61_postgres.gemfile +43 -0
- data/gemfiles/ruby_3.0.0_rails61_postgres.gemfile.lock +295 -0
- data/gemfiles/ruby_3.0.0_rails61_postgres_redis.gemfile +44 -0
- data/gemfiles/ruby_3.0.0_rails61_postgres_redis.gemfile.lock +297 -0
- data/gemfiles/ruby_3.0.0_rails61_postgres_sidekiq.gemfile +44 -0
- data/gemfiles/ruby_3.0.0_rails61_postgres_sidekiq.gemfile.lock +302 -0
- data/gemfiles/ruby_3.0.0_resque2_redis3.gemfile +41 -0
- data/gemfiles/ruby_3.0.0_resque2_redis3.gemfile.lock +192 -0
- data/gemfiles/ruby_3.0.0_resque2_redis4.gemfile +41 -0
- data/gemfiles/ruby_3.0.0_resque2_redis4.gemfile.lock +192 -0
- data/lib/ddtrace/configuration/agent_settings_resolver.rb +241 -0
- data/lib/ddtrace/configuration/components.rb +22 -29
- data/lib/ddtrace/configuration/settings.rb +16 -6
- data/lib/ddtrace/contrib/action_pack/action_controller/instrumentation.rb +1 -1
- data/lib/ddtrace/contrib/action_pack/utils.rb +1 -1
- data/lib/ddtrace/contrib/auto_instrument.rb +0 -1
- data/lib/ddtrace/contrib/sucker_punch/instrumentation.rb +4 -0
- data/lib/ddtrace/error.rb +85 -9
- data/lib/ddtrace/ext/profiling.rb +1 -0
- data/lib/ddtrace/ext/transport.rb +1 -0
- data/lib/ddtrace/profiling.rb +73 -22
- data/lib/ddtrace/profiling/collectors/stack.rb +12 -6
- data/lib/ddtrace/profiling/ext/cpu.rb +0 -2
- data/lib/ddtrace/profiling/ext/cthread.rb +54 -31
- data/lib/ddtrace/profiling/profiler.rb +2 -0
- data/lib/ddtrace/profiling/recorder.rb +8 -0
- data/lib/ddtrace/profiling/scheduler.rb +32 -11
- data/lib/ddtrace/profiling/transport/http.rb +51 -55
- data/lib/ddtrace/profiling/transport/http/api/endpoint.rb +1 -0
- data/lib/ddtrace/runtime/container.rb +16 -8
- data/lib/ddtrace/tracer.rb +7 -28
- data/lib/ddtrace/transport/http.rb +36 -33
- data/lib/ddtrace/version.rb +13 -1
- data/lib/ddtrace/workers/loop.rb +13 -1
- data/lib/ddtrace/workers/trace_writer.rb +2 -5
- data/lib/ddtrace/writer.rb +4 -1
- metadata +393 -6
data/lib/ddtrace/error.rb
CHANGED
@@ -1,23 +1,99 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Datadog global namespace
|
2
4
|
module Datadog
|
3
5
|
# Error is a value-object responsible for sanitizing/encapsulating error data
|
4
6
|
class Error
|
5
7
|
attr_reader :type, :message, :backtrace
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
9
|
+
class << self
|
10
|
+
def build_from(value)
|
11
|
+
case value
|
12
|
+
when Error then value
|
13
|
+
when Array then new(*value)
|
14
|
+
when Exception then new(value.class, value.message, full_backtrace(value))
|
15
|
+
when ContainsMessage then new(value.class, value.message)
|
16
|
+
else BlankError
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.1.0')
|
23
|
+
# Ruby 2.0 exceptions don't have `cause`.
|
24
|
+
# Only current exception stack trace is reported.
|
25
|
+
# This is the same behavior as before.
|
26
|
+
def full_backtrace(ex)
|
27
|
+
backtrace = ex.backtrace
|
28
|
+
backtrace.join("\n") if backtrace
|
29
|
+
end
|
30
|
+
else
|
31
|
+
# Returns a stack trace with nested error causes and details.
|
32
|
+
#
|
33
|
+
# This manually implements Ruby >= 2.6 error output for two reasons:
|
34
|
+
#
|
35
|
+
# 1. It is not available in Ruby < 2.6.
|
36
|
+
# 2. It's measurably faster to manually implement it in Ruby.
|
37
|
+
#
|
38
|
+
# This method mimics the exact output of
|
39
|
+
# `ex.full_message(highlight: false, order: :top)`
|
40
|
+
# but it's around 3x faster in our benchmark test
|
41
|
+
# at `error_spec.rb`.
|
42
|
+
def full_backtrace(ex)
|
43
|
+
backtrace = String.new
|
44
|
+
backtrace_for(ex, backtrace)
|
45
|
+
|
46
|
+
# Avoid circular causes
|
47
|
+
causes = {}
|
48
|
+
causes[ex] = true
|
49
|
+
|
50
|
+
while (cause = ex.cause) && !causes.key?(cause)
|
51
|
+
backtrace_for(cause, backtrace)
|
52
|
+
causes[cause] = true
|
53
|
+
end
|
54
|
+
|
55
|
+
backtrace
|
56
|
+
end
|
57
|
+
|
58
|
+
# Outputs the following format for exceptions:
|
59
|
+
#
|
60
|
+
# ```
|
61
|
+
# error_spec.rb:55:in `wrapper': wrapper layer (RuntimeError)
|
62
|
+
# from error_spec.rb:40:in `wrapper'
|
63
|
+
# from error_spec.rb:61:in `caller'
|
64
|
+
# ...
|
65
|
+
# ```
|
66
|
+
def backtrace_for(ex, backtrace)
|
67
|
+
trace = ex.backtrace
|
68
|
+
return unless trace
|
69
|
+
|
70
|
+
if trace[0]
|
71
|
+
# Add Exception information to error line
|
72
|
+
backtrace << trace[0]
|
73
|
+
backtrace << ': '
|
74
|
+
backtrace << ex.message
|
75
|
+
backtrace << ' ('
|
76
|
+
backtrace << ex.class.to_s
|
77
|
+
backtrace << ')'
|
78
|
+
end
|
79
|
+
|
80
|
+
if trace[1]
|
81
|
+
# Ident stack trace for caller lines, to separate
|
82
|
+
# them from the main error lines.
|
83
|
+
trace[1..-1].each do |line|
|
84
|
+
backtrace << "\n\tfrom "
|
85
|
+
backtrace << line
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
backtrace << "\n"
|
90
|
+
end
|
14
91
|
end
|
15
92
|
end
|
16
93
|
|
17
94
|
def initialize(type = nil, message = nil, backtrace = nil)
|
18
|
-
backtrace = Array(backtrace).join("\n")
|
95
|
+
backtrace = Array(backtrace).join("\n") unless backtrace.is_a?(String)
|
19
96
|
|
20
|
-
# DEV: We should measure if `Utils.utf8_encode` is still needed in practice.
|
21
97
|
@type = Utils.utf8_encode(type)
|
22
98
|
@message = Utils.utf8_encode(message)
|
23
99
|
@backtrace = Utils.utf8_encode(backtrace)
|
@@ -29,6 +29,7 @@ module Datadog
|
|
29
29
|
FORM_FIELD_TAG_ENV = 'env'.freeze
|
30
30
|
FORM_FIELD_TAG_HOST = 'host'.freeze
|
31
31
|
FORM_FIELD_TAG_LANGUAGE = 'language'.freeze
|
32
|
+
FORM_FIELD_TAG_PID = 'pid'.freeze
|
32
33
|
FORM_FIELD_TAG_PROFILER_VERSION = 'profiler_version'.freeze
|
33
34
|
FORM_FIELD_TAG_RUNTIME = 'runtime'.freeze
|
34
35
|
FORM_FIELD_TAG_RUNTIME_ENGINE = 'runtime_engine'.freeze
|
data/lib/ddtrace/profiling.rb
CHANGED
@@ -4,40 +4,68 @@ module Datadog
|
|
4
4
|
module_function
|
5
5
|
|
6
6
|
GOOGLE_PROTOBUF_MINIMUM_VERSION = Gem::Version.new('3.0')
|
7
|
+
private_constant :GOOGLE_PROTOBUF_MINIMUM_VERSION
|
7
8
|
|
8
9
|
def supported?
|
9
|
-
|
10
|
+
unsupported_reason.nil?
|
10
11
|
end
|
11
12
|
|
12
|
-
def
|
13
|
-
|
14
|
-
|
13
|
+
def unsupported_reason
|
14
|
+
# NOTE: Only the first matching reason is returned, so try to keep a nice order on reasons -- e.g. tell users
|
15
|
+
# first that they can't use this on JRuby before telling them that they are missing protobuf
|
16
|
+
|
17
|
+
ruby_engine_unsupported? || ruby_version_unsupported? ||
|
18
|
+
protobuf_gem_unavailable? || protobuf_version_unsupported? || protobuf_failed_to_load?
|
15
19
|
end
|
16
20
|
|
17
|
-
def
|
18
|
-
|
19
|
-
&& !Gem.loaded_specs['google-protobuf'].nil? \
|
20
|
-
&& Gem.loaded_specs['google-protobuf'].version >= GOOGLE_PROTOBUF_MINIMUM_VERSION \
|
21
|
-
&& !defined?(@failed_to_load_protobuf)
|
21
|
+
def self.ruby_engine_unsupported?
|
22
|
+
'JRuby is not supported' if RUBY_ENGINE == 'jruby'
|
22
23
|
end
|
24
|
+
private_class_method :ruby_engine_unsupported?
|
23
25
|
|
24
|
-
def
|
25
|
-
|
26
|
-
|
26
|
+
def self.ruby_version_unsupported?
|
27
|
+
'Ruby >= 2.1 is required' if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.1')
|
28
|
+
end
|
29
|
+
private_class_method :ruby_version_unsupported?
|
27
30
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
31
|
+
def self.protobuf_gem_unavailable?
|
32
|
+
if Gem.loaded_specs['google-protobuf'].nil?
|
33
|
+
"Missing google-protobuf dependency; please add `gem 'google-protobuf', '~> 3.0'` to your Gemfile or gems.rb file"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
private_class_method :protobuf_gem_unavailable?
|
37
|
+
|
38
|
+
def self.protobuf_version_unsupported?
|
39
|
+
if Gem.loaded_specs['google-protobuf'].version < GOOGLE_PROTOBUF_MINIMUM_VERSION
|
40
|
+
'Your google-protobuf is too old; ensure that you have google-protobuf >= 3.0 by ' \
|
41
|
+
"adding `gem 'google-protobuf', '~> 3.0'` to your Gemfile or gems.rb file"
|
42
|
+
end
|
43
|
+
end
|
44
|
+
private_class_method :protobuf_version_unsupported?
|
45
|
+
|
46
|
+
def self.protobuf_failed_to_load?
|
47
|
+
unless protobuf_loaded_successfully?
|
48
|
+
'There was an error loading the google-protobuf library; see previous warning message for details'
|
49
|
+
end
|
50
|
+
end
|
51
|
+
private_class_method :protobuf_failed_to_load?
|
52
|
+
|
53
|
+
# The `google-protobuf` gem depends on a native component, and its creators helpfully tried to provide precompiled
|
54
|
+
# versions of this extension on rubygems.org.
|
55
|
+
#
|
56
|
+
# Unfortunately, for a long time, the supported Ruby versions metadata on these precompiled versions of the extension
|
57
|
+
# was not correctly set. (This is fixed in newer versions -- but not all Ruby versions we want to support can use
|
58
|
+
# these.)
|
59
|
+
#
|
60
|
+
# Thus, the gem can still be installed, but can be in a broken state. To avoid breaking customer applications, we
|
61
|
+
# use this helper to load it and gracefully handle failures.
|
62
|
+
def self.protobuf_loaded_successfully?
|
63
|
+
return @protobuf_loaded if defined?(@protobuf_loaded)
|
36
64
|
|
37
65
|
begin
|
38
|
-
require '
|
66
|
+
require 'google/protobuf'
|
67
|
+
@protobuf_loaded = true
|
39
68
|
rescue LoadError => e
|
40
|
-
@failed_to_load_protobuf = true
|
41
69
|
Kernel.warn(
|
42
70
|
"[DDTRACE] Error while loading google-protobuf gem. Cause: '#{e.message}' Location: '#{e.backtrace.first}'. " \
|
43
71
|
'This can happen when google-protobuf is missing its native components. ' \
|
@@ -46,8 +74,31 @@ module Datadog
|
|
46
74
|
'If the error persists, please contact support via <https://docs.datadoghq.com/help/> or ' \
|
47
75
|
'file a bug at <https://github.com/DataDog/dd-trace-rb/blob/master/CONTRIBUTING.md#found-a-bug>.'
|
48
76
|
)
|
77
|
+
@protobuf_loaded = false
|
49
78
|
end
|
50
79
|
end
|
80
|
+
private_class_method :protobuf_loaded_successfully?
|
81
|
+
|
82
|
+
def self.load_profiling
|
83
|
+
return false unless supported?
|
84
|
+
|
85
|
+
require 'ddtrace/profiling/ext/cpu'
|
86
|
+
require 'ddtrace/profiling/ext/forking'
|
87
|
+
|
88
|
+
require 'ddtrace/profiling/collectors/stack'
|
89
|
+
require 'ddtrace/profiling/exporter'
|
90
|
+
require 'ddtrace/profiling/recorder'
|
91
|
+
require 'ddtrace/profiling/scheduler'
|
92
|
+
require 'ddtrace/profiling/tasks/setup'
|
93
|
+
require 'ddtrace/profiling/transport/io'
|
94
|
+
require 'ddtrace/profiling/transport/http'
|
95
|
+
require 'ddtrace/profiling/profiler'
|
96
|
+
|
97
|
+
require 'ddtrace/profiling/pprof/pprof_pb'
|
98
|
+
|
99
|
+
true
|
100
|
+
end
|
101
|
+
private_class_method :load_profiling
|
51
102
|
|
52
103
|
load_profiling if supported?
|
53
104
|
end
|
@@ -11,6 +11,7 @@ module Datadog
|
|
11
11
|
# Collects stack trace samples from Ruby threads for both CPU-time (if available) and wall-clock.
|
12
12
|
# Runs on its own background thread.
|
13
13
|
#
|
14
|
+
# rubocop:disable Metrics/ClassLength
|
14
15
|
class Stack < Worker
|
15
16
|
include Workers::Polling
|
16
17
|
|
@@ -27,7 +28,7 @@ module Datadog
|
|
27
28
|
|
28
29
|
def initialize(
|
29
30
|
recorder,
|
30
|
-
max_frames
|
31
|
+
max_frames:,
|
31
32
|
ignore_thread: nil,
|
32
33
|
max_time_usage_pct: DEFAULT_MAX_TIME_USAGE_PCT,
|
33
34
|
thread_api: Thread,
|
@@ -36,8 +37,7 @@ module Datadog
|
|
36
37
|
enabled: true
|
37
38
|
)
|
38
39
|
@recorder = recorder
|
39
|
-
|
40
|
-
@max_frames = max_frames || raise(ArgumentError, 'missing keyword :max_frames')
|
40
|
+
@max_frames = max_frames
|
41
41
|
@ignore_thread = ignore_thread
|
42
42
|
@max_time_usage_pct = max_time_usage_pct
|
43
43
|
@thread_api = thread_api
|
@@ -52,6 +52,11 @@ module Datadog
|
|
52
52
|
self.enabled = enabled
|
53
53
|
|
54
54
|
@warn_about_missing_cpu_time_instrumentation_only_once = Datadog::Utils::OnlyOnce.new
|
55
|
+
|
56
|
+
# Cache this proc, since it's pretty expensive to keep recreating it
|
57
|
+
@build_backtrace_location = method(:build_backtrace_location).to_proc
|
58
|
+
# Cache this buffer, since it's pretty expensive to keep accessing it
|
59
|
+
@stack_sample_event_recorder = recorder[Events::StackSample]
|
55
60
|
end
|
56
61
|
|
57
62
|
def start
|
@@ -183,7 +188,7 @@ module Datadog
|
|
183
188
|
def convert_backtrace_locations(locations)
|
184
189
|
locations.collect do |location|
|
185
190
|
# Re-use existing BacktraceLocation if identical copy, otherwise build a new one.
|
186
|
-
|
191
|
+
@stack_sample_event_recorder.cache(:backtrace_locations).fetch(
|
187
192
|
# Function name
|
188
193
|
location.base_label,
|
189
194
|
# Line number
|
@@ -191,13 +196,13 @@ module Datadog
|
|
191
196
|
# Filename
|
192
197
|
location.path,
|
193
198
|
# Build function
|
194
|
-
|
199
|
+
&@build_backtrace_location
|
195
200
|
)
|
196
201
|
end
|
197
202
|
end
|
198
203
|
|
199
204
|
def build_backtrace_location(_id, base_label, lineno, path)
|
200
|
-
string_table =
|
205
|
+
string_table = @stack_sample_event_recorder.string_table
|
201
206
|
|
202
207
|
Profiling::BacktraceLocation.new(
|
203
208
|
string_table.fetch_string(base_label),
|
@@ -248,6 +253,7 @@ module Datadog
|
|
248
253
|
end
|
249
254
|
end
|
250
255
|
end
|
256
|
+
# rubocop:enable Metrics/ClassLength
|
251
257
|
end
|
252
258
|
end
|
253
259
|
end
|
@@ -40,8 +40,6 @@ module Datadog
|
|
40
40
|
'Feature requires Linux; Windows is not supported'
|
41
41
|
elsif !RUBY_PLATFORM.include?('linux')
|
42
42
|
"Feature requires Linux; #{RUBY_PLATFORM} is not supported"
|
43
|
-
elsif Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.1')
|
44
|
-
'Ruby >= 2.1 is required'
|
45
43
|
elsif Gem::Specification.find_all_by_name('rollbar', ROLLBAR_INCOMPATIBLE_VERSIONS).any?
|
46
44
|
'You have an incompatible rollbar gem version installed; ensure that you have rollbar >= 3.1.2 by ' \
|
47
45
|
"adding `gem 'rollbar', '>= 3.1.2'` to your Gemfile or gems.rb file. " \
|
@@ -8,13 +8,33 @@ module Datadog
|
|
8
8
|
layout :value, :int
|
9
9
|
end
|
10
10
|
|
11
|
-
#
|
12
|
-
module
|
11
|
+
# Enables interfacing with pthread via FFI
|
12
|
+
module NativePthread
|
13
13
|
extend FFI::Library
|
14
14
|
ffi_lib ['pthread', 'libpthread.so.0']
|
15
15
|
attach_function :pthread_self, [], :ulong
|
16
16
|
attach_function :pthread_getcpuclockid, [:ulong, CClockId], :int
|
17
17
|
|
18
|
+
# NOTE: Only returns thread ID for thread that evaluates this call.
|
19
|
+
# a.k.a. evaluating `get_native_thread_id(thread_a)` from within
|
20
|
+
# `thread_b` will return `thread_b`'s thread ID, not `thread_a`'s.
|
21
|
+
def self.get_native_thread_id(thread)
|
22
|
+
return unless ::Thread.current == thread
|
23
|
+
|
24
|
+
pthread_self
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.get_clock_id(thread, pthread_id)
|
28
|
+
return unless ::Thread.current == thread && pthread_id
|
29
|
+
|
30
|
+
clock = CClockId.new
|
31
|
+
clock[:value] = 0
|
32
|
+
pthread_getcpuclockid(pthread_id, clock).zero? ? clock[:value] : nil
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
# Extension used to enable CPU-time profiling via use of pthread's `getcpuclockid`.
|
37
|
+
module CThread
|
18
38
|
def self.prepended(base)
|
19
39
|
# Threads that have already been created, will not have resolved
|
20
40
|
# a thread/clock ID. This is because these IDs can only be resolved
|
@@ -27,8 +47,30 @@ module Datadog
|
|
27
47
|
base.current.send(:update_native_ids) if base.current.is_a?(CThread)
|
28
48
|
end
|
29
49
|
|
30
|
-
|
31
|
-
|
50
|
+
# Process::Waiter crash workaround:
|
51
|
+
#
|
52
|
+
# This is a workaround for a Ruby VM segfault (usually something like
|
53
|
+
# "[BUG] Segmentation fault at 0x0000000000000008") in the affected Ruby versions.
|
54
|
+
# See https://bugs.ruby-lang.org/issues/17807 and the regression tests added to this module's specs for details.
|
55
|
+
#
|
56
|
+
# In those Ruby versions, there's a very special subclass of `Thread` called `Process::Waiter` that causes VM
|
57
|
+
# crashes whenever something tries to read its instance variables. This subclass of thread only shows up when
|
58
|
+
# the `Process.detach` API gets used.
|
59
|
+
# In this module's specs you can find crash regression tests that include a way of reproducing it.
|
60
|
+
#
|
61
|
+
# The workaround is to use `defined?` to check first if the instance variable exists. This seems to be fine
|
62
|
+
# with Ruby.
|
63
|
+
# Note that this crash doesn't affect `@foo ||=` nor instance variable writes (after the first write ever of any
|
64
|
+
# instance variable on a `Process::Waiter`, then further reads and writes to that or any other instance are OK;
|
65
|
+
# it looks like there's some lazily-created structure that is missing and did not get created).
|
66
|
+
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3') &&
|
67
|
+
Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7')
|
68
|
+
attr_reader :native_thread_id
|
69
|
+
else
|
70
|
+
def native_thread_id
|
71
|
+
defined?(@native_thread_id) && @native_thread_id
|
72
|
+
end
|
73
|
+
end
|
32
74
|
|
33
75
|
def initialize(*args)
|
34
76
|
@pid = ::Process.pid
|
@@ -48,11 +90,6 @@ module Datadog
|
|
48
90
|
end
|
49
91
|
ruby2_keywords :initialize if respond_to?(:ruby2_keywords, true)
|
50
92
|
|
51
|
-
def clock_id
|
52
|
-
update_native_ids if forked?
|
53
|
-
defined?(@clock_id) && @clock_id
|
54
|
-
end
|
55
|
-
|
56
93
|
def cpu_time(unit = :float_second)
|
57
94
|
return unless clock_id && ::Process.respond_to?(:clock_gettime)
|
58
95
|
|
@@ -71,36 +108,22 @@ module Datadog
|
|
71
108
|
|
72
109
|
private
|
73
110
|
|
74
|
-
|
111
|
+
def clock_id
|
112
|
+
update_native_ids if forked?
|
113
|
+
defined?(@clock_id) && @clock_id
|
114
|
+
end
|
115
|
+
|
75
116
|
def forked?
|
76
117
|
::Process.pid != (@pid ||= nil)
|
77
118
|
end
|
78
119
|
|
79
120
|
def update_native_ids
|
80
|
-
# Can only resolve if invoked from same thread
|
121
|
+
# Can only resolve if invoked from same thread
|
81
122
|
return unless ::Thread.current == self
|
82
123
|
|
83
124
|
@pid = ::Process.pid
|
84
|
-
@native_thread_id = get_native_thread_id
|
85
|
-
@clock_id = get_clock_id(@native_thread_id)
|
86
|
-
end
|
87
|
-
|
88
|
-
def get_native_thread_id
|
89
|
-
return unless ::Thread.current == self
|
90
|
-
|
91
|
-
# NOTE: Only returns thread ID for thread that evaluates this call.
|
92
|
-
# a.k.a. evaluating `thread_a.get_native_thread_id` from within
|
93
|
-
# `thread_b` will return `thread_b`'s thread ID, not `thread_a`'s.
|
94
|
-
pthread_self
|
95
|
-
end
|
96
|
-
|
97
|
-
def get_clock_id(pthread_id)
|
98
|
-
return unless pthread_id && alive?
|
99
|
-
|
100
|
-
# Build a struct, pass it to Pthread's getcpuclockid function.
|
101
|
-
clock = CClockId.new
|
102
|
-
clock[:value] = 0
|
103
|
-
pthread_getcpuclockid(pthread_id, clock).zero? ? clock[:value] : nil
|
125
|
+
@native_thread_id = NativePthread.get_native_thread_id(self)
|
126
|
+
@clock_id = NativePthread.get_clock_id(self, @native_thread_id)
|
104
127
|
end
|
105
128
|
end
|
106
129
|
|