Skip to content

Commit

Permalink
Merge branch 'master' into tonycthsu/lib-injection-package-pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyCTHsu committed Feb 23, 2024
2 parents bb4a4fc + 81e6060 commit 9713cd4
Show file tree
Hide file tree
Showing 599 changed files with 7,779 additions and 1,896 deletions.
13 changes: 2 additions & 11 deletions .gitlab/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ only-profiling:
# better accuracy, mode.
DD_PROFILING_NO_SIGNALS_WORKAROUND_ENABLED: "false"

only-profiling-timeline:
only-profiling-gc:
extends: .benchmarks
variables:
DD_BENCHMARKS_CONFIGURATION: only-profiling
DD_PROFILING_ENABLED: "true"
DD_PROFILING_NO_SIGNALS_WORKAROUND_ENABLED: "false"
DD_PROFILING_EXPERIMENTAL_TIMELINE_ENABLED: "true"
DD_PROFILING_FORCE_ENABLE_GC: "true"

profiling-and-tracing:
extends: .benchmarks
Expand Down Expand Up @@ -110,15 +110,6 @@ profiling-and-tracing-and-appsec:
DD_PROFILING_ENABLED: "true"
DD_PROFILING_NO_SIGNALS_WORKAROUND_ENABLED: "false"

profiling-and-tracing-and-appsec-timeline:
extends: .benchmarks
variables:
DD_BENCHMARKS_CONFIGURATION: profiling-and-tracing-and-appsec
DD_APPSEC_ENABLED: "true"
DD_PROFILING_ENABLED: "true"
DD_PROFILING_NO_SIGNALS_WORKAROUND_ENABLED: "false"
DD_PROFILING_EXPERIMENTAL_TIMELINE_ENABLED: "true"

