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 25, 2021
1 parent e12640f commit 268128c
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "addressable", "~> 2.4.0"
gem "appraisal", "~> 2.2"
gem "benchmark-ips", "~> 2.8"
gem "benchmark-memory", "~> 0.1"
gem "builder"
gem "climate_control", "~> 0.2.0"
gem "concurrent-ruby"
gem "memory_profiler", "~> 0.9"
gem "minitest", "= 5.10.1"
gem "minitest-around", "0.5.0"
gem "minitest-stub_any_instance", "1.0.2"
gem "pimpmychangelog", ">= 0.1.2"
gem "pry"
gem "pry-debugger-jruby"
gem "rake", ">= 10.5"
gem "rspec", "~> 3.10"
gem "rspec-collection_matchers", "~> 1.1"
gem "rspec_junit_formatter", ">= 0.4.1"
gem "rspec_n", "~> 1.3"
gem "simplecov", git: "https://github.com/DataDog/simplecov", ref: "3bb6b7ee58bf4b1954ca205f50dd44d6f41c57db"
gem "warning", "~> 1"
gem "webmock", ">= 3.10.0"
gem "yard", "~> 0.9"
gem "rubocop", "~> 1.10", require: false
gem "rubocop-performance", "~> 1.9", require: false
gem "rubocop-rspec", "~> 2.2", require: false
gem "dogstatsd-ruby", "< 5.0"
gem "opentracing", ">= 0.4.1"
gem "opentelemetry-sdk", ">= 1.0.0.rc2"

gemspec path: "../"
163 changes: 163 additions & 0 deletions gemfiles/jruby_9.2.0.0_opentelemetry_1_0.gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
GIT
remote: https://github.com/DataDog/simplecov
revision: 3bb6b7ee58bf4b1954ca205f50dd44d6f41c57db
ref: 3bb6b7ee58bf4b1954ca205f50dd44d6f41c57db
specs:
simplecov (0.21.2)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)

PATH
remote: ..
specs:
ddtrace (0.50.0)
ffi (~> 1.0)
msgpack

GEM
remote: https://rubygems.org/
specs:
addressable (2.4.0)
appraisal (2.4.0)
bundler
rake
thor (>= 0.14.0)
ast (2.4.2)
benchmark-ips (2.9.1)
benchmark-memory (0.1.2)
memory_profiler (~> 0.9)
builder (3.2.4)
climate_control (0.2.0)
coderay (1.1.3)
colorize (0.8.1)
concurrent-ruby (1.1.9)
crack (0.4.5)
rexml
cri (2.15.11)
diff-lcs (1.4.4)
docile (1.4.0)
dogstatsd-ruby (4.8.3)
ffi (1.15.3-java)
hashdiff (1.0.1)
memory_profiler (0.9.14)
method_source (1.0.0)
minitest (5.10.1)
minitest-around (0.5.0)
minitest (~> 5.0)
minitest-stub_any_instance (1.0.2)
msgpack (1.4.2-java)
opentelemetry-api (1.0.0.rc2)
opentelemetry-common (0.19.0)
opentelemetry-api (~> 1.0.0.rc2)
opentelemetry-instrumentation-base (0.18.1)
opentelemetry-api (~> 1.0.0.rc2)
opentelemetry-sdk (1.0.0.rc2)
opentelemetry-api (~> 1.0.0.rc2)
opentelemetry-common (~> 0.19.0)
opentelemetry-instrumentation-base (~> 0.18.1)
opentracing (0.5.0)
parallel (1.20.1)
parser (3.0.1.1)
ast (~> 2.4.1)
pimpmychangelog (0.1.3)
pry (0.13.1-java)
coderay (~> 1.1)
method_source (~> 1.0)
spoon (~> 0.0)
pry-debugger-jruby (2.0.0-java)
pry (>= 0.13, < 0.14)
ruby-debug-base (>= 0.10.4, < 0.12)
rainbow (3.0.0)
rake (13.0.3)
regexp_parser (2.1.1)
rexml (3.2.5)
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
rspec-mocks (~> 3.10.0)
rspec-collection_matchers (1.2.0)
rspec-expectations (>= 2.99.0.beta1)
rspec-core (3.10.1)
rspec-support (~> 3.10.0)
rspec-expectations (3.10.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-mocks (3.10.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-support (3.10.2)
rspec_junit_formatter (0.4.1)
rspec-core (>= 2, < 4, != 2.12.0)
rspec_n (1.3.0)
colorize (~> 0.8.0)
cri (~> 2.15.3)
rubocop (1.17.0)
parallel (~> 1.10)
parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.7.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.7.0)
parser (>= 3.0.1.1)
rubocop-performance (1.11.3)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rspec (2.4.0)
rubocop (~> 1.0)
rubocop-ast (>= 1.1.0)
ruby-debug-base (0.11.0-java)
ruby-progressbar (1.11.0)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.3)
spoon (0.0.6)
ffi
thor (1.1.0)
unicode-display_width (2.0.0)
warning (1.2.0)
webmock (3.13.0)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
yard (0.9.26)

