Skip to content

Commit

Permalink
Add support for OpenTelemetry 1.0.0.rc2
Browse files Browse the repository at this point in the history
In particular open-telemetry/opentelemetry-ruby#807
changed some of the APIs we were using to get the current span for a
thread.

To test both 0.17.0 and this new version I moved
opentelemetry to appraisals.
  • Loading branch information
ivoanjo committed Jun 28, 2021
1 parent cbd3fbf commit 4622b38
Show file tree
Hide file tree
Showing 29 changed files with 2,596 additions and 12 deletions.
18 changes: 18 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ def self.gem_cucumber(version)
end
end

def self.apraise_opentelemetry
appraise 'opentelemetry-pre-1-0' do
gem 'opentelemetry-sdk', '< 1'
end

appraise 'opentelemetry-1-0' do
gem 'opentelemetry-sdk', '>= 1.0.0.rc2'
end
end

if Gem::Version.new(RUBY_VERSION) < Gem::Version.new(Datadog::VERSION::MINIMUM_RUBY_VERSION)
raise NotImplementedError, "Ruby versions < #{Datadog::VERSION::MINIMUM_RUBY_VERSION} are not supported!"
elsif Gem::Version.new('2.1.0') <= Gem::Version.new(RUBY_VERSION) \
Expand Down Expand Up @@ -784,6 +794,8 @@ elsif Gem::Version.new('2.5.0') <= Gem::Version.new(RUBY_VERSION) \
gem 'resque', '>= 2.0'
end

apraise_opentelemetry

(3..5).each { |v| gem_cucumber(v) }

appraise 'contrib' do
Expand Down Expand Up @@ -966,6 +978,8 @@ elsif Gem::Version.new('2.6.0') <= Gem::Version.new(RUBY_VERSION) \
gem 'resque', '>= 2.0'
end

apraise_opentelemetry

(3..5).each { |v| gem_cucumber(v) }

appraise 'contrib' do
Expand Down Expand Up @@ -1149,6 +1163,8 @@ elsif Gem::Version.new('2.7.0') <= Gem::Version.new(RUBY_VERSION) \
gem 'resque', '>= 2.0'
end

apraise_opentelemetry

(3..5).each { |v| gem_cucumber(v) }

appraise 'contrib' do
Expand Down Expand Up @@ -1247,6 +1263,8 @@ elsif Gem::Version.new('3.0.0') <= Gem::Version.new(RUBY_VERSION)
gem 'resque', '>= 2.0'
end

apraise_opentelemetry

(3..5).each { |v| gem_cucumber(v) }

appraise 'contrib' do
Expand Down
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ end
# Optional extensions
# TODO: Move this to Appraisals?
gem 'dogstatsd-ruby', '< 5.0'
gem 'opentelemetry-api', '>= 0.17.0' if RUBY_VERSION >= '2.5.0'
gem 'opentracing', '>= 0.4.1'

# Profiler optional dependencies
Expand Down
25 changes: 24 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace :spec do
RSpec::Core::RakeTask.new(:main) do |t, args|
t.pattern = 'spec/**/*_spec.rb'
t.exclude_pattern = 'spec/**/{contrib,benchmark,redis,opentracer,opentelemetry,auto_instrument}/**/*_spec.rb,'\
' spec/**/auto_instrument_spec.rb'
' spec/**/auto_instrument_spec.rb,spec/**/profiling/**/opentelemetry_spec.rb'
t.rspec_opts = args.to_a.join(' ')
end

Expand Down Expand Up @@ -68,6 +68,11 @@ namespace :spec do
t.rspec_opts = args.to_a.join(' ')
end

RSpec::Core::RakeTask.new(:'profiling-opentelemetry') do |t, args|
t.pattern = 'spec/**/profiling/**/opentelemetry_spec.rb'
t.rspec_opts = args.to_a.join(' ')
end

RSpec::Core::RakeTask.new(:contrib) do |t, args|
contrib_paths = [
'analytics',
Expand Down Expand Up @@ -628,6 +633,11 @@ task :ci do
declare 'bundle exec appraisal cucumber3 rake spec:cucumber'
declare 'bundle exec appraisal cucumber4 rake spec:cucumber'
declare 'bundle exec appraisal cucumber5 rake spec:cucumber'

# Profiling
declare 'bundle exec appraisal opentelemetry-pre-1-0 rake spec:profiling-opentelemetry'
declare 'bundle exec appraisal opentelemetry-1-0 rake spec:profiling-opentelemetry'

elsif Gem::Version.new('2.6.0') <= Gem::Version.new(RUBY_VERSION) \
&& Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.7.0')
# Main library
Expand Down Expand Up @@ -726,6 +736,10 @@ task :ci do
declare 'bundle exec appraisal cucumber3 rake spec:cucumber'
declare 'bundle exec appraisal cucumber4 rake spec:cucumber'
declare 'bundle exec appraisal cucumber5 rake spec:cucumber'

# Profiling
declare 'bundle exec appraisal opentelemetry-pre-1-0 rake spec:profiling-opentelemetry'
declare 'bundle exec appraisal opentelemetry-1-0 rake spec:profiling-opentelemetry'
end
elsif Gem::Version.new('2.7.0') <= Gem::Version.new(RUBY_VERSION) \
&& Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3.0.0')
Expand Down Expand Up @@ -824,6 +838,10 @@ task :ci do
declare 'bundle exec appraisal cucumber3 rake spec:cucumber'
declare 'bundle exec appraisal cucumber4 rake spec:cucumber'
declare 'bundle exec appraisal cucumber5 rake spec:cucumber'

# Profiling
declare 'bundle exec appraisal opentelemetry-pre-1-0 rake spec:profiling-opentelemetry'
declare 'bundle exec appraisal opentelemetry-1-0 rake spec:profiling-opentelemetry'
end
elsif Gem::Version.new('3.0.0') <= Gem::Version.new(RUBY_VERSION)
# Main library
Expand Down Expand Up @@ -898,6 +916,11 @@ task :ci do
declare 'bundle exec appraisal cucumber3 rake spec:cucumber'
declare 'bundle exec appraisal cucumber4 rake spec:cucumber'
declare 'bundle exec appraisal cucumber5 rake spec:cucumber'

# Profiling
declare 'bundle exec appraisal opentelemetry-pre-1-0 rake spec:profiling-opentelemetry'
declare 'bundle exec appraisal opentelemetry-1-0 rake spec:profiling-opentelemetry'

end
end
end
Expand Down
35 changes: 35 additions & 0 deletions gemfiles/jruby_9.2.0.0_opentelemetry_1_0.gemfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

163 changes: 163 additions & 0 deletions gemfiles/jruby_9.2.0.0_opentelemetry_1_0.gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions gemfiles/jruby_9.2.0.0_opentelemetry_pre_1_0.gemfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4622b38

Please sign in to comment.