candidate-tracer-appsec-with-api-security:
extends: .benchmarks
variables:
Expand Down
12 changes: 11 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ TEST_METADATA = {
'' => '✅ 2.1 / ✅ 2.2 / ✅ 2.3 / ✅ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby'
},
'profiling:main' => {
'opentelemetry' => '❌ 2.1 / ❌ 2.2 / ❌ 2.3 / ❌ 2.4 / ❌ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ❌ jruby',
'' => '✅ 2.1 / ✅ 2.2 / ✅ 2.3 / ✅ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby'
},
'profiling:ractors' => {
Expand Down Expand Up @@ -261,6 +262,9 @@ TEST_METADATA = {
'redis-4' => '❌ 2.1 / ❌ 2.2 / ❌ 2.3 / ✅ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby',
'redis-5' => '❌ 2.1 / ❌ 2.2 / ❌ 2.3 / ❌ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby'
},
'routetest' => {
'multi-rack-app' => '❌ 2.1 / ❌ 2.2 / ❌ 2.3 / ❌ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby'
},
'appsec:rack' => {
# Non-deprecated form of Regexp.new does not backport to Rack 1.x, see: https://github.com/rack/rack/pull/1998
'rack-1' => '✅ 2.1 / ✅ 2.2 / ✅ 2.3 / ✅ 2.4 / ✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ❌ 3.3 / ✅ jruby',
Expand Down Expand Up @@ -343,7 +347,7 @@ namespace :spec do
task all: [:main, :benchmark,
:rails, :railsredis, :railsredis_activesupport, :railsactivejob,
:elasticsearch, :http, :redis, :sidekiq, :sinatra, :hanami, :hanami_autoinstrument,
:profiling]
:profiling, :routetest]

desc '' # "Explicitly hiding from `rake -T`"
RSpec::Core::RakeTask.new(:main) do |t, args|
Expand Down Expand Up @@ -378,6 +382,12 @@ namespace :spec do
t.rspec_opts = args.to_a.join(' ')
end

desc '' # "Explicitly hiding from `rake -T`"
RSpec::Core::RakeTask.new(:routetest) do |t, args|
t.pattern = 'spec/datadog/tracing/contrib/http_route_spec.rb'
t.rspec_opts = args.to_a.join(' ')
end

desc '' # "Explicitly hiding from `rake -T`"
RSpec::Core::RakeTask.new(:railsredis) do |t, args|
t.pattern = 'spec/datadog/tracing/contrib/rails/**/*redis*_spec.rb'
Expand Down
2 changes: 1 addition & 1 deletion Steepfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ target :ddtrace do
ignore 'lib/datadog/core/configuration/option_definition_set.rb'
ignore 'lib/datadog/core/configuration/options.rb'
ignore 'lib/datadog/core/configuration/settings.rb'
ignore 'lib/datadog/core/diagnostics/environment_logger.rb'
ignore 'lib/datadog/core/diagnostics/health.rb'
ignore 'lib/datadog/core/encoding.rb'
ignore 'lib/datadog/core/environment/container.rb'
Expand Down Expand Up @@ -621,6 +620,7 @@ target :ddtrace do
library 'base64'
library 'digest'
library 'zlib'
library 'time'

repo_path 'vendor/rbs'
library 'cucumber'
Expand Down
8 changes: 8 additions & 0 deletions appraisal/jruby-9.2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -289,3 +289,11 @@
appraise 'core-old' do
gem 'dogstatsd-ruby', '~> 4'
end

appraise 'multi-rack-app' do
gem 'sinatra'
gem 'rack-contrib'
gem 'rack-test' # Dev dependencies for testing rack-based code
gem 'grape'
gem 'rails', '~> 5.2.1'
end
8 changes: 8 additions & 0 deletions appraisal/jruby-9.3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -260,3 +260,11 @@
appraise 'core-old' do
gem 'dogstatsd-ruby', '~> 4'
end

appraise 'multi-rack-app' do
gem 'sinatra', '>= 3'
gem 'rack-contrib'
gem 'rack-test' # Dev dependencies for testing rack-based code
gem 'grape'
gem 'rails', '~> 5.2.1'
end
8 changes: 8 additions & 0 deletions appraisal/jruby-9.4.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,11 @@
appraise 'core-old' do
gem 'dogstatsd-ruby', '~> 4'
end

appraise 'multi-rack-app' do
gem 'sinatra', '>= 3'
gem 'rack-contrib'
gem 'rack-test' # Dev dependencies for testing rack-based code
gem 'grape'
gem 'rails', '~> 6.1.0'
end
8 changes: 8 additions & 0 deletions appraisal/ruby-2.5.rb
Original file line number Diff line number Diff line change
Expand Up @@ -262,3 +262,11 @@
appraise 'core-old' do
gem 'dogstatsd-ruby', '~> 4'
end

appraise 'multi-rack-app' do
gem 'sinatra'
gem 'rack-contrib'
gem 'rack-test' # Dev dependencies for testing rack-based code
gem 'grape'
gem 'rails', '~> 5.2.1'
end
8 changes: 8 additions & 0 deletions appraisal/ruby-2.6.rb
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,11 @@
appraise 'core-old' do
gem 'dogstatsd-ruby', '~> 4'
end

appraise 'multi-rack-app' do
gem 'sinatra', '>= 3'
gem 'rack-contrib'
gem 'rack-test' # Dev dependencies for testing rack-based code
gem 'grape'
gem 'rails', '~> 5.2.1'
end
8 changes: 8 additions & 0 deletions appraisal/ruby-2.7.rb
Original file line number Diff line number Diff line change
Expand Up @@ -264,3 +264,11 @@
appraise 'core-old' do
gem 'dogstatsd-ruby', '~> 4'
end

appraise 'multi-rack-app' do
gem 'sinatra', '>= 3'
gem 'rack-contrib'
gem 'rack-test' # Dev dependencies for testing rack-based code
gem 'grape'
gem 'rails', '~> 5.2.1'
end
8 changes: 8 additions & 0 deletions appraisal/ruby-3.0.rb
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,11 @@
appraise 'core-old' do
gem 'dogstatsd-ruby', '~> 4'
end

appraise 'multi-rack-app' do
gem 'sinatra', '>= 3'
gem 'rack-contrib'
gem 'rack-test' # Dev dependencies for testing rack-based code
gem 'grape'
gem 'rails', '~> 6.1.0'
end
8 changes: 8 additions & 0 deletions appraisal/ruby-3.1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,11 @@
appraise 'core-old' do
gem 'dogstatsd-ruby', '~> 4'
end

appraise 'multi-rack-app' do
gem 'sinatra', '>= 3'
gem 'rack-contrib'
gem 'rack-test' # Dev dependencies for testing rack-based code
gem 'grape'
gem 'rails', '~> 6.1.0'
end
8 changes: 8 additions & 0 deletions appraisal/ruby-3.2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,11 @@
appraise 'core-old' do
gem 'dogstatsd-ruby', '~> 4'
end

appraise 'multi-rack-app' do
gem 'sinatra', '>= 3'
gem 'rack-contrib'
gem 'rack-test' # Dev dependencies for testing rack-based code
gem 'grape'
gem 'rails', '~> 6.1.0'
end
8 changes: 8 additions & 0 deletions appraisal/ruby-3.3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,11 @@
appraise 'core-old' do
gem 'dogstatsd-ruby', '~> 4'
end

appraise 'multi-rack-app' do
gem 'sinatra', '>= 3'
gem 'rack-contrib'
gem 'rack-test' # Dev dependencies for testing rack-based code
gem 'grape'
gem 'rails', '~> 6.1.0'
end
10 changes: 7 additions & 3 deletions benchmarks/profiler_http_transport.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ def initialize
code_provenance_file_name: 'example_code_provenance_file_name.json',
code_provenance_data: '', # Random.new(1).bytes(4_000),
tags_as_array: [],
internal_metadata: {no_signals_workaround_enabled: false},
internal_metadata: { no_signals_workaround_enabled: false },
info_json: JSON.fast_generate({ profiler: { benchmarking: true } }),
)
end