PLATFORMS
java

DEPENDENCIES
addressable (~> 2.4.0)
appraisal (~> 2.2)
benchmark-ips (~> 2.8)
benchmark-memory (~> 0.1)
builder
climate_control (~> 0.2.0)
concurrent-ruby
ddtrace!
dogstatsd-ruby (< 5.0)
memory_profiler (~> 0.9)
minitest (= 5.10.1)
minitest-around (= 0.5.0)
minitest-stub_any_instance (= 1.0.2)
opentelemetry-sdk (>= 1.0.0.rc2)
opentracing (>= 0.4.1)
pimpmychangelog (>= 0.1.2)
pry
pry-debugger-jruby
rake (>= 10.5)
rspec (~> 3.10)
rspec-collection_matchers (~> 1.1)
rspec_junit_formatter (>= 0.4.1)
rspec_n (~> 1.3)
rubocop (~> 1.10)
rubocop-performance (~> 1.9)
rubocop-rspec (~> 2.2)
simplecov!
warning (~> 1)
webmock (>= 3.10.0)
yard (~> 0.9)

BUNDLED WITH
1.17.1
35 changes: 35 additions & 0 deletions gemfiles/jruby_9.2.0.0_opentelemetry_pre_1_0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "addressable", "~> 2.4.0"
gem "appraisal", "~> 2.2"
gem "benchmark-ips", "~> 2.8"
gem "benchmark-memory", "~> 0.1"
gem "builder"
gem "climate_control", "~> 0.2.0"
gem "concurrent-ruby"
gem "memory_profiler", "~> 0.9"
gem "minitest", "= 5.10.1"
gem "minitest-around", "0.5.0"
gem "minitest-stub_any_instance", "1.0.2"
gem "pimpmychangelog", ">= 0.1.2"
gem "pry"
gem "pry-debugger-jruby"
gem "rake", ">= 10.5"
gem "rspec", "~> 3.10"
gem "rspec-collection_matchers", "~> 1.1"
gem "rspec_junit_formatter", ">= 0.4.1"
gem "rspec_n", "~> 1.3"
gem "simplecov", git: "https://github.com/DataDog/simplecov", ref: "3bb6b7ee58bf4b1954ca205f50dd44d6f41c57db"
gem "warning", "~> 1"
gem "webmock", ">= 3.10.0"
gem "yard", "~> 0.9"
gem "rubocop", "~> 1.10", require: false
gem "rubocop-performance", "~> 1.9", require: false
gem "rubocop-rspec", "~> 2.2", require: false
gem "dogstatsd-ruby", "< 5.0"
gem "opentracing", ">= 0.4.1"
gem "opentelemetry-sdk", "< 1"

gemspec path: "../"
Loading

0 comments on commit 268128c

Please sign in to comment.