ddtrace 0.49.0 → 0.50.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 +49 -73
- data/.circleci/images/primary/{Dockerfile-truffleruby-21.0.0 → Dockerfile-truffleruby-21.1.0} +1 -1
- data/.gitignore +0 -2
- data/.rubocop.yml +0 -8
- data/.rubocop_todo.yml +7 -7
- data/Appraisals +1 -107
- data/CHANGELOG.md +47 -0
- data/Rakefile +278 -333
- data/benchmarks/data/profiler-submission-marshal.gz +0 -0
- data/benchmarks/profiler_submission.rb +93 -0
- data/ddtrace.gemspec +1 -1
- data/docker-compose.yml +4 -34
- data/docs/GettingStarted.md +24 -9
- data/gemfiles/jruby_9.2.0.0_contrib.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.0.0_contrib_old.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.0.0_core_old.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.0.0_cucumber3.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.0.0_cucumber4.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.0.0_cucumber5.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.0.0_rails5_mysql2.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.0.0_rails5_postgres.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.0.0_rails5_postgres_redis.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.0.0_rails5_postgres_redis_activesupport.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.0.0_rails5_postgres_sidekiq.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.0.0_rails61_mysql2.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.0.0_rails61_postgres.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.0.0_rails61_postgres_redis.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.0.0_rails61_postgres_sidekiq.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.0.0_rails6_mysql2.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.0.0_rails6_postgres.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.0.0_rails6_postgres_redis.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.0.0_rails6_postgres_redis_activesupport.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.0.0_rails6_postgres_sidekiq.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.0.0_resque2_redis3.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.0.0_resque2_redis4.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.11.1_contrib.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.11.1_contrib_old.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.11.1_core_old.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.11.1_cucumber3.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.11.1_cucumber4.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.11.1_cucumber5.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.11.1_rails5_mysql2.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.11.1_rails5_postgres.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.11.1_rails5_postgres_redis.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.11.1_rails5_postgres_redis_activesupport.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.11.1_rails5_postgres_sidekiq.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.11.1_rails61_mysql2.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.11.1_rails61_postgres.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.11.1_rails61_postgres_redis.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.11.1_rails61_postgres_sidekiq.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.11.1_rails6_mysql2.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.11.1_rails6_postgres.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.11.1_rails6_postgres_redis.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.11.1_rails6_postgres_redis_activesupport.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.11.1_rails6_postgres_sidekiq.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.11.1_resque2_redis3.gemfile.lock +1 -1
- data/gemfiles/jruby_9.2.11.1_resque2_redis4.gemfile.lock +1 -1
- data/gemfiles/ruby_2.1.10_contrib_old.gemfile.lock +1 -1
- data/gemfiles/ruby_2.1.10_core_old.gemfile.lock +1 -1
- data/gemfiles/ruby_2.1.10_rails30_postgres.gemfile.lock +1 -1
- data/gemfiles/ruby_2.1.10_rails30_postgres_sidekiq.gemfile.lock +1 -1
- data/gemfiles/ruby_2.1.10_rails32_mysql2.gemfile.lock +1 -1
- data/gemfiles/ruby_2.1.10_rails32_postgres.gemfile.lock +1 -1
- data/gemfiles/ruby_2.1.10_rails32_postgres_redis.gemfile.lock +1 -1
- data/gemfiles/ruby_2.1.10_rails32_postgres_sidekiq.gemfile.lock +1 -1
- data/gemfiles/ruby_2.1.10_rails4_mysql2.gemfile.lock +1 -1
- data/gemfiles/ruby_2.1.10_rails4_postgres.gemfile.lock +1 -1
- data/gemfiles/ruby_2.1.10_rails4_postgres_redis.gemfile.lock +1 -1
- data/gemfiles/ruby_2.2.10_contrib.gemfile.lock +1 -1
- data/gemfiles/ruby_2.2.10_core_old.gemfile.lock +1 -1
- data/gemfiles/ruby_2.2.10_rails30_postgres.gemfile.lock +1 -1
- data/gemfiles/ruby_2.2.10_rails30_postgres_sidekiq.gemfile.lock +1 -1
- data/gemfiles/ruby_2.2.10_rails32_mysql2.gemfile.lock +1 -1
- data/gemfiles/ruby_2.2.10_rails32_postgres.gemfile.lock +1 -1
- data/gemfiles/ruby_2.2.10_rails32_postgres_redis.gemfile.lock +1 -1
- data/gemfiles/ruby_2.2.10_rails32_postgres_sidekiq.gemfile.lock +1 -1
- data/gemfiles/ruby_2.2.10_rails4_mysql2.gemfile.lock +1 -1
- data/gemfiles/ruby_2.2.10_rails4_postgres.gemfile.lock +1 -1
- data/gemfiles/ruby_2.2.10_rails4_postgres_redis.gemfile.lock +1 -1
- data/gemfiles/ruby_2.2.10_rails4_postgres_sidekiq.gemfile.lock +1 -1
- data/gemfiles/ruby_2.2.10_rails5_mysql2.gemfile.lock +1 -1
- data/gemfiles/ruby_2.2.10_rails5_postgres.gemfile.lock +1 -1
- data/gemfiles/ruby_2.2.10_rails5_postgres_redis.gemfile.lock +1 -1
- data/gemfiles/ruby_2.2.10_rails5_postgres_redis_activesupport.gemfile.lock +1 -1
- data/gemfiles/ruby_2.2.10_rails5_postgres_sidekiq.gemfile.lock +1 -1
- data/gemfiles/ruby_2.3.8_contrib.gemfile.lock +1 -1
- data/gemfiles/ruby_2.3.8_contrib_old.gemfile.lock +1 -1
- data/gemfiles/ruby_2.3.8_core_old.gemfile.lock +1 -1
- data/gemfiles/ruby_2.3.8_cucumber3.gemfile.lock +1 -1
- data/gemfiles/ruby_2.3.8_cucumber4.gemfile.lock +1 -1
- data/gemfiles/ruby_2.3.8_rails30_postgres.gemfile.lock +1 -1
- data/gemfiles/ruby_2.3.8_rails30_postgres_sidekiq.gemfile.lock +1 -1
- data/gemfiles/ruby_2.3.8_rails32_mysql2.gemfile.lock +1 -1
- data/gemfiles/ruby_2.3.8_rails32_postgres.gemfile.lock +1 -1
- data/gemfiles/ruby_2.3.8_rails32_postgres_redis.gemfile.lock +1 -1
- data/gemfiles/ruby_2.3.8_rails32_postgres_sidekiq.gemfile.lock +1 -1
- data/gemfiles/ruby_2.3.8_rails4_mysql2.gemfile.lock +1 -1
- data/gemfiles/ruby_2.3.8_rails4_postgres.gemfile.lock +1 -1
- data/gemfiles/ruby_2.3.8_rails4_postgres_redis.gemfile.lock +1 -1
- data/gemfiles/ruby_2.3.8_rails4_postgres_sidekiq.gemfile.lock +1 -1
- data/gemfiles/ruby_2.3.8_rails5_mysql2.gemfile.lock +1 -1
- data/gemfiles/ruby_2.3.8_rails5_postgres.gemfile.lock +1 -1
- data/gemfiles/ruby_2.3.8_rails5_postgres_redis.gemfile.lock +1 -1
- data/gemfiles/ruby_2.3.8_rails5_postgres_redis_activesupport.gemfile.lock +1 -1
- data/gemfiles/ruby_2.3.8_rails5_postgres_sidekiq.gemfile.lock +1 -1
- data/gemfiles/ruby_2.3.8_resque2_redis3.gemfile.lock +1 -1
- data/gemfiles/ruby_2.3.8_resque2_redis4.gemfile.lock +1 -1
- data/gemfiles/ruby_2.4.6_contrib.gemfile.lock +1 -1
- data/gemfiles/ruby_2.4.6_contrib_old.gemfile.lock +1 -1
- data/gemfiles/ruby_2.4.6_core_old.gemfile.lock +1 -1
- data/gemfiles/ruby_2.4.6_cucumber3.gemfile.lock +1 -1
- data/gemfiles/ruby_2.4.6_cucumber4.gemfile.lock +1 -1
- data/gemfiles/ruby_2.4.6_rails5_mysql2.gemfile.lock +1 -1
- data/gemfiles/ruby_2.4.6_rails5_postgres.gemfile.lock +1 -1
- data/gemfiles/ruby_2.4.6_rails5_postgres_redis.gemfile.lock +1 -1
- data/gemfiles/ruby_2.4.6_rails5_postgres_redis_activesupport.gemfile.lock +1 -1
- data/gemfiles/ruby_2.4.6_rails5_postgres_sidekiq.gemfile.lock +1 -1
- data/gemfiles/ruby_2.4.6_resque2_redis3.gemfile.lock +1 -1
- data/gemfiles/ruby_2.4.6_resque2_redis4.gemfile.lock +1 -1
- data/gemfiles/ruby_2.5.6_contrib.gemfile.lock +1 -1
- data/gemfiles/ruby_2.5.6_contrib_old.gemfile.lock +1 -1
- data/gemfiles/ruby_2.5.6_core_old.gemfile.lock +1 -1
- data/gemfiles/ruby_2.5.6_cucumber3.gemfile.lock +1 -1
- data/gemfiles/ruby_2.5.6_cucumber4.gemfile.lock +1 -1
- data/gemfiles/ruby_2.5.6_cucumber5.gemfile.lock +1 -1
- data/gemfiles/ruby_2.5.6_rails5_mysql2.gemfile.lock +1 -1
- data/gemfiles/ruby_2.5.6_rails5_postgres.gemfile.lock +1 -1
- data/gemfiles/ruby_2.5.6_rails5_postgres_redis.gemfile.lock +1 -1
- data/gemfiles/ruby_2.5.6_rails5_postgres_redis_activesupport.gemfile.lock +1 -1
- data/gemfiles/ruby_2.5.6_rails5_postgres_sidekiq.gemfile.lock +1 -1
- data/gemfiles/ruby_2.5.6_rails61_mysql2.gemfile.lock +1 -1
- data/gemfiles/ruby_2.5.6_rails61_postgres.gemfile.lock +1 -1
- data/gemfiles/ruby_2.5.6_rails61_postgres_redis.gemfile.lock +1 -1
- data/gemfiles/ruby_2.5.6_rails61_postgres_sidekiq.gemfile.lock +1 -1
- data/gemfiles/ruby_2.5.6_rails6_mysql2.gemfile.lock +1 -1
- data/gemfiles/ruby_2.5.6_rails6_postgres.gemfile.lock +1 -1
- data/gemfiles/ruby_2.5.6_rails6_postgres_redis.gemfile.lock +1 -1
- data/gemfiles/ruby_2.5.6_rails6_postgres_redis_activesupport.gemfile.lock +1 -1
- data/gemfiles/ruby_2.5.6_rails6_postgres_sidekiq.gemfile.lock +1 -1
- data/gemfiles/ruby_2.5.6_resque2_redis3.gemfile.lock +1 -1
- data/gemfiles/ruby_2.5.6_resque2_redis4.gemfile.lock +1 -1
- data/gemfiles/ruby_2.6.4_contrib.gemfile.lock +1 -1
- data/gemfiles/ruby_2.6.4_contrib_old.gemfile.lock +1 -1
- data/gemfiles/ruby_2.6.4_core_old.gemfile.lock +1 -1
- data/gemfiles/ruby_2.6.4_cucumber3.gemfile.lock +1 -1
- data/gemfiles/ruby_2.6.4_cucumber4.gemfile.lock +1 -1
- data/gemfiles/ruby_2.6.4_cucumber5.gemfile.lock +1 -1
- data/gemfiles/ruby_2.6.4_rails5_mysql2.gemfile.lock +1 -1
- data/gemfiles/ruby_2.6.4_rails5_postgres.gemfile.lock +1 -1
- data/gemfiles/ruby_2.6.4_rails5_postgres_redis.gemfile.lock +1 -1
- data/gemfiles/ruby_2.6.4_rails5_postgres_redis_activesupport.gemfile.lock +1 -1
- data/gemfiles/ruby_2.6.4_rails5_postgres_sidekiq.gemfile.lock +1 -1
- data/gemfiles/ruby_2.6.4_rails61_mysql2.gemfile.lock +1 -1
- data/gemfiles/ruby_2.6.4_rails61_postgres.gemfile.lock +1 -1
- data/gemfiles/ruby_2.6.4_rails61_postgres_redis.gemfile.lock +1 -1
- data/gemfiles/ruby_2.6.4_rails61_postgres_sidekiq.gemfile.lock +1 -1
- data/gemfiles/ruby_2.6.4_rails6_mysql2.gemfile.lock +1 -1
- data/gemfiles/ruby_2.6.4_rails6_postgres.gemfile.lock +1 -1
- data/gemfiles/ruby_2.6.4_rails6_postgres_redis.gemfile.lock +1 -1
- data/gemfiles/ruby_2.6.4_rails6_postgres_redis_activesupport.gemfile.lock +1 -1
- data/gemfiles/ruby_2.6.4_rails6_postgres_sidekiq.gemfile.lock +1 -1
- data/gemfiles/ruby_2.6.4_resque2_redis3.gemfile.lock +1 -1
- data/gemfiles/ruby_2.6.4_resque2_redis4.gemfile.lock +1 -1
- data/gemfiles/ruby_2.7.0_contrib.gemfile.lock +1 -1
- data/gemfiles/ruby_2.7.0_contrib_old.gemfile.lock +1 -1
- data/gemfiles/ruby_2.7.0_core_old.gemfile.lock +1 -1
- data/gemfiles/ruby_2.7.0_cucumber3.gemfile.lock +1 -1
- data/gemfiles/ruby_2.7.0_cucumber4.gemfile.lock +1 -1
- data/gemfiles/ruby_2.7.0_cucumber5.gemfile.lock +1 -1
- data/gemfiles/ruby_2.7.0_rails5_mysql2.gemfile.lock +1 -1
- data/gemfiles/ruby_2.7.0_rails5_postgres.gemfile.lock +1 -1
- data/gemfiles/ruby_2.7.0_rails5_postgres_redis.gemfile.lock +1 -1
- data/gemfiles/ruby_2.7.0_rails5_postgres_redis_activesupport.gemfile.lock +1 -1
- data/gemfiles/ruby_2.7.0_rails5_postgres_sidekiq.gemfile.lock +1 -1
- data/gemfiles/ruby_2.7.0_rails61_mysql2.gemfile.lock +1 -1
- data/gemfiles/ruby_2.7.0_rails61_postgres.gemfile.lock +1 -1
- data/gemfiles/ruby_2.7.0_rails61_postgres_redis.gemfile.lock +1 -1
- data/gemfiles/ruby_2.7.0_rails61_postgres_sidekiq.gemfile.lock +1 -1
- data/gemfiles/ruby_2.7.0_rails6_mysql2.gemfile.lock +1 -1
- data/gemfiles/ruby_2.7.0_rails6_postgres.gemfile.lock +1 -1
- data/gemfiles/ruby_2.7.0_rails6_postgres_redis.gemfile.lock +1 -1
- data/gemfiles/ruby_2.7.0_rails6_postgres_redis_activesupport.gemfile.lock +1 -1
- data/gemfiles/ruby_2.7.0_rails6_postgres_sidekiq.gemfile.lock +1 -1
- data/gemfiles/ruby_2.7.0_resque2_redis3.gemfile.lock +1 -1
- data/gemfiles/ruby_2.7.0_resque2_redis4.gemfile.lock +1 -1
- data/gemfiles/ruby_3.0.0_contrib.gemfile +1 -0
- data/gemfiles/ruby_3.0.0_contrib.gemfile.lock +7 -1
- data/gemfiles/ruby_3.0.0_core_old.gemfile.lock +1 -1
- data/gemfiles/ruby_3.0.0_cucumber3.gemfile.lock +1 -1
- data/gemfiles/ruby_3.0.0_cucumber4.gemfile.lock +1 -1
- data/gemfiles/ruby_3.0.0_cucumber5.gemfile.lock +1 -1
- data/gemfiles/ruby_3.0.0_rails61_mysql2.gemfile.lock +1 -1
- data/gemfiles/ruby_3.0.0_rails61_postgres.gemfile.lock +1 -1
- data/gemfiles/ruby_3.0.0_rails61_postgres_redis.gemfile.lock +1 -1
- data/gemfiles/ruby_3.0.0_rails61_postgres_sidekiq.gemfile.lock +1 -1
- data/gemfiles/ruby_3.0.0_resque2_redis3.gemfile.lock +1 -1
- data/gemfiles/ruby_3.0.0_resque2_redis4.gemfile.lock +1 -1
- data/integration/apps/rack/README.md +2 -2
- data/integration/apps/rack/script/ci +2 -1
- data/integration/apps/rails-five/README.md +2 -2
- data/integration/apps/rails-five/script/ci +2 -1
- data/integration/apps/rspec/.dockerignore +1 -0
- data/integration/apps/rspec/.envrc.sample +1 -0
- data/integration/apps/rspec/.gitignore +2 -0
- data/integration/apps/rspec/.rspec +1 -0
- data/integration/apps/rspec/Dockerfile +25 -0
- data/integration/apps/rspec/Dockerfile-ci +11 -0
- data/integration/apps/rspec/Gemfile +14 -0
- data/integration/apps/rspec/README.md +70 -0
- data/integration/apps/rspec/agent.yaml +3 -0
- data/integration/apps/rspec/app/datadog.rb +13 -0
- data/integration/apps/rspec/app/fibonacci.rb +30 -0
- data/integration/apps/rspec/bin/run +20 -0
- data/integration/apps/rspec/bin/setup +17 -0
- data/integration/apps/rspec/bin/test +21 -0
- data/integration/apps/rspec/docker-compose.ci.yml +51 -0
- data/integration/apps/rspec/docker-compose.yml +63 -0
- data/integration/apps/rspec/script/build-images +37 -0
- data/integration/apps/rspec/script/ci +53 -0
- data/integration/apps/rspec/spec/fibonacci_spec.rb +16 -0
- data/integration/apps/rspec/spec/rspec_spec.rb +58 -0
- data/integration/apps/rspec/spec/spec_helper.rb +24 -0
- data/integration/apps/ruby/README.md +2 -2
- data/integration/apps/ruby/script/ci +2 -1
- data/lib/datadog/ci.rb +16 -0
- data/lib/datadog/ci/configuration/components.rb +30 -0
- data/lib/datadog/ci/configuration/settings.rb +36 -0
- data/lib/datadog/ci/context_flush.rb +28 -0
- data/lib/datadog/ci/contrib/cucumber/configuration/settings.rb +30 -0
- data/lib/datadog/ci/contrib/cucumber/ext.rb +19 -0
- data/lib/datadog/ci/contrib/cucumber/formatter.rb +97 -0
- data/lib/datadog/ci/contrib/cucumber/instrumentation.rb +26 -0
- data/lib/datadog/ci/contrib/cucumber/integration.rb +47 -0
- data/lib/datadog/ci/contrib/cucumber/patcher.rb +25 -0
- data/lib/datadog/ci/contrib/rspec/configuration/settings.rb +30 -0
- data/lib/datadog/ci/contrib/rspec/example.rb +73 -0
- data/lib/datadog/ci/contrib/rspec/ext.rb +18 -0
- data/lib/datadog/ci/contrib/rspec/integration.rb +48 -0
- data/lib/datadog/ci/contrib/rspec/patcher.rb +25 -0
- data/lib/datadog/ci/ext/app_types.rb +9 -0
- data/lib/datadog/ci/ext/environment.rb +303 -0
- data/lib/datadog/ci/ext/settings.rb +10 -0
- data/lib/datadog/ci/ext/test.rb +28 -0
- data/lib/datadog/ci/extensions.rb +17 -0
- data/lib/datadog/ci/test.rb +63 -0
- data/lib/ddtrace.rb +0 -2
- data/lib/ddtrace/configuration.rb +1 -23
- data/lib/ddtrace/configuration/agent_settings_resolver.rb +8 -19
- data/lib/ddtrace/configuration/base.rb +6 -9
- data/lib/ddtrace/configuration/components.rb +33 -10
- data/lib/ddtrace/configuration/options.rb +2 -2
- data/lib/ddtrace/configuration/settings.rb +49 -1
- data/lib/ddtrace/context.rb +17 -14
- data/lib/ddtrace/context_flush.rb +14 -2
- data/lib/ddtrace/contrib/action_cable/event.rb +4 -4
- data/lib/ddtrace/contrib/action_pack/action_controller/patcher.rb +1 -1
- data/lib/ddtrace/contrib/action_view/event.rb +2 -2
- data/lib/ddtrace/contrib/action_view/patcher.rb +4 -4
- data/lib/ddtrace/contrib/active_model_serializers/event.rb +2 -2
- data/lib/ddtrace/contrib/active_record/event.rb +2 -2
- data/lib/ddtrace/contrib/active_support/cache/patcher.rb +7 -7
- data/lib/ddtrace/contrib/active_support/cache/redis.rb +1 -5
- data/lib/ddtrace/contrib/active_support/notifications/event.rb +2 -2
- data/lib/ddtrace/contrib/active_support/notifications/subscriber.rb +1 -1
- data/lib/ddtrace/contrib/auto_instrument.rb +1 -1
- data/lib/ddtrace/contrib/aws/instrumentation.rb +29 -0
- data/lib/ddtrace/contrib/aws/patcher.rb +4 -0
- data/lib/ddtrace/contrib/concurrent_ruby/patcher.rb +1 -1
- data/lib/ddtrace/contrib/configurable.rb +1 -1
- data/lib/ddtrace/contrib/dalli/instrumentation.rb +1 -1
- data/lib/ddtrace/contrib/dalli/patcher.rb +1 -1
- data/lib/ddtrace/contrib/ethon/easy_patch.rb +1 -1
- data/lib/ddtrace/contrib/ethon/multi_patch.rb +1 -1
- data/lib/ddtrace/contrib/ethon/patcher.rb +2 -2
- data/lib/ddtrace/contrib/extensions.rb +3 -3
- data/lib/ddtrace/contrib/faraday/patcher.rb +2 -2
- data/lib/ddtrace/contrib/grape/instrumentation.rb +2 -2
- data/lib/ddtrace/contrib/grape/patcher.rb +1 -1
- data/lib/ddtrace/contrib/grpc/patcher.rb +1 -1
- data/lib/ddtrace/contrib/http/instrumentation.rb +1 -1
- data/lib/ddtrace/contrib/http/patcher.rb +1 -1
- data/lib/ddtrace/contrib/httpclient/instrumentation.rb +1 -1
- data/lib/ddtrace/contrib/httpclient/patcher.rb +1 -1
- data/lib/ddtrace/contrib/httprb/instrumentation.rb +1 -1
- data/lib/ddtrace/contrib/httprb/patcher.rb +1 -1
- data/lib/ddtrace/contrib/integration.rb +3 -3
- data/lib/ddtrace/contrib/kafka/event.rb +2 -2
- data/lib/ddtrace/contrib/mongodb/instrumentation.rb +2 -2
- data/lib/ddtrace/contrib/mongodb/patcher.rb +2 -2
- data/lib/ddtrace/contrib/mysql2/instrumentation.rb +1 -1
- data/lib/ddtrace/contrib/mysql2/patcher.rb +1 -1
- data/lib/ddtrace/contrib/patchable.rb +2 -2
- data/lib/ddtrace/contrib/patcher.rb +2 -2
- data/lib/ddtrace/contrib/presto/instrumentation.rb +1 -1
- data/lib/ddtrace/contrib/presto/patcher.rb +1 -1
- data/lib/ddtrace/contrib/qless/patcher.rb +3 -5
- data/lib/ddtrace/contrib/racecar/event.rb +2 -2
- data/lib/ddtrace/contrib/rake/instrumentation.rb +1 -1
- data/lib/ddtrace/contrib/rake/patcher.rb +1 -1
- data/lib/ddtrace/contrib/registerable.rb +2 -2
- data/lib/ddtrace/contrib/resque/patcher.rb +1 -1
- data/lib/ddtrace/contrib/rest_client/patcher.rb +1 -1
- data/lib/ddtrace/contrib/rest_client/request_patch.rb +1 -1
- data/lib/ddtrace/contrib/sequel/database.rb +1 -1
- data/lib/ddtrace/contrib/sequel/dataset.rb +1 -1
- data/lib/ddtrace/contrib/sequel/patcher.rb +2 -2
- data/lib/ddtrace/contrib/sinatra/patcher.rb +1 -1
- data/lib/ddtrace/contrib/sucker_punch/exception_handler.rb +4 -6
- data/lib/ddtrace/diagnostics/environment_logger.rb +2 -2
- data/lib/ddtrace/error.rb +52 -61
- data/lib/ddtrace/ext/app_types.rb +0 -1
- data/lib/ddtrace/ext/test.rb +2 -18
- data/lib/ddtrace/metrics.rb +28 -3
- data/lib/ddtrace/opentelemetry/extensions.rb +1 -1
- data/lib/ddtrace/opentracer.rb +20 -39
- data/lib/ddtrace/patcher.rb +2 -2
- data/lib/ddtrace/profiling.rb +11 -9
- data/lib/ddtrace/profiling/collectors/stack.rb +5 -2
- data/lib/ddtrace/profiling/encoding/profile.rb +6 -0
- data/lib/ddtrace/profiling/ext/cpu.rb +2 -2
- data/lib/ddtrace/profiling/ext/cthread.rb +9 -11
- data/lib/ddtrace/profiling/ext/forking.rb +7 -7
- data/lib/ddtrace/profiling/flush.rb +3 -1
- data/lib/ddtrace/profiling/pprof/builder.rb +26 -28
- data/lib/ddtrace/profiling/pprof/converter.rb +4 -0
- data/lib/ddtrace/profiling/pprof/stack_sample.rb +17 -1
- data/lib/ddtrace/profiling/pprof/template.rb +4 -0
- data/lib/ddtrace/profiling/scheduler.rb +12 -1
- data/lib/ddtrace/profiling/tasks/setup.rb +13 -13
- data/lib/ddtrace/profiling/transport/http/api/endpoint.rb +11 -2
- data/lib/ddtrace/runtime/metrics.rb +3 -5
- data/lib/ddtrace/sync_writer.rb +2 -1
- data/lib/ddtrace/tracer.rb +8 -4
- data/lib/ddtrace/transport/http/statistics.rb +2 -2
- data/lib/ddtrace/transport/http/traces.rb +3 -3
- data/lib/ddtrace/transport/io/traces.rb +1 -1
- data/lib/ddtrace/utils/forking.rb +1 -1
- data/lib/ddtrace/utils/object_set.rb +3 -5
- data/lib/ddtrace/utils/time.rb +1 -3
- data/lib/ddtrace/version.rb +2 -4
- data/lib/ddtrace/workers.rb +1 -1
- data/lib/ddtrace/workers/async.rb +3 -2
- data/lib/ddtrace/workers/loop.rb +1 -1
- data/lib/ddtrace/workers/polling.rb +11 -5
- data/lib/ddtrace/workers/queue.rb +1 -1
- metadata +48 -34
- data/.circleci/images/primary/Dockerfile-2.0.0 +0 -83
- data/gemfiles/ruby_2.0.0_contrib_old.gemfile +0 -64
- data/gemfiles/ruby_2.0.0_contrib_old.gemfile.lock +0 -290
- data/gemfiles/ruby_2.0.0_core_old.gemfile +0 -33
- data/gemfiles/ruby_2.0.0_core_old.gemfile.lock +0 -118
- data/gemfiles/ruby_2.0.0_rails30_postgres.gemfile +0 -39
- data/gemfiles/ruby_2.0.0_rails30_postgres.gemfile.lock +0 -196
- data/gemfiles/ruby_2.0.0_rails30_postgres_sidekiq.gemfile +0 -40
- data/gemfiles/ruby_2.0.0_rails30_postgres_sidekiq.gemfile.lock +0 -205
- data/gemfiles/ruby_2.0.0_rails32_mysql2.gemfile +0 -43
- data/gemfiles/ruby_2.0.0_rails32_mysql2.gemfile.lock +0 -217
- data/gemfiles/ruby_2.0.0_rails32_postgres.gemfile +0 -39
- data/gemfiles/ruby_2.0.0_rails32_postgres.gemfile.lock +0 -204
- data/gemfiles/ruby_2.0.0_rails32_postgres_redis.gemfile +0 -41
- data/gemfiles/ruby_2.0.0_rails32_postgres_redis.gemfile.lock +0 -223
- data/gemfiles/ruby_2.0.0_rails32_postgres_sidekiq.gemfile +0 -40
- data/gemfiles/ruby_2.0.0_rails32_postgres_sidekiq.gemfile.lock +0 -213
- data/integration/images/ruby/2.0/Dockerfile +0 -54
- data/lib/ddtrace/contrib/cucumber/configuration/settings.rb +0 -28
- data/lib/ddtrace/contrib/cucumber/ext.rb +0 -17
- data/lib/ddtrace/contrib/cucumber/formatter.rb +0 -98
- data/lib/ddtrace/contrib/cucumber/instrumentation.rb +0 -24
- data/lib/ddtrace/contrib/cucumber/integration.rb +0 -45
- data/lib/ddtrace/contrib/cucumber/patcher.rb +0 -23
- data/lib/ddtrace/contrib/rspec/configuration/settings.rb +0 -28
- data/lib/ddtrace/contrib/rspec/example.rb +0 -75
- data/lib/ddtrace/contrib/rspec/ext.rb +0 -16
- data/lib/ddtrace/contrib/rspec/integration.rb +0 -46
- data/lib/ddtrace/contrib/rspec/patcher.rb +0 -23
- data/lib/ddtrace/ext/ci.rb +0 -297
@@ -0,0 +1,25 @@
|
|
1
|
+
# Select base image
|
2
|
+
ARG BASE_IMAGE
|
3
|
+
FROM ${BASE_IMAGE}
|
4
|
+
|
5
|
+
# Setup directory
|
6
|
+
RUN mkdir /app
|
7
|
+
WORKDIR /app
|
8
|
+
|
9
|
+
# Setup specific version of ddtrace, if specified.
|
10
|
+
ARG ddtrace_git
|
11
|
+
ENV DD_DEMO_ENV_GEM_GIT_DDTRACE ${ddtrace_git}
|
12
|
+
|
13
|
+
ARG ddtrace_ref
|
14
|
+
ENV DD_DEMO_ENV_GEM_REF_DDTRACE ${ddtrace_ref}
|
15
|
+
|
16
|
+
# Install dependencies
|
17
|
+
COPY Gemfile /app/Gemfile
|
18
|
+
RUN bundle install
|
19
|
+
|
20
|
+
# Add files
|
21
|
+
COPY . /app
|
22
|
+
|
23
|
+
# Set entrypoint
|
24
|
+
ENTRYPOINT ["/bin/bash", "-c"]
|
25
|
+
CMD ["bin/setup && bin/run"]
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# Select base image
|
2
|
+
ARG BASE_IMAGE
|
3
|
+
FROM ${BASE_IMAGE}
|
4
|
+
|
5
|
+
# Add gem
|
6
|
+
COPY . /vendor/dd-trace-rb
|
7
|
+
|
8
|
+
# Install dependencies
|
9
|
+
# Setup specific version of ddtrace, if specified.
|
10
|
+
ENV DD_DEMO_ENV_GEM_LOCAL_DDTRACE /vendor/dd-trace-rb
|
11
|
+
RUN bundle install
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'datadog/demo_env'
|
2
|
+
|
3
|
+
source 'https://rubygems.org' do
|
4
|
+
gem 'ffi'
|
5
|
+
gem 'google-protobuf'
|
6
|
+
|
7
|
+
# Choose correct specs for 'ddtrace' demo environment
|
8
|
+
gem 'ddtrace', *Datadog::DemoEnv.gem_spec('ddtrace')
|
9
|
+
|
10
|
+
gem 'byebug'
|
11
|
+
|
12
|
+
# Testing/CI
|
13
|
+
gem 'rspec'
|
14
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# RSpec: Demo application for Datadog APM
|
2
|
+
|
3
|
+
A generic RSpec test suite with some common use scenarios.
|
4
|
+
|
5
|
+
For generating Datadog APM traces and profiles.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Install [direnv](https://github.com/direnv/direnv) for applying local settings.
|
10
|
+
|
11
|
+
1. `cp .envrc.sample .envrc` and add your Datadog API key.
|
12
|
+
2. `direnv allow` to load the env var.
|
13
|
+
4. `docker-compose run --rm app bin/setup`
|
14
|
+
|
15
|
+
## Running the application
|
16
|
+
|
17
|
+
### To monitor performance of Docker containers with Datadog
|
18
|
+
|
19
|
+
```sh
|
20
|
+
docker run --rm --name dd-agent -v /var/run/docker.sock:/var/run/docker.sock:ro -v /proc/:/host/proc/:ro -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro -e API_KEY=$DD_API_KEY datadog/docker-dd-agent:latest
|
21
|
+
```
|
22
|
+
|
23
|
+
### Starting the application
|
24
|
+
|
25
|
+
Run `docker-compose up` to auto-start the application.
|
26
|
+
|
27
|
+
Alternatively, you can run it manually with:
|
28
|
+
|
29
|
+
```sh
|
30
|
+
docker-compose run --rm app bin/run <process>
|
31
|
+
```
|
32
|
+
|
33
|
+
The `<process>` argument is optional, and will default to `DD_DEMO_ENV_PROCESS` if not provided. See [Processes](#processes) for more details.
|
34
|
+
|
35
|
+
##### Processes
|
36
|
+
|
37
|
+
Within the container, run `bin/run <process>` where `<process>` is one of the following values:
|
38
|
+
|
39
|
+
- `rspec`: RSpec test suite.
|
40
|
+
- `irb`: IRB session
|
41
|
+
|
42
|
+
Alternatively, set `DD_DEMO_ENV_PROCESS` to run a particular process by default when `bin/run` is run.
|
43
|
+
|
44
|
+
##### Features
|
45
|
+
|
46
|
+
Set `DD_DEMO_ENV_FEATURES` to a comma-delimited list of any of the following values to activate the feature:
|
47
|
+
|
48
|
+
- `tracing`: Tracing instrumentation
|
49
|
+
- `profiling`: Profiling (NOTE: Must also set `DD_PROFILING_ENABLED` to match.)
|
50
|
+
- `debug`: Enable diagnostic debug mode
|
51
|
+
- `analytics`: Enable trace analytics
|
52
|
+
- `runtime_metrics`: Enable runtime metrics
|
53
|
+
- `pprof_to_file`: Dump profiling pprof to file instead of agent.
|
54
|
+
|
55
|
+
e.g. `DD_DEMO_ENV_FEATURES=tracing,profiling`
|
56
|
+
|
57
|
+
### Running integration tests
|
58
|
+
|
59
|
+
You can run integration tests using the following and substituting for the Ruby major and minor version (e.g. `2.7`)
|
60
|
+
|
61
|
+
```sh
|
62
|
+
./script/build-images -v <RUBY_VERSION>
|
63
|
+
./script/ci -v <RUBY_VERSION>
|
64
|
+
```
|
65
|
+
|
66
|
+
Or inside a running container:
|
67
|
+
|
68
|
+
```sh
|
69
|
+
./bin/test
|
70
|
+
```
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'datadog/demo_env'
|
2
|
+
require 'ddtrace'
|
3
|
+
|
4
|
+
Datadog.configure do |c|
|
5
|
+
c.diagnostics.debug = true if Datadog::DemoEnv.feature?('debug')
|
6
|
+
c.analytics_enabled = true if Datadog::DemoEnv.feature?('analytics')
|
7
|
+
c.runtime_metrics.enabled = true if Datadog::DemoEnv.feature?('runtime_metrics')
|
8
|
+
|
9
|
+
if Datadog::DemoEnv.feature?('pprof_to_file')
|
10
|
+
# Reconfigure transport to write pprof to file
|
11
|
+
c.profiling.exporter.transport = Datadog::DemoEnv.profiler_file_transport
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require_relative 'datadog'
|
2
|
+
|
3
|
+
def fib(n)
|
4
|
+
n <= 1 ? n : fib(n-1) + fib(n-2)
|
5
|
+
end
|
6
|
+
|
7
|
+
def trace(*options, &block)
|
8
|
+
raise ArgumentError('Must provide trace block') unless block_given?
|
9
|
+
|
10
|
+
if Datadog::DemoEnv.feature?('tracing')
|
11
|
+
Datadog.tracer.trace(*options, &block)
|
12
|
+
else
|
13
|
+
yield
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def generate_fib
|
18
|
+
loop do
|
19
|
+
n = rand(25..35)
|
20
|
+
|
21
|
+
trace('compute.fibonacci') do |span|
|
22
|
+
result = fib(n)
|
23
|
+
span.set_metric('operation.fibonacci.n', n)
|
24
|
+
span.set_metric('operation.fibonacci.result', result)
|
25
|
+
yield(span) if block_given?
|
26
|
+
end
|
27
|
+
|
28
|
+
sleep(0.1)
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# Start application process
|
4
|
+
puts "\n== Starting application process =="
|
5
|
+
|
6
|
+
profiling = Datadog::DemoEnv.feature?('profiling') ? 'DD_PROFILING_ENABLED=true ddtracerb exec ' : ''
|
7
|
+
process = (ARGV[0] || Datadog::DemoEnv.process)
|
8
|
+
command = case process
|
9
|
+
when 'rspec'
|
10
|
+
'bundle exec rspec'
|
11
|
+
when 'irb'
|
12
|
+
"bundle exec #{profiling}irb"
|
13
|
+
when nil, ''
|
14
|
+
abort("\n== ERROR: Must specify a application process! ==")
|
15
|
+
else
|
16
|
+
abort("\n== ERROR: Unknown application process '#{process}' ==")
|
17
|
+
end
|
18
|
+
|
19
|
+
puts "Run: #{command}"
|
20
|
+
Kernel.exec(command)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'fileutils'
|
3
|
+
include FileUtils
|
4
|
+
|
5
|
+
# path to your application root.
|
6
|
+
APP_ROOT = File.expand_path('..', __dir__)
|
7
|
+
|
8
|
+
def system!(*args)
|
9
|
+
puts "Run: #{args.join(' ')}"
|
10
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
11
|
+
end
|
12
|
+
|
13
|
+
chdir APP_ROOT do
|
14
|
+
puts "\n== Installing dependencies =="
|
15
|
+
system! 'gem install bundler --conservative'
|
16
|
+
system('bundle check') || system!('bundle install')
|
17
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'fileutils'
|
3
|
+
include FileUtils
|
4
|
+
|
5
|
+
# path to your application root.
|
6
|
+
APP_ROOT = File.expand_path('..', __dir__)
|
7
|
+
|
8
|
+
def system!(*args)
|
9
|
+
puts "Run: #{args.join(' ')}"
|
10
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
11
|
+
end
|
12
|
+
|
13
|
+
chdir APP_ROOT do
|
14
|
+
puts "\n== Performing setup =="
|
15
|
+
system!('./bin/setup')
|
16
|
+
|
17
|
+
puts "\n== Run test suite =="
|
18
|
+
# DEV: There are no RSpec tests right now.
|
19
|
+
# Re-enable this when we have something worth testing.
|
20
|
+
# system!('rspec')
|
21
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
version: '3.4'
|
2
|
+
services:
|
3
|
+
app:
|
4
|
+
# Build at dd-trace-rb level to copy in current code
|
5
|
+
# and use it as the `ddtrace` gem.
|
6
|
+
build:
|
7
|
+
context: ../../..
|
8
|
+
dockerfile: integration/apps/rspec/Dockerfile-ci
|
9
|
+
args:
|
10
|
+
BASE_IMAGE: ${APP_IMAGE}
|
11
|
+
depends_on:
|
12
|
+
- ddagent
|
13
|
+
environment:
|
14
|
+
- BUNDLE_GEMFILE=/app/Gemfile
|
15
|
+
- DD_AGENT_HOST=ddagent
|
16
|
+
- DD_METRIC_AGENT_PORT=8125
|
17
|
+
- DD_TRACE_AGENT_PORT=8126
|
18
|
+
- DD_HEALTH_METRICS_ENABLED=true
|
19
|
+
- DD_SERVICE=acme-rspec
|
20
|
+
- DD_PROFILING_ENABLED=true
|
21
|
+
# Use these to choose what is run
|
22
|
+
- DD_DEMO_ENV_PROCESS=rspec
|
23
|
+
- DD_DEMO_ENV_FEATURES=tracing
|
24
|
+
stdin_open: true
|
25
|
+
tty: true
|
26
|
+
ddagent:
|
27
|
+
image: datadog/dd-apm-demo:agent
|
28
|
+
environment:
|
29
|
+
- DD_APM_ENABLED=true
|
30
|
+
- DD_PROCESS_AGENT_ENABLED=false
|
31
|
+
- DD_BIND_HOST=0.0.0.0
|
32
|
+
- DD_API_KEY=invalid_api_key
|
33
|
+
- LOG_LEVEL=DEBUG
|
34
|
+
- DD_LOGS_STDOUT=yes
|
35
|
+
- DD_DOGSTATSD_NON_LOCAL_TRAFFIC=true
|
36
|
+
expose:
|
37
|
+
- "8125/udp"
|
38
|
+
- "8126"
|
39
|
+
# Build at dd-trace-rb level to copy in current code
|
40
|
+
# and use it as the `ddtrace` gem.
|
41
|
+
integration-tester:
|
42
|
+
build:
|
43
|
+
context: ../../..
|
44
|
+
dockerfile: integration/apps/rspec/Dockerfile-ci
|
45
|
+
args:
|
46
|
+
BASE_IMAGE: ${APP_IMAGE}
|
47
|
+
command: bin/test
|
48
|
+
# volumes:
|
49
|
+
# - .:/app
|
50
|
+
# - ../../images/include:/vendor/dd-demo
|
51
|
+
# - ../../..:/vendor/dd-trace-rb
|
@@ -0,0 +1,63 @@
|
|
1
|
+
version: '3.4'
|
2
|
+
services:
|
3
|
+
app:
|
4
|
+
build:
|
5
|
+
context: .
|
6
|
+
args:
|
7
|
+
BASE_IMAGE: datadog/dd-apm-demo:rb-3.0
|
8
|
+
depends_on:
|
9
|
+
- ddagent
|
10
|
+
environment:
|
11
|
+
- BUNDLE_GEMFILE=/app/Gemfile
|
12
|
+
- DD_AGENT_HOST=ddagent
|
13
|
+
- DD_METRIC_AGENT_PORT=8125
|
14
|
+
- DD_TRACE_AGENT_PORT=8126
|
15
|
+
- DD_HEALTH_METRICS_ENABLED=true
|
16
|
+
- DD_SERVICE=acme-rspec
|
17
|
+
- DD_PROFILING_ENABLED=true
|
18
|
+
# Use these to choose what is run
|
19
|
+
- DD_DEMO_ENV_PROCESS=rspec
|
20
|
+
- DD_DEMO_ENV_FEATURES=tracing
|
21
|
+
# Use this for a local version of ddtrace
|
22
|
+
- DD_DEMO_ENV_GEM_LOCAL_DDTRACE=/vendor/dd-trace-rb
|
23
|
+
# Use these for a specific revision of ddtrace
|
24
|
+
# - DD_DEMO_ENV_GEM_GIT_DDTRACE=https://github.com/DataDog/dd-trace-rb.git
|
25
|
+
# - DD_DEMO_ENV_GEM_REF_DDTRACE=f233336994315bfa04dac581387a8152bab8b85a
|
26
|
+
stdin_open: true
|
27
|
+
tty: true
|
28
|
+
volumes:
|
29
|
+
- .:/app
|
30
|
+
- ./data/app:/data/app
|
31
|
+
- bundle:/usr/local/bundle
|
32
|
+
- ../../images/include:/vendor/dd-demo
|
33
|
+
- ../../..:/vendor/dd-trace-rb
|
34
|
+
ddagent:
|
35
|
+
image: datadog/dd-apm-demo:agent
|
36
|
+
environment:
|
37
|
+
- DD_APM_ENABLED=true
|
38
|
+
- DD_PROCESS_AGENT_ENABLED=false
|
39
|
+
- DD_BIND_HOST=0.0.0.0
|
40
|
+
- DD_API_KEY
|
41
|
+
- LOG_LEVEL=DEBUG
|
42
|
+
- DD_LOGS_STDOUT=yes
|
43
|
+
- DD_DOGSTATSD_NON_LOCAL_TRAFFIC=true
|
44
|
+
expose:
|
45
|
+
- "8125/udp"
|
46
|
+
- "8126"
|
47
|
+
volumes:
|
48
|
+
- ../../images/agent/agent.yaml:/etc/datadog-agent/datadog.yaml
|
49
|
+
# For monitoring performance of containers (e.g. CPU, Memory, etc...)
|
50
|
+
# - type: bind
|
51
|
+
# source: ../../images/agent/agent.yaml
|
52
|
+
# target: /etc/datadog-agent/datadog.yaml
|
53
|
+
# - type: bind
|
54
|
+
# source: /var/run/docker.sock
|
55
|
+
# target: /var/run/docker.sock:ro
|
56
|
+
# - type: bind
|
57
|
+
# source: /proc/
|
58
|
+
# target: /host/proc/:ro
|
59
|
+
# - type: bind
|
60
|
+
# source: /sys/fs/cgroup/
|
61
|
+
# target: /host/sys/fs/cgroup:ro
|
62
|
+
volumes:
|
63
|
+
bundle:
|
@@ -0,0 +1,37 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
set -euo pipefail
|
3
|
+
|
4
|
+
APP_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
5
|
+
APP_DIR=${APP_SCRIPT_DIR%/script}
|
6
|
+
cd $APP_DIR
|
7
|
+
|
8
|
+
while getopts ":v:" opt; do
|
9
|
+
case $opt in
|
10
|
+
v)
|
11
|
+
APP_RUBY_VERSION=$OPTARG
|
12
|
+
;;
|
13
|
+
\?)
|
14
|
+
echo "Invalid option: -$OPTARG" >&2
|
15
|
+
exit 1
|
16
|
+
;;
|
17
|
+
:)
|
18
|
+
echo "Option -$OPTARG requires an argument." >&2
|
19
|
+
exit 1
|
20
|
+
;;
|
21
|
+
esac
|
22
|
+
done
|
23
|
+
|
24
|
+
echo "== Building Ruby app images... =="
|
25
|
+
if [ -v APP_RUBY_VERSION ]; then
|
26
|
+
docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-$APP_RUBY_VERSION -t datadog/dd-apm-demo:rb-$APP_RUBY_VERSION-rspec .
|
27
|
+
else
|
28
|
+
docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-2.1 -t datadog/dd-apm-demo:rb-2.1-rspec .
|
29
|
+
docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-2.2 -t datadog/dd-apm-demo:rb-2.2-rspec .
|
30
|
+
docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-2.3 -t datadog/dd-apm-demo:rb-2.3-rspec .
|
31
|
+
docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-2.4 -t datadog/dd-apm-demo:rb-2.4-rspec .
|
32
|
+
docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-2.5 -t datadog/dd-apm-demo:rb-2.5-rspec .
|
33
|
+
docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-2.6 -t datadog/dd-apm-demo:rb-2.6-rspec .
|
34
|
+
docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-2.7 -t datadog/dd-apm-demo:rb-2.7-rspec .
|
35
|
+
docker build --build-arg BASE_IMAGE=datadog/dd-apm-demo:rb-3.0 -t datadog/dd-apm-demo:rb-3.0-rspec .
|
36
|
+
fi
|
37
|
+
echo "== Done building Ruby app images. =="
|
@@ -0,0 +1,53 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
set -euo pipefail
|
3
|
+
|
4
|
+
APP_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
5
|
+
APP_DIR=${APP_SCRIPT_DIR%/script}
|
6
|
+
cd $APP_DIR
|
7
|
+
|
8
|
+
# Parse options
|
9
|
+
while getopts "v:" opt; do
|
10
|
+
case $opt in
|
11
|
+
v)
|
12
|
+
APP_RUBY_VERSION=$OPTARG
|
13
|
+
;;
|
14
|
+
\?)
|
15
|
+
echo "Invalid option: -$OPTARG" >&2
|
16
|
+
exit 1
|
17
|
+
;;
|
18
|
+
:)
|
19
|
+
echo "Option -$OPTARG requires an argument." >&2
|
20
|
+
exit 1
|
21
|
+
;;
|
22
|
+
esac
|
23
|
+
done
|
24
|
+
|
25
|
+
# Validate options
|
26
|
+
if [ -z ${APP_RUBY_VERSION+x} ]; then
|
27
|
+
echo "You must specify a Ruby version with -v. (e.g. 2.7)" >&2
|
28
|
+
exit 1
|
29
|
+
fi
|
30
|
+
|
31
|
+
# Set configuration
|
32
|
+
APP_BASE_IMAGE=${APP_BASE_IMAGE:-datadog/dd-apm-demo:rb-$APP_RUBY_VERSION}
|
33
|
+
APP_IMAGE=${APP_IMAGE:-$APP_BASE_IMAGE-rspec}
|
34
|
+
APP_COMPOSE_FILES="-f docker-compose.ci.yml"
|
35
|
+
|
36
|
+
echo "== Running integration tests... =="
|
37
|
+
echo " - App: rspec"
|
38
|
+
echo " - Ruby version: $APP_RUBY_VERSION"
|
39
|
+
echo " - Base image: $APP_BASE_IMAGE"
|
40
|
+
echo " - App image: $APP_IMAGE"
|
41
|
+
echo ""
|
42
|
+
|
43
|
+
# Pull/build any missing images
|
44
|
+
APP_IMAGE=$APP_IMAGE docker-compose $APP_COMPOSE_FILES build
|
45
|
+
|
46
|
+
# Run the test suite
|
47
|
+
# NOTE: Normally we run "integration-tester" but in this case, the app is the test suite.
|
48
|
+
# Just run the app instead.
|
49
|
+
# It's expected to produce test failures and raise an exit code. Ignore this.
|
50
|
+
APP_IMAGE=$APP_IMAGE docker-compose $APP_COMPOSE_FILES run app || true
|
51
|
+
|
52
|
+
# Cleanup
|
53
|
+
APP_IMAGE=$APP_IMAGE docker-compose $APP_COMPOSE_FILES down -t 0 --remove-orphans
|