File tree Expand file tree Collapse file tree 5 files changed +14
-9
lines changed
lib/opentelemetry/instrumentation/rdkafka
test/opentelemetry/instrumentation/rdkafka Expand file tree Collapse file tree 5 files changed +14
-9
lines changed Original file line number Diff line number Diff line change 44#
55# SPDX-License-Identifier: Apache-2.0
66
7- appraise 'rdkafka-0.12.x' do
8- gem 'rdkafka' , '~> 0.12.0'
9- end
10-
11- appraise 'rdkafka-0.13.x' do
12- gem 'rdkafka' , '~> 0.13.0'
7+ %w[ 0.12.0 0.13.0 0.14.0 ] . each do |version |
8+ appraise "rdkafka-#{ version } " do
9+ gem 'rdkafka' , "~> #{ version } "
10+ end
1311end
1412
1513appraise 'rdkafka-latest' do
Original file line number Diff line number Diff line change @@ -9,10 +9,9 @@ module Instrumentation
99 module Rdkafka
1010 # The Instrumentation class contains logic to detect and install the Rdkafka instrumentation
1111 class Instrumentation < OpenTelemetry ::Instrumentation ::Base
12- MINIMUM_VERSION = Gem ::Version . new ( '0.10.0' )
13-
1412 compatible do
15- Gem ::Version . new ( ::Rdkafka ::VERSION ) >= MINIMUM_VERSION
13+ gem_version = Gem ::Version . new ( ::Rdkafka ::VERSION )
14+ Gem ::Requirement . new ( '>= 0.10.0' , '< 0.15.0' ) . satisfied_by? ( gem_version )
1615 end
1716
1817 install do |_config |
Original file line number Diff line number Diff line change 2222
2323 describe '#install' do
2424 it 'accepts argument' do
25+ skip "#{ Rdkafka ::VERSION } is not supported" unless instrumentation . compatible?
2526 _ ( instrumentation . install ( { } ) ) . must_equal ( true )
2627 instrumentation . instance_variable_set ( :@installed , false )
2728 end
Original file line number Diff line number Diff line change 3333
3434 describe '#each' do
3535 it 'traces each call' do
36+ skip "#{ Rdkafka ::VERSION } is not supported" unless instrumentation . compatible?
37+
3638 rand_hash = SecureRandom . hex ( 10 )
3739 topic_name = "consumer-patch-trace-#{ rand_hash } "
3840 config = { 'bootstrap.servers' : "#{ host } :#{ port } " }
112114 end
113115
114116 it 'encodes messages keys depending on input format' do
117+ skip "#{ Rdkafka ::VERSION } is not supported" unless instrumentation . compatible?
118+
115119 rand_hash = SecureRandom . hex ( 10 )
116120 topic_name = "consumer-patch-trace-#{ rand_hash } "
117121 config = { 'bootstrap.servers' : "#{ host } :#{ port } " }
164168
165169 describe '#each_batch' do
166170 it 'traces each_batch call' do
171+ skip "#{ Rdkafka ::VERSION } is not supported" unless instrumentation . compatible?
172+
167173 rand_hash = SecureRandom . hex ( 10 )
168174 topic_name = "consumer-patch-batch-trace-#{ rand_hash } "
169175 config = { 'bootstrap.servers' : "#{ host } :#{ port } " }
Original file line number Diff line number Diff line change 3232
3333 describe 'tracing' do
3434 it 'traces sync produce calls' do
35+ skip "#{ Rdkafka ::VERSION } is not supported" unless instrumentation . compatible?
3536 topic_name = 'producer-patch-trace'
3637 config = { 'bootstrap.servers' : "#{ host } :#{ port } " }
3738
You can’t perform that action at this time.
0 commit comments