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
|
+
require 'ddtrace/contrib/patcher'
|
2
|
+
require 'datadog/ci/contrib/cucumber/instrumentation'
|
3
|
+
|
4
|
+
module Datadog
|
5
|
+
module CI
|
6
|
+
module Contrib
|
7
|
+
module Cucumber
|
8
|
+
# Patcher enables patching of 'cucumber' module.
|
9
|
+
module Patcher
|
10
|
+
include Datadog::Contrib::Patcher
|
11
|
+
|
12
|
+
module_function
|
13
|
+
|
14
|
+
def target_version
|
15
|
+
Integration.version
|
16
|
+
end
|
17
|
+
|
18
|
+
def patch
|
19
|
+
::Cucumber::Runtime.include(Instrumentation)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'ddtrace/contrib/configuration/settings'
|
2
|
+
require 'datadog/ci/contrib/rspec/ext'
|
3
|
+
|
4
|
+
module Datadog
|
5
|
+
module CI
|
6
|
+
module Contrib
|
7
|
+
module RSpec
|
8
|
+
module Configuration
|
9
|
+
# Custom settings for the RSpec 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,73 @@
|
|
1
|
+
require 'datadog/ci/test'
|
2
|
+
|
3
|
+
require 'datadog/ci/ext/app_types'
|
4
|
+
require 'datadog/ci/ext/environment'
|
5
|
+
require 'datadog/ci/ext/test'
|
6
|
+
require 'datadog/ci/contrib/rspec/ext'
|
7
|
+
|
8
|
+
module Datadog
|
9
|
+
module CI
|
10
|
+
module Contrib
|
11
|
+
module RSpec
|
12
|
+
# Instrument RSpec::Core::Example
|
13
|
+
module Example
|
14
|
+
def self.included(base)
|
15
|
+
base.prepend(InstanceMethods)
|
16
|
+
end
|
17
|
+
|
18
|
+
# Instance methods for configuration
|
19
|
+
module InstanceMethods
|
20
|
+
def run(example_group_instance, reporter)
|
21
|
+
return super unless configuration[:enabled]
|
22
|
+
|
23
|
+
test_name = full_description.strip
|
24
|
+
if metadata[:description].empty?
|
25
|
+
# for unnamed it blocks this appends something like "example at ./spec/some_spec.rb:10"
|
26
|
+
test_name += " #{description}"
|
27
|
+
end
|
28
|
+
|
29
|
+
CI::Test.trace(
|
30
|
+
tracer,
|
31
|
+
configuration[:operation_name],
|
32
|
+
{
|
33
|
+
span_options: {
|
34
|
+
app: Ext::APP,
|
35
|
+
resource: test_name,
|
36
|
+
service: configuration[:service_name]
|
37
|
+
},
|
38
|
+
framework: Ext::FRAMEWORK,
|
39
|
+
test_name: test_name,
|
40
|
+
test_suite: file_path,
|
41
|
+
test_type: Ext::TEST_TYPE
|
42
|
+
}
|
43
|
+
) do |span|
|
44
|
+
result = super
|
45
|
+
|
46
|
+
case execution_result.status
|
47
|
+
when :passed
|
48
|
+
CI::Test.passed!(span)
|
49
|
+
when :failed
|
50
|
+
CI::Test.failed!(span, execution_result.exception)
|
51
|
+
else
|
52
|
+
CI::Test.skipped!(span, execution_result.exception) if execution_result.example_skipped?
|
53
|
+
end
|
54
|
+
|
55
|
+
result
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
private
|
60
|
+
|
61
|
+
def configuration
|
62
|
+
Datadog.configuration[:rspec]
|
63
|
+
end
|
64
|
+
|
65
|
+
def tracer
|
66
|
+
configuration[:tracer]
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Datadog
|
2
|
+
module CI
|
3
|
+
module Contrib
|
4
|
+
module RSpec
|
5
|
+
# RSpec integration constants
|
6
|
+
module Ext
|
7
|
+
APP = 'rspec'.freeze
|
8
|
+
ENV_ENABLED = 'DD_TRACE_RSPEC_ENABLED'.freeze
|
9
|
+
ENV_OPERATION_NAME = 'DD_TRACE_RSPEC_OPERATION_NAME'.freeze
|
10
|
+
FRAMEWORK = 'rspec'.freeze
|
11
|
+
OPERATION_NAME = 'rspec.example'.freeze
|
12
|
+
SERVICE_NAME = 'rspec'.freeze
|
13
|
+
TEST_TYPE = 'test'.freeze
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'ddtrace/contrib/integration'
|
2
|
+
|
3
|
+
require 'datadog/ci/contrib/rspec/configuration/settings'
|
4
|
+
require 'datadog/ci/contrib/rspec/patcher'
|
5
|
+
|
6
|
+
module Datadog
|
7
|
+
module CI
|
8
|
+
module Contrib
|
9
|
+
module RSpec
|
10
|
+
# Description of RSpec integration
|
11
|
+
class Integration
|
12
|
+
include Datadog::Contrib::Integration
|
13
|
+
|
14
|
+
MINIMUM_VERSION = Gem::Version.new('3.0.0')
|
15
|
+
|
16
|
+
register_as :rspec, auto_patch: true
|
17
|
+
|
18
|
+
def self.version
|
19
|
+
Gem.loaded_specs['rspec'] \
|
20
|
+
&& Gem.loaded_specs['rspec'].version
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.loaded?
|
24
|
+
!defined?(::RSpec).nil? && !defined?(::RSpec::Core).nil? && \
|
25
|
+
!defined?(::RSpec::Core::Example).nil?
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.compatible?
|
29
|
+
super && version >= MINIMUM_VERSION
|
30
|
+
end
|
31
|
+
|
32
|
+
# test environments should not auto instrument test libraries
|
33
|
+
def auto_instrument?
|
34
|
+
false
|
35
|
+
end
|
36
|
+
|
37
|
+
def default_configuration
|
38
|
+
Configuration::Settings.new
|
39
|
+
end
|
40
|
+
|
41
|
+
def patcher
|
42
|
+
Patcher
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'ddtrace/contrib/patcher'
|
2
|
+
require 'datadog/ci/contrib/rspec/example'
|
3
|
+
|
4
|
+
module Datadog
|
5
|
+
module CI
|
6
|
+
module Contrib
|
7
|
+
module RSpec
|
8
|
+
# Patcher enables patching of 'rspec' module.
|
9
|
+
module Patcher
|
10
|
+
include Datadog::Contrib::Patcher
|
11
|
+
|
12
|
+
module_function
|
13
|
+
|
14
|
+
def target_version
|
15
|
+
Integration.version
|
16
|
+
end
|
17
|
+
|
18
|
+
def patch
|
19
|
+
::RSpec::Core::Example.include(Example)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,303 @@
|
|
1
|
+
require 'ddtrace/ext/git'
|
2
|
+
|
3
|
+
module Datadog
|
4
|
+
module CI
|
5
|
+
module Ext
|
6
|
+
# Defines constants for CI tags
|
7
|
+
# rubocop:disable Metrics/ModuleLength:
|
8
|
+
module Environment
|
9
|
+
TAG_STAGE_NAME = 'ci.stage.name'.freeze
|
10
|
+
TAG_JOB_NAME = 'ci.job.name'.freeze
|
11
|
+
TAG_JOB_URL = 'ci.job.url'.freeze
|
12
|
+
TAG_PIPELINE_ID = 'ci.pipeline.id'.freeze
|
13
|
+
TAG_PIPELINE_NAME = 'ci.pipeline.name'.freeze
|
14
|
+
TAG_PIPELINE_NUMBER = 'ci.pipeline.number'.freeze
|
15
|
+
TAG_PIPELINE_URL = 'ci.pipeline.url'.freeze
|
16
|
+
TAG_PROVIDER_NAME = 'ci.provider.name'.freeze
|
17
|
+
TAG_WORKSPACE_PATH = 'ci.workspace_path'.freeze
|
18
|
+
|
19
|
+
PROVIDERS = [
|
20
|
+
['APPVEYOR'.freeze, :extract_appveyor],
|
21
|
+
['TF_BUILD'.freeze, :extract_azure_pipelines],
|
22
|
+
['BITBUCKET_COMMIT'.freeze, :extract_bitbucket],
|
23
|
+
['BUILDKITE'.freeze, :extract_buildkite],
|
24
|
+
['CIRCLECI'.freeze, :extract_circle_ci],
|
25
|
+
['GITHUB_SHA'.freeze, :extract_github_actions],
|
26
|
+
['GITLAB_CI'.freeze, :extract_gitlab],
|
27
|
+
['JENKINS_URL'.freeze, :extract_jenkins],
|
28
|
+
['TEAMCITY_VERSION'.freeze, :extract_teamcity],
|
29
|
+
['TRAVIS'.freeze, :extract_travis],
|
30
|
+
['BITRISE_BUILD_SLUG'.freeze, :extract_bitrise]
|
31
|
+
].freeze
|
32
|
+
|
33
|
+
module_function
|
34
|
+
|
35
|
+
def tags(env)
|
36
|
+
provider = PROVIDERS.find { |c| env.key? c[0] }
|
37
|
+
return {} if provider.nil?
|
38
|
+
|
39
|
+
tags = send(provider[1], env)
|
40
|
+
|
41
|
+
tags[Datadog::Ext::Git::TAG_TAG] = normalize_ref(tags[Datadog::Ext::Git::TAG_TAG])
|
42
|
+
tags.delete(Datadog::Ext::Git::TAG_BRANCH) unless tags[Datadog::Ext::Git::TAG_TAG].nil?
|
43
|
+
tags[Datadog::Ext::Git::TAG_BRANCH] = normalize_ref(tags[Datadog::Ext::Git::TAG_BRANCH])
|
44
|
+
tags[Datadog::Ext::Git::TAG_REPOSITORY_URL] = filter_sensitive_info(tags[Datadog::Ext::Git::TAG_REPOSITORY_URL])
|
45
|
+
|
46
|
+
# Expand ~
|
47
|
+
workspace_path = tags[TAG_WORKSPACE_PATH]
|
48
|
+
if !workspace_path.nil? && (workspace_path == '~' || workspace_path.start_with?('~/'))
|
49
|
+
tags[TAG_WORKSPACE_PATH] = File.expand_path(workspace_path)
|
50
|
+
end
|
51
|
+
tags.reject { |_, v| v.nil? }
|
52
|
+
end
|
53
|
+
|
54
|
+
def normalize_ref(name)
|
55
|
+
refs = %r{^refs/(heads/)?}
|
56
|
+
origin = %r{^origin/}
|
57
|
+
tags = %r{^tags/}
|
58
|
+
name.gsub(refs, '').gsub(origin, '').gsub(tags, '') unless name.nil?
|
59
|
+
end
|
60
|
+
|
61
|
+
def filter_sensitive_info(url)
|
62
|
+
url.gsub(%r{(https?://)[^/]*@}, '\1') unless url.nil?
|
63
|
+
end
|
64
|
+
|
65
|
+
# CI providers
|
66
|
+
|
67
|
+
def extract_appveyor(env)
|
68
|
+
url = "https://ci.appveyor.com/project/#{env['APPVEYOR_REPO_NAME']}/builds/#{env['APPVEYOR_BUILD_ID']}"
|
69
|
+
|
70
|
+
if env['APPVEYOR_REPO_PROVIDER'] == 'github'
|
71
|
+
repository = "https://github.com/#{env['APPVEYOR_REPO_NAME']}.git"
|
72
|
+
commit = env['APPVEYOR_REPO_COMMIT']
|
73
|
+
branch = (env['APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH'] || env['APPVEYOR_REPO_BRANCH'])
|
74
|
+
tag = env['APPVEYOR_REPO_TAG_NAME']
|
75
|
+
end
|
76
|
+
|
77
|
+
{
|
78
|
+
TAG_PROVIDER_NAME => 'appveyor',
|
79
|
+
Datadog::Ext::Git::TAG_REPOSITORY_URL => repository,
|
80
|
+
Datadog::Ext::Git::TAG_COMMIT_SHA => commit,
|
81
|
+
TAG_WORKSPACE_PATH => env['APPVEYOR_BUILD_FOLDER'],
|
82
|
+
TAG_PIPELINE_ID => env['APPVEYOR_BUILD_ID'],
|
83
|
+
TAG_PIPELINE_NAME => env['APPVEYOR_REPO_NAME'],
|
84
|
+
TAG_PIPELINE_NUMBER => env['APPVEYOR_BUILD_NUMBER'],
|
85
|
+
TAG_PIPELINE_URL => url,
|
86
|
+
TAG_JOB_URL => url,
|
87
|
+
Datadog::Ext::Git::TAG_BRANCH => branch,
|
88
|
+
Datadog::Ext::Git::TAG_TAG => tag
|
89
|
+
}
|
90
|
+
end
|
91
|
+
|
92
|
+
def extract_azure_pipelines(env)
|
93
|
+
if env['SYSTEM_TEAMFOUNDATIONSERVERURI'] && env['SYSTEM_TEAMPROJECTID'] && env['BUILD_BUILDID']
|
94
|
+
base_url = "#{env['SYSTEM_TEAMFOUNDATIONSERVERURI']}#{env['SYSTEM_TEAMPROJECTID']}" \
|
95
|
+
"/_build/results?buildId=#{env['BUILD_BUILDID']}"
|
96
|
+
pipeline_url = base_url
|
97
|
+
job_url = base_url + "&view=logs&j=#{env['SYSTEM_JOBID']}&t=#{env['SYSTEM_TASKINSTANCEID']}"
|
98
|
+
else
|
99
|
+
pipeline_url = job_url = nil
|
100
|
+
end
|
101
|
+
branch_or_tag = (
|
102
|
+
env['SYSTEM_PULLREQUEST_SOURCEBRANCH'] || env['BUILD_SOURCEBRANCH'] || env['BUILD_SOURCEBRANCHNAME']
|
103
|
+
)
|
104
|
+
if branch_or_tag.include? 'tags/'
|
105
|
+
branch = nil
|
106
|
+
tag = branch_or_tag
|
107
|
+
else
|
108
|
+
branch = branch_or_tag
|
109
|
+
tag = nil
|
110
|
+
end
|
111
|
+
{
|
112
|
+
TAG_PROVIDER_NAME => 'azurepipelines',
|
113
|
+
TAG_WORKSPACE_PATH => env['BUILD_SOURCESDIRECTORY'],
|
114
|
+
TAG_PIPELINE_ID => env['BUILD_BUILDID'],
|
115
|
+
TAG_PIPELINE_NAME => env['BUILD_DEFINITIONNAME'],
|
116
|
+
TAG_PIPELINE_NUMBER => env['BUILD_BUILDID'],
|
117
|
+
TAG_PIPELINE_URL => pipeline_url,
|
118
|
+
TAG_JOB_URL => job_url,
|
119
|
+
Datadog::Ext::Git::TAG_REPOSITORY_URL => (
|
120
|
+
env['SYSTEM_PULLREQUEST_SOURCEREPOSITORYURI'] \
|
121
|
+
|| env['BUILD_REPOSITORY_URI']
|
122
|
+
),
|
123
|
+
Datadog::Ext::Git::TAG_COMMIT_SHA => (env['SYSTEM_PULLREQUEST_SOURCECOMMITID'] || env['BUILD_SOURCEVERSION']),
|
124
|
+
Datadog::Ext::Git::TAG_BRANCH => branch,
|
125
|
+
Datadog::Ext::Git::TAG_TAG => tag
|
126
|
+
}
|
127
|
+
end
|
128
|
+
|
129
|
+
def extract_bitbucket(env)
|
130
|
+
url = "https://bitbucket.org/#{env['BITBUCKET_REPO_FULL_NAME']}/addon/pipelines/home#" \
|
131
|
+
"!/results/#{env['BITBUCKET_BUILD_NUMBER']}"
|
132
|
+
{
|
133
|
+
Datadog::Ext::Git::TAG_BRANCH => env['BITBUCKET_BRANCH'],
|
134
|
+
Datadog::Ext::Git::TAG_COMMIT_SHA => env['BITBUCKET_COMMIT'],
|
135
|
+
Datadog::Ext::Git::TAG_REPOSITORY_URL => env['BITBUCKET_GIT_SSH_ORIGIN'],
|
136
|
+
Datadog::Ext::Git::TAG_TAG => env['BITBUCKET_TAG'],
|
137
|
+
TAG_JOB_URL => url,
|
138
|
+
TAG_PIPELINE_ID => env['BITBUCKET_PIPELINE_UUID'] ? env['BITBUCKET_PIPELINE_UUID'].tr('{}', '') : None,
|
139
|
+
TAG_PIPELINE_NAME => env['BITBUCKET_REPO_FULL_NAME'],
|
140
|
+
TAG_PIPELINE_NUMBER => env['BITBUCKET_BUILD_NUMBER'],
|
141
|
+
TAG_PIPELINE_URL => url,
|
142
|
+
TAG_PROVIDER_NAME => 'bitbucket',
|
143
|
+
TAG_WORKSPACE_PATH => env['BITBUCKET_CLONE_DIR']
|
144
|
+
}
|
145
|
+
end
|
146
|
+
|
147
|
+
def extract_buildkite(env)
|
148
|
+
{
|
149
|
+
Datadog::Ext::Git::TAG_BRANCH => env['BUILDKITE_BRANCH'],
|
150
|
+
Datadog::Ext::Git::TAG_COMMIT_SHA => env['BUILDKITE_COMMIT'],
|
151
|
+
Datadog::Ext::Git::TAG_REPOSITORY_URL => env['BUILDKITE_REPO'],
|
152
|
+
Datadog::Ext::Git::TAG_TAG => env['BUILDKITE_TAG'],
|
153
|
+
TAG_PIPELINE_ID => env['BUILDKITE_BUILD_ID'],
|
154
|
+
TAG_PIPELINE_NAME => env['BUILDKITE_PIPELINE_SLUG'],
|
155
|
+
TAG_PIPELINE_NUMBER => env['BUILDKITE_BUILD_NUMBER'],
|
156
|
+
TAG_PIPELINE_URL => env['BUILDKITE_BUILD_URL'],
|
157
|
+
TAG_JOB_URL => "#{env['BUILDKITE_BUILD_URL']}##{env['BUILDKITE_JOB_ID']}",
|
158
|
+
TAG_PROVIDER_NAME => 'buildkite',
|
159
|
+
TAG_WORKSPACE_PATH => env['BUILDKITE_BUILD_CHECKOUT_PATH']
|
160
|
+
}
|
161
|
+
end
|
162
|
+
|
163
|
+
def extract_circle_ci(env)
|
164
|
+
{
|
165
|
+
Datadog::Ext::Git::TAG_BRANCH => env['CIRCLE_BRANCH'],
|
166
|
+
Datadog::Ext::Git::TAG_COMMIT_SHA => env['CIRCLE_SHA1'],
|
167
|
+
Datadog::Ext::Git::TAG_REPOSITORY_URL => env['CIRCLE_REPOSITORY_URL'],
|
168
|
+
Datadog::Ext::Git::TAG_TAG => env['CIRCLE_TAG'],
|
169
|
+
TAG_PIPELINE_ID => env['CIRCLE_WORKFLOW_ID'],
|
170
|
+
TAG_PIPELINE_NAME => env['CIRCLE_PROJECT_REPONAME'],
|
171
|
+
TAG_PIPELINE_NUMBER => env['CIRCLE_BUILD_NUM'],
|
172
|
+
TAG_PIPELINE_URL => env['CIRCLE_BUILD_URL'],
|
173
|
+
TAG_JOB_URL => env['CIRCLE_BUILD_URL'],
|
174
|
+
TAG_PROVIDER_NAME => 'circleci',
|
175
|
+
TAG_WORKSPACE_PATH => env['CIRCLE_WORKING_DIRECTORY']
|
176
|
+
}
|
177
|
+
end
|
178
|
+
|
179
|
+
def extract_github_actions(env)
|
180
|
+
branch_or_tag = (env['GITHUB_HEAD_REF'] || env['GITHUB_REF'])
|
181
|
+
if branch_or_tag.include? 'tags/'
|
182
|
+
branch = nil
|
183
|
+
tag = branch_or_tag
|
184
|
+
else
|
185
|
+
branch = branch_or_tag
|
186
|
+
tag = nil
|
187
|
+
end
|
188
|
+
{
|
189
|
+
Datadog::Ext::Git::TAG_BRANCH => branch,
|
190
|
+
Datadog::Ext::Git::TAG_COMMIT_SHA => env['GITHUB_SHA'],
|
191
|
+
Datadog::Ext::Git::TAG_REPOSITORY_URL => "https://github.com/#{env['GITHUB_REPOSITORY']}.git",
|
192
|
+
Datadog::Ext::Git::TAG_TAG => tag,
|
193
|
+
TAG_JOB_URL => "https://github.com/#{env['GITHUB_REPOSITORY']}/commit/#{env['GITHUB_SHA']}/checks",
|
194
|
+
TAG_PIPELINE_ID => env['GITHUB_RUN_ID'],
|
195
|
+
TAG_PIPELINE_NAME => env['GITHUB_WORKFLOW'],
|
196
|
+
TAG_PIPELINE_NUMBER => env['GITHUB_RUN_NUMBER'],
|
197
|
+
TAG_PIPELINE_URL => "https://github.com/#{env['GITHUB_REPOSITORY']}/commit/#{env['GITHUB_SHA']}/checks",
|
198
|
+
TAG_PROVIDER_NAME => 'github',
|
199
|
+
TAG_WORKSPACE_PATH => env['GITHUB_WORKSPACE']
|
200
|
+
}
|
201
|
+
end
|
202
|
+
|
203
|
+
def extract_gitlab(env)
|
204
|
+
url = env['CI_PIPELINE_URL']
|
205
|
+
url = url.gsub(%r{/-/pipelines/}, '/pipelines/') unless url.nil?
|
206
|
+
{
|
207
|
+
Datadog::Ext::Git::TAG_BRANCH => env['CI_COMMIT_BRANCH'],
|
208
|
+
Datadog::Ext::Git::TAG_COMMIT_SHA => env['CI_COMMIT_SHA'],
|
209
|
+
Datadog::Ext::Git::TAG_REPOSITORY_URL => env['CI_REPOSITORY_URL'],
|
210
|
+
Datadog::Ext::Git::TAG_TAG => env['CI_COMMIT_TAG'],
|
211
|
+
TAG_STAGE_NAME => env['CI_JOB_STAGE'],
|
212
|
+
TAG_JOB_NAME => env['CI_JOB_NAME'],
|
213
|
+
TAG_JOB_URL => env['CI_JOB_URL'],
|
214
|
+
TAG_PIPELINE_ID => env['CI_PIPELINE_ID'],
|
215
|
+
TAG_PIPELINE_NAME => env['CI_PROJECT_PATH'],
|
216
|
+
TAG_PIPELINE_NUMBER => env['CI_PIPELINE_IID'],
|
217
|
+
TAG_PIPELINE_URL => url,
|
218
|
+
TAG_PROVIDER_NAME => 'gitlab',
|
219
|
+
TAG_WORKSPACE_PATH => env['CI_PROJECT_DIR']
|
220
|
+
}
|
221
|
+
end
|
222
|
+
|
223
|
+
def extract_jenkins(env)
|
224
|
+
branch_or_tag = env['GIT_BRANCH']
|
225
|
+
if branch_or_tag.include? 'tags/'
|
226
|
+
branch = nil
|
227
|
+
tag = branch_or_tag
|
228
|
+
else
|
229
|
+
branch = branch_or_tag
|
230
|
+
tag = nil
|
231
|
+
end
|
232
|
+
name = env['JOB_NAME']
|
233
|
+
name = name.gsub("/#{normalize_ref(branch)}", '') unless name.nil? || branch.nil?
|
234
|
+
name = name.split('/').reject { |v| v.nil? || v.include?('=') }.join('/') unless name.nil?
|
235
|
+
{
|
236
|
+
Datadog::Ext::Git::TAG_BRANCH => branch,
|
237
|
+
Datadog::Ext::Git::TAG_COMMIT_SHA => env['GIT_COMMIT'],
|
238
|
+
Datadog::Ext::Git::TAG_REPOSITORY_URL => env['GIT_URL'],
|
239
|
+
Datadog::Ext::Git::TAG_TAG => tag,
|
240
|
+
TAG_PIPELINE_ID => env['BUILD_TAG'],
|
241
|
+
TAG_PIPELINE_NAME => name,
|
242
|
+
TAG_PIPELINE_NUMBER => env['BUILD_NUMBER'],
|
243
|
+
TAG_PIPELINE_URL => env['BUILD_URL'],
|
244
|
+
TAG_PROVIDER_NAME => 'jenkins',
|
245
|
+
TAG_WORKSPACE_PATH => env['WORKSPACE']
|
246
|
+
}
|
247
|
+
end
|
248
|
+
|
249
|
+
def extract_teamcity(env)
|
250
|
+
{
|
251
|
+
TAG_PROVIDER_NAME => 'teamcity',
|
252
|
+
Datadog::Ext::Git::TAG_REPOSITORY_URL => env['BUILD_VCS_URL'],
|
253
|
+
Datadog::Ext::Git::TAG_COMMIT_SHA => env['BUILD_VCS_NUMBER'],
|
254
|
+
TAG_WORKSPACE_PATH => env['BUILD_CHECKOUTDIR'],
|
255
|
+
TAG_PIPELINE_ID => env['BUILD_ID'],
|
256
|
+
TAG_PIPELINE_NUMBER => env['BUILD_NUMBER'],
|
257
|
+
TAG_PIPELINE_URL => (
|
258
|
+
env['SERVER_URL'] && env['BUILD_ID'] ? "#{env['SERVER_URL']}/viewLog.html?buildId=#{env['SERVER_URL']}" : nil
|
259
|
+
)
|
260
|
+
}
|
261
|
+
end
|
262
|
+
|
263
|
+
def extract_travis(env)
|
264
|
+
{
|
265
|
+
Datadog::Ext::Git::TAG_BRANCH => (env['TRAVIS_PULL_REQUEST_BRANCH'] || env['TRAVIS_BRANCH']),
|
266
|
+
Datadog::Ext::Git::TAG_COMMIT_SHA => env['TRAVIS_COMMIT'],
|
267
|
+
Datadog::Ext::Git::TAG_REPOSITORY_URL => "https://github.com/#{env['TRAVIS_REPO_SLUG']}.git",
|
268
|
+
Datadog::Ext::Git::TAG_TAG => env['TRAVIS_TAG'],
|
269
|
+
TAG_JOB_URL => env['TRAVIS_JOB_WEB_URL'],
|
270
|
+
TAG_PIPELINE_ID => env['TRAVIS_BUILD_ID'],
|
271
|
+
TAG_PIPELINE_NAME => env['TRAVIS_REPO_SLUG'],
|
272
|
+
TAG_PIPELINE_NUMBER => env['TRAVIS_BUILD_NUMBER'],
|
273
|
+
TAG_PIPELINE_URL => env['TRAVIS_BUILD_WEB_URL'],
|
274
|
+
TAG_PROVIDER_NAME => 'travisci',
|
275
|
+
TAG_WORKSPACE_PATH => env['TRAVIS_BUILD_DIR']
|
276
|
+
}
|
277
|
+
end
|
278
|
+
|
279
|
+
def extract_bitrise(env)
|
280
|
+
commit = (
|
281
|
+
env['BITRISE_GIT_COMMIT'] || env['GIT_CLONE_COMMIT_HASH']
|
282
|
+
)
|
283
|
+
branch = (
|
284
|
+
env['BITRISEIO_GIT_BRANCH_DEST'] || env['BITRISE_GIT_BRANCH']
|
285
|
+
)
|
286
|
+
{
|
287
|
+
TAG_PROVIDER_NAME => 'bitrise',
|
288
|
+
TAG_PIPELINE_ID => env['BITRISE_BUILD_SLUG'],
|
289
|
+
TAG_PIPELINE_NAME => env['BITRISE_APP_TITLE'],
|
290
|
+
TAG_PIPELINE_NUMBER => env['BITRISE_BUILD_NUMBER'],
|
291
|
+
TAG_PIPELINE_URL => env['BITRISE_BUILD_URL'],
|
292
|
+
TAG_WORKSPACE_PATH => env['BITRISE_SOURCE_DIR'],
|
293
|
+
Datadog::Ext::Git::TAG_REPOSITORY_URL => env['GIT_REPOSITORY_URL'],
|
294
|
+
Datadog::Ext::Git::TAG_COMMIT_SHA => commit,
|
295
|
+
Datadog::Ext::Git::TAG_BRANCH => branch,
|
296
|
+
Datadog::Ext::Git::TAG_TAG => env['BITRISE_GIT_TAG']
|
297
|
+
}
|
298
|
+
end
|
299
|
+
end
|
300
|
+
# rubocop:enable Metrics/ModuleLength:
|
301
|
+
end
|
302
|
+
end
|
303
|
+
end
|