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,16 @@
|
|
1
|
+
require_relative '../app/fibonacci'
|
2
|
+
|
3
|
+
# Test some library functions
|
4
|
+
RSpec.describe '#fib' do
|
5
|
+
subject(:call_fib) { fib(n) }
|
6
|
+
let(:n) { rand(25..35) }
|
7
|
+
|
8
|
+
it { is_expected.to be_a_kind_of(Integer) }
|
9
|
+
|
10
|
+
context 'given a smaller and larger number' do
|
11
|
+
let(:smaller_fib) { fib(n) }
|
12
|
+
let(:larger_fib) { fib(n+1) }
|
13
|
+
|
14
|
+
it { expect(larger_fib).to be > smaller_fib }
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# Test some RSpec behavior
|
2
|
+
# NOTE: This file is expected to always produce some test errors!
|
3
|
+
# So that we can
|
4
|
+
RSpec.describe 'RSpec behavior' do
|
5
|
+
shared_examples_for 'correct behavior' do
|
6
|
+
it 'passes' do
|
7
|
+
expect(1).to be < 2
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
shared_examples_for 'incorrect behavior' do
|
12
|
+
it 'fails' do
|
13
|
+
expect(2).to be < 1
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'passes correct assertions' do
|
18
|
+
expect(1).to be < 2
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'fails incorrect assertions' do
|
22
|
+
expect(2).to be < 1
|
23
|
+
end
|
24
|
+
|
25
|
+
it_behaves_like 'correct behavior'
|
26
|
+
it_behaves_like 'incorrect behavior'
|
27
|
+
|
28
|
+
context 'context' do
|
29
|
+
it_behaves_like 'correct behavior'
|
30
|
+
it_behaves_like 'incorrect behavior'
|
31
|
+
end
|
32
|
+
|
33
|
+
context 'in a' do
|
34
|
+
context 'deeply' do
|
35
|
+
context 'nested' do
|
36
|
+
context 'context' do
|
37
|
+
it 'passes correct assertions' do
|
38
|
+
expect(1).to be < 2
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'fails incorrect assertions' do
|
42
|
+
expect(2).to be < 1
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
context 'when calling traced code' do
|
50
|
+
it 'wraps the RSpec instrumentation around the traced code' do
|
51
|
+
Datadog.tracer.trace('code_under_test') do |span|
|
52
|
+
time_to_run = rand
|
53
|
+
sleep(rand)
|
54
|
+
span.set_tag('run_time', time_to_run)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'datadog/ci'
|
2
|
+
|
3
|
+
# Enable CI tracing
|
4
|
+
Datadog.configure do |c|
|
5
|
+
c.ci_mode.enabled = true
|
6
|
+
c.use :rspec
|
7
|
+
end
|
8
|
+
|
9
|
+
RSpec.configure do |config|
|
10
|
+
config.expect_with :rspec do |expectations|
|
11
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
12
|
+
end
|
13
|
+
|
14
|
+
config.mock_with :rspec do |mocks|
|
15
|
+
mocks.verify_partial_doubles = true
|
16
|
+
end
|
17
|
+
|
18
|
+
config.shared_context_metadata_behavior = :apply_to_host_groups
|
19
|
+
config.filter_run_when_matching :focus
|
20
|
+
config.disable_monkey_patching!
|
21
|
+
config.profile_examples = 10
|
22
|
+
config.order = :random
|
23
|
+
Kernel.srand config.seed
|
24
|
+
end
|
@@ -43,7 +43,7 @@ Within the container, run `bin/run <process>` where `<process>` is one of the fo
|
|
43
43
|
|
44
44
|
##### Features
|
45
45
|
|
46
|
-
Set `
|
46
|
+
Set `DD_DEMO_ENV_FEATURES` to a comma-delimited list of any of the following values to activate the feature:
|
47
47
|
|
48
48
|
- `tracing`: Tracing instrumentation
|
49
49
|
- `profiling`: Profiling (NOTE: Must also set `DD_PROFILING_ENABLED` to match.)
|
@@ -52,7 +52,7 @@ Set `DD_DEMO_ENV_PROCESS` to a comma-delimited list of any of the following valu
|
|
52
52
|
- `runtime_metrics`: Enable runtime metrics
|
53
53
|
- `pprof_to_file`: Dump profiling pprof to file instead of agent.
|
54
54
|
|
55
|
-
e.g. `
|
55
|
+
e.g. `DD_DEMO_ENV_FEATURES=tracing,profiling`
|
56
56
|
|
57
57
|
### Running integration tests
|
58
58
|
|
@@ -44,7 +44,8 @@ echo ""
|
|
44
44
|
APP_IMAGE=$APP_IMAGE docker-compose $APP_COMPOSE_FILES build
|
45
45
|
|
46
46
|
# Run the test suite
|
47
|
-
APP_IMAGE=$APP_IMAGE docker-compose $APP_COMPOSE_FILES run integration-tester
|
47
|
+
APP_IMAGE=$APP_IMAGE docker-compose $APP_COMPOSE_FILES run integration-tester || \
|
48
|
+
APP_IMAGE=$APP_IMAGE docker-compose $APP_COMPOSE_FILES logs # Print container logs on `run` failure
|
48
49
|
|
49
50
|
# Cleanup
|
50
51
|
APP_IMAGE=$APP_IMAGE docker-compose $APP_COMPOSE_FILES down -t 0 --remove-orphans
|
data/lib/datadog/ci.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'ddtrace'
|
2
|
+
|
3
|
+
module Datadog
|
4
|
+
# Namespace for Datadog CI instrumentation:
|
5
|
+
# e.g. rspec, cucumber, etc...
|
6
|
+
module CI
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
# Integrations
|
11
|
+
require 'datadog/ci/contrib/cucumber/integration'
|
12
|
+
require 'datadog/ci/contrib/rspec/integration'
|
13
|
+
|
14
|
+
# Extensions
|
15
|
+
require 'datadog/ci/extensions'
|
16
|
+
Datadog::CI::Extensions.activate!
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'datadog/ci/context_flush'
|
2
|
+
|
3
|
+
module Datadog
|
4
|
+
module CI
|
5
|
+
module Configuration
|
6
|
+
# Adds CI behavior to Datadog trace components
|
7
|
+
module Components
|
8
|
+
def initialize(settings)
|
9
|
+
# Activate CI mode if enabled
|
10
|
+
activate_ci_mode!(settings) if settings.ci_mode.enabled
|
11
|
+
|
12
|
+
# Initialize normally
|
13
|
+
super
|
14
|
+
end
|
15
|
+
|
16
|
+
def activate_ci_mode!(settings)
|
17
|
+
# Activate underlying tracing test mode
|
18
|
+
settings.test_mode.enabled = true
|
19
|
+
|
20
|
+
# Choose user defined ContextFlush or default to CI ContextFlush
|
21
|
+
settings.test_mode.context_flush = settings.ci_mode.context_flush \
|
22
|
+
|| Datadog::CI::ContextFlush::Finished.new
|
23
|
+
|
24
|
+
# Pass through any other options
|
25
|
+
settings.test_mode.writer_options = settings.ci_mode.writer_options
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'datadog/ci/ext/settings'
|
2
|
+
|
3
|
+
module Datadog
|
4
|
+
module CI
|
5
|
+
module Configuration
|
6
|
+
# Adds CI behavior to Datadog trace settings
|
7
|
+
module Settings
|
8
|
+
def self.extended(base)
|
9
|
+
base = base.singleton_class unless base.is_a?(Class)
|
10
|
+
add_settings!(base)
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.add_settings!(base)
|
14
|
+
base.class_eval do
|
15
|
+
settings :ci_mode do
|
16
|
+
option :enabled do |o|
|
17
|
+
o.default { env_to_bool(Datadog::CI::Ext::Settings::ENV_MODE_ENABLED, false) }
|
18
|
+
o.lazy
|
19
|
+
end
|
20
|
+
|
21
|
+
option :context_flush do |o|
|
22
|
+
o.default { nil }
|
23
|
+
o.lazy
|
24
|
+
end
|
25
|
+
|
26
|
+
option :writer_options do |o|
|
27
|
+
o.default { {} }
|
28
|
+
o.lazy
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'ddtrace/context_flush'
|
2
|
+
|
3
|
+
module Datadog
|
4
|
+
module CI
|
5
|
+
module ContextFlush
|
6
|
+
# Common behavior for CI flushing
|
7
|
+
module Tagging
|
8
|
+
# Decorate a trace with CI tags
|
9
|
+
def get_trace(context)
|
10
|
+
context.get do |trace|
|
11
|
+
# Origin tag is required on every span
|
12
|
+
trace.each { |span| context.attach_origin(span) } if trace
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
# Consumes only completed traces (where all spans have finished)
|
18
|
+
class Finished < Datadog::ContextFlush::Finished
|
19
|
+
prepend Tagging
|
20
|
+
end
|
21
|
+
|
22
|
+
# Performs partial trace flushing to avoid large traces residing in memory for too long
|
23
|
+
class Partial < Datadog::ContextFlush::Partial
|
24
|
+
prepend Tagging
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'ddtrace/contrib/configuration/settings'
|
2
|
+
require 'datadog/ci/contrib/cucumber/ext'
|
3
|
+
|
4
|
+
module Datadog
|
5
|
+
module CI
|
6
|
+
module Contrib
|
7
|
+
module Cucumber
|
8
|
+
module Configuration
|
9
|
+
# Custom settings for the Cucumber integration
|
10
|
+
class Settings < Datadog::Contrib::Configuration::Settings
|
11
|
+
option :enabled do |o|
|
12
|
+
o.default { env_to_bool(Ext::ENV_ENABLED, true) }
|
13
|
+
o.lazy
|
14
|
+
end
|
15
|
+
|
16
|
+
option :service_name do |o|
|
17
|
+
o.default { Datadog.configuration.service || Ext::SERVICE_NAME }
|
18
|
+
o.lazy
|
19
|
+
end
|
20
|
+
|
21
|
+
option :operation_name do |o|
|
22
|
+
o.default { ENV.key?(Ext::ENV_OPERATION_NAME) ? ENV[Ext::ENV_OPERATION_NAME] : Ext::OPERATION_NAME }
|
23
|
+
o.lazy
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Datadog
|
2
|
+
module CI
|
3
|
+
module Contrib
|
4
|
+
module Cucumber
|
5
|
+
# Cucumber integration constants
|
6
|
+
module Ext
|
7
|
+
APP = 'cucumber'.freeze
|
8
|
+
ENV_ENABLED = 'DD_TRACE_CUCUMBER_ENABLED'.freeze
|
9
|
+
ENV_OPERATION_NAME = 'DD_TRACE_CUCUMBER_OPERATION_NAME'.freeze
|
10
|
+
FRAMEWORK = 'cucumber'.freeze
|
11
|
+
OPERATION_NAME = 'cucumber.test'.freeze
|
12
|
+
SERVICE_NAME = 'cucumber'.freeze
|
13
|
+
STEP_SPAN_TYPE = 'step'.freeze
|
14
|
+
TEST_TYPE = 'test'.freeze
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
require 'datadog/ci/test'
|
2
|
+
require 'datadog/ci/ext/app_types'
|
3
|
+
require 'datadog/ci/ext/environment'
|
4
|
+
require 'datadog/ci/ext/test'
|
5
|
+
require 'datadog/ci/contrib/cucumber/ext'
|
6
|
+
|
7
|
+
module Datadog
|
8
|
+
module CI
|
9
|
+
module Contrib
|
10
|
+
module Cucumber
|
11
|
+
# Defines collection of instrumented Cucumber events
|
12
|
+
class Formatter
|
13
|
+
attr_reader :config, :current_feature_span, :current_step_span
|
14
|
+
private :config
|
15
|
+
private :current_feature_span, :current_step_span
|
16
|
+
|
17
|
+
def initialize(config)
|
18
|
+
@config = config
|
19
|
+
|
20
|
+
bind_events(config)
|
21
|
+
end
|
22
|
+
|
23
|
+
def bind_events(config)
|
24
|
+
config.on_event :test_case_started, &method(:on_test_case_started)
|
25
|
+
config.on_event :test_case_finished, &method(:on_test_case_finished)
|
26
|
+
config.on_event :test_step_started, &method(:on_test_step_started)
|
27
|
+
config.on_event :test_step_finished, &method(:on_test_step_finished)
|
28
|
+
end
|
29
|
+
|
30
|
+
def on_test_case_started(event)
|
31
|
+
@current_feature_span = CI::Test.trace(
|
32
|
+
tracer,
|
33
|
+
configuration[:operation_name],
|
34
|
+
{
|
35
|
+
span_options: {
|
36
|
+
app: Ext::APP,
|
37
|
+
resource: event.test_case.name,
|
38
|
+
service: configuration[:service_name]
|
39
|
+
},
|
40
|
+
framework: Ext::FRAMEWORK,
|
41
|
+
test_name: event.test_case.name,
|
42
|
+
test_suite: event.test_case.location.file,
|
43
|
+
test_type: Ext::TEST_TYPE
|
44
|
+
}
|
45
|
+
)
|
46
|
+
end
|
47
|
+
|
48
|
+
def on_test_case_finished(event)
|
49
|
+
return if @current_feature_span.nil?
|
50
|
+
|
51
|
+
if event.result.skipped?
|
52
|
+
CI::Test.skipped!(@current_feature_span)
|
53
|
+
elsif event.result.ok?
|
54
|
+
CI::Test.passed!(@current_feature_span)
|
55
|
+
elsif event.result.failed?
|
56
|
+
CI::Test.failed!(@current_feature_span)
|
57
|
+
end
|
58
|
+
|
59
|
+
@current_feature_span.finish
|
60
|
+
end
|
61
|
+
|
62
|
+
def on_test_step_started(event)
|
63
|
+
trace_options = {
|
64
|
+
resource: event.test_step.to_s,
|
65
|
+
span_type: Ext::STEP_SPAN_TYPE
|
66
|
+
}
|
67
|
+
@current_step_span = tracer.trace(Ext::STEP_SPAN_TYPE, trace_options)
|
68
|
+
end
|
69
|
+
|
70
|
+
def on_test_step_finished(event)
|
71
|
+
return if @current_step_span.nil?
|
72
|
+
|
73
|
+
if event.result.skipped?
|
74
|
+
CI::Test.skipped!(@current_step_span, event.result.exception)
|
75
|
+
elsif event.result.ok?
|
76
|
+
CI::Test.passed!(@current_step_span)
|
77
|
+
elsif event.result.failed?
|
78
|
+
CI::Test.failed!(@current_step_span, event.result.exception)
|
79
|
+
end
|
80
|
+
|
81
|
+
@current_step_span.finish
|
82
|
+
end
|
83
|
+
|
84
|
+
private
|
85
|
+
|
86
|
+
def configuration
|
87
|
+
Datadog.configuration[:cucumber]
|
88
|
+
end
|
89
|
+
|
90
|
+
def tracer
|
91
|
+
configuration[:tracer]
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'datadog/ci/contrib/cucumber/formatter'
|
2
|
+
|
3
|
+
module Datadog
|
4
|
+
module CI
|
5
|
+
module Contrib
|
6
|
+
module Cucumber
|
7
|
+
# Instrumentation for Cucumber
|
8
|
+
module Instrumentation
|
9
|
+
def self.included(base)
|
10
|
+
base.prepend(InstanceMethods)
|
11
|
+
end
|
12
|
+
|
13
|
+
# Instance methods for configuration
|
14
|
+
module InstanceMethods
|
15
|
+
attr_reader :datadog_formatter
|
16
|
+
|
17
|
+
def formatters
|
18
|
+
@datadog_formatter ||= Datadog::CI::Contrib::Cucumber::Formatter.new(@configuration)
|
19
|
+
[@datadog_formatter] + super
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'ddtrace/contrib/integration'
|
2
|
+
|
3
|
+
require 'datadog/ci/contrib/cucumber/configuration/settings'
|
4
|
+
require 'datadog/ci/contrib/cucumber/patcher'
|
5
|
+
|
6
|
+
module Datadog
|
7
|
+
module CI
|
8
|
+
module Contrib
|
9
|
+
module Cucumber
|
10
|
+
# Description of Cucumber integration
|
11
|
+
class Integration
|
12
|
+
include Datadog::Contrib::Integration
|
13
|
+
|
14
|
+
MINIMUM_VERSION = Gem::Version.new('3.0.0')
|
15
|
+
|
16
|
+
register_as :cucumber, auto_patch: true
|
17
|
+
|
18
|
+
def self.version
|
19
|
+
Gem.loaded_specs['cucumber'] \
|
20
|
+
&& Gem.loaded_specs['cucumber'].version
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.loaded?
|
24
|
+
!defined?(::Cucumber).nil? && !defined?(::Cucumber::Runtime).nil?
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.compatible?
|
28
|
+
super && version >= MINIMUM_VERSION
|
29
|
+
end
|
30
|
+
|
31
|
+
# test environments should not auto instrument test libraries
|
32
|
+
def auto_instrument?
|
33
|
+
false
|
34
|
+
end
|
35
|
+
|
36
|
+
def default_configuration
|
37
|
+
Configuration::Settings.new
|
38
|
+
end
|
39
|
+
|
40
|
+
def patcher
|
41
|
+
Patcher
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|