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 4
4
#
5
5
# SPDX-License-Identifier: Apache-2.0
6
6
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
13
11
end
14
12
15
13
appraise 'rdkafka-latest' do
Original file line number Diff line number Diff line change @@ -9,10 +9,9 @@ module Instrumentation
9
9
module Rdkafka
10
10
# The Instrumentation class contains logic to detect and install the Rdkafka instrumentation
11
11
class Instrumentation < OpenTelemetry ::Instrumentation ::Base
12
- MINIMUM_VERSION = Gem ::Version . new ( '0.10.0' )
13
-
14
12
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 )
16
15
end
17
16
18
17
install do |_config |
Original file line number Diff line number Diff line change 22
22
23
23
describe '#install' do
24
24
it 'accepts argument' do
25
+ skip "#{ Rdkafka ::VERSION } is not supported" unless instrumentation . compatible?
25
26
_ ( instrumentation . install ( { } ) ) . must_equal ( true )
26
27
instrumentation . instance_variable_set ( :@installed , false )
27
28
end
Original file line number Diff line number Diff line change 33
33
34
34
describe '#each' do
35
35
it 'traces each call' do
36
+ skip "#{ Rdkafka ::VERSION } is not supported" unless instrumentation . compatible?
37
+
36
38
rand_hash = SecureRandom . hex ( 10 )
37
39
topic_name = "consumer-patch-trace-#{ rand_hash } "
38
40
config = { 'bootstrap.servers' : "#{ host } :#{ port } " }
112
114
end
113
115
114
116
it 'encodes messages keys depending on input format' do
117
+ skip "#{ Rdkafka ::VERSION } is not supported" unless instrumentation . compatible?
118
+
115
119
rand_hash = SecureRandom . hex ( 10 )
116
120
topic_name = "consumer-patch-trace-#{ rand_hash } "
117
121
config = { 'bootstrap.servers' : "#{ host } :#{ port } " }
164
168
165
169
describe '#each_batch' do
166
170
it 'traces each_batch call' do
171
+ skip "#{ Rdkafka ::VERSION } is not supported" unless instrumentation . compatible?
172
+
167
173
rand_hash = SecureRandom . hex ( 10 )
168
174
topic_name = "consumer-patch-batch-trace-#{ rand_hash } "
169
175
config = { 'bootstrap.servers' : "#{ host } :#{ port } " }
Original file line number Diff line number Diff line change 32
32
33
33
describe 'tracing' do
34
34
it 'traces sync produce calls' do
35
+ skip "#{ Rdkafka ::VERSION } is not supported" unless instrumentation . compatible?
35
36
topic_name = 'producer-patch-trace'
36
37
config = { 'bootstrap.servers' : "#{ host } :#{ port } " }
37
38
You can’t perform that action at this time.
0 commit comments