Expand Down Expand Up @@ -78,8 +79,11 @@ def start_fake_webserver

def run_benchmark
Benchmark.ips do |x|
benchmark_time = VALIDATE_BENCHMARK_MODE ? {time: 0.01, warmup: 0} : {time: 70, warmup: 2}
x.config(**benchmark_time, suite: report_to_dogstatsd_if_enabled_via_environment_variable(benchmark_name: 'profiler_http_transport'))
benchmark_time = VALIDATE_BENCHMARK_MODE ? { time: 0.01, warmup: 0 } : { time: 70, warmup: 2 }
x.config(
**benchmark_time,
suite: report_to_dogstatsd_if_enabled_via_environment_variable(benchmark_name: 'profiler_http_transport')
)

x.report("http_transport #{ENV['CONFIG']}") do
run_once
Expand Down
2 changes: 1 addition & 1 deletion ddtrace.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Gem::Specification.new do |spec|

# Used by profiling (and possibly others in the future)
# When updating the version here, please also update the version in `native_extension_helpers.rb` (and yes we have a test for it)
spec.add_dependency 'libdatadog', '~> 5.0.0.1.0'
spec.add_dependency 'libdatadog', '~> 6.0.0.1.0'

# used for CI visibility product until the next major version
spec.add_dependency 'datadog-ci', '~> 0.7.0'
Expand Down
16 changes: 14 additions & 2 deletions docs/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -584,8 +584,7 @@ Aws::S3::Client.new.list_buckets

### Concurrent Ruby

The Concurrent Ruby integration adds support for context propagation when using `::Concurrent::Future`.
Making sure that code traced within the `Future#execute` will have correct parent set.
The Concurrent Ruby integration adds support for context propagation when using `::Concurrent::Future` and `Concurrent::Async`, and ensures that code traced within the `Future#execute` and `Concurrent::Async#async` will have the correct parent set.

To activate your integration, use the `Datadog.configure` method:

Expand All @@ -600,6 +599,19 @@ end
Datadog::Tracing.trace('outer') do
Concurrent::Future.execute { Datadog::Tracing.trace('inner') { } }.wait
end

# Pass context into code executed within Concurrent::Async
class MyClass
include ConcurrentAsync

def foo
Datadog::Tracing.trace('inner') { }
end
end

Datadog::Tracing.trace('outer') do
MyClass.new.async.foo
end
```

### Cucumber
Expand Down
Loading

0 comments on commit 9713cd4

Please sign in to comment.