diff --git a/instrumentation/rdkafka/Appraisals b/instrumentation/rdkafka/Appraisals index ec35aac46..6aa63adaf 100644 --- a/instrumentation/rdkafka/Appraisals +++ b/instrumentation/rdkafka/Appraisals @@ -4,12 +4,10 @@ # # SPDX-License-Identifier: Apache-2.0 -appraise 'rdkafka-0.12.x' do - gem 'rdkafka', '~> 0.12.0' -end - -appraise 'rdkafka-0.13.x' do - gem 'rdkafka', '~> 0.13.0' +%w[0.12.0 0.13.0 0.14.0].each do |version| + appraise "rdkafka-#{version}" do + gem 'rdkafka', "~> #{version}" + end end appraise 'rdkafka-latest' do diff --git a/instrumentation/rdkafka/lib/opentelemetry/instrumentation/rdkafka/instrumentation.rb b/instrumentation/rdkafka/lib/opentelemetry/instrumentation/rdkafka/instrumentation.rb index 4d9919145..e240b991e 100644 --- a/instrumentation/rdkafka/lib/opentelemetry/instrumentation/rdkafka/instrumentation.rb +++ b/instrumentation/rdkafka/lib/opentelemetry/instrumentation/rdkafka/instrumentation.rb @@ -9,10 +9,9 @@ module Instrumentation module Rdkafka # The Instrumentation class contains logic to detect and install the Rdkafka instrumentation class Instrumentation < OpenTelemetry::Instrumentation::Base - MINIMUM_VERSION = Gem::Version.new('0.10.0') - compatible do - Gem::Version.new(::Rdkafka::VERSION) >= MINIMUM_VERSION + gem_version = Gem::Version.new(::Rdkafka::VERSION) + Gem::Requirement.new('>= 0.10.0', '< 0.15.0').satisfied_by?(gem_version) end install do |_config| diff --git a/instrumentation/rdkafka/test/opentelemetry/instrumentation/rdkafka/instrumentation_test.rb b/instrumentation/rdkafka/test/opentelemetry/instrumentation/rdkafka/instrumentation_test.rb index 9344b459d..d46a6ccdb 100644 --- a/instrumentation/rdkafka/test/opentelemetry/instrumentation/rdkafka/instrumentation_test.rb +++ b/instrumentation/rdkafka/test/opentelemetry/instrumentation/rdkafka/instrumentation_test.rb @@ -22,6 +22,7 @@ describe '#install' do it 'accepts argument' do + skip "#{Rdkafka::VERSION} is not supported" unless instrumentation.compatible? _(instrumentation.install({})).must_equal(true) instrumentation.instance_variable_set(:@installed, false) end diff --git a/instrumentation/rdkafka/test/opentelemetry/instrumentation/rdkafka/patches/consumer_test.rb b/instrumentation/rdkafka/test/opentelemetry/instrumentation/rdkafka/patches/consumer_test.rb index bfd2f9da7..d2472bc81 100644 --- a/instrumentation/rdkafka/test/opentelemetry/instrumentation/rdkafka/patches/consumer_test.rb +++ b/instrumentation/rdkafka/test/opentelemetry/instrumentation/rdkafka/patches/consumer_test.rb @@ -33,6 +33,8 @@ describe '#each' do it 'traces each call' do + skip "#{Rdkafka::VERSION} is not supported" unless instrumentation.compatible? + rand_hash = SecureRandom.hex(10) topic_name = "consumer-patch-trace-#{rand_hash}" config = { 'bootstrap.servers': "#{host}:#{port}" } @@ -112,6 +114,8 @@ end it 'encodes messages keys depending on input format' do + skip "#{Rdkafka::VERSION} is not supported" unless instrumentation.compatible? + rand_hash = SecureRandom.hex(10) topic_name = "consumer-patch-trace-#{rand_hash}" config = { 'bootstrap.servers': "#{host}:#{port}" } @@ -164,6 +168,8 @@ describe '#each_batch' do it 'traces each_batch call' do + skip "#{Rdkafka::VERSION} is not supported" unless instrumentation.compatible? + rand_hash = SecureRandom.hex(10) topic_name = "consumer-patch-batch-trace-#{rand_hash}" config = { 'bootstrap.servers': "#{host}:#{port}" } diff --git a/instrumentation/rdkafka/test/opentelemetry/instrumentation/rdkafka/patches/producer_test.rb b/instrumentation/rdkafka/test/opentelemetry/instrumentation/rdkafka/patches/producer_test.rb index 06e40de58..1ee85f90f 100644 --- a/instrumentation/rdkafka/test/opentelemetry/instrumentation/rdkafka/patches/producer_test.rb +++ b/instrumentation/rdkafka/test/opentelemetry/instrumentation/rdkafka/patches/producer_test.rb @@ -32,6 +32,7 @@ describe 'tracing' do it 'traces sync produce calls' do + skip "#{Rdkafka::VERSION} is not supported" unless instrumentation.compatible? topic_name = 'producer-patch-trace' config = { 'bootstrap.servers': "#{host}:#{port}" }