opentelemetry-instrumentation-ruby_kafka 0.18.4 → 0.19.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c96f460c712257026eda354253cbe9ef59d8c86e90d22c1c6a70c459ba234765
4
- data.tar.gz: b2a49c527bec89ba2147e3eac237b2a612b4ebc6590a44fe6a910fb300c3fce0
3
+ metadata.gz: c1fb7edf33409125e90f4fff35df9709adc03a59fcf279e5539716e5aea11109
4
+ data.tar.gz: d3618a72a5c3972ec3ab74d0fbdb4ccead8bab6284ebe3494a83fe27dd22be65
5
5
  SHA512:
6
- metadata.gz: 89080545fb14a6f62f23575e8c70a8c47e108c8a1f6120816069006085a4b87ad32b450f827fc7a72c28505f67d7efa3600db1ca6cbb7d783ed64e9bd22ae56b
7
- data.tar.gz: d5634c7b8e97de4600dfafd62b7aaf0a0c05c9b60017eed3f663a134ae76fd15eafac560d9f97d70f6719f022ca5d651431a93974ed74bcbdbdca9982ed8d39a
6
+ metadata.gz: a6056b4d5ca288b8b69a5a4898f86fa7f44907ddc7308df0a11abc028a68dda60e6ebc8740831e0500cf113e5601b0b6ab466f3bc4c7c1d37aa2d060eb01e411
7
+ data.tar.gz: a8e8d22d8400c607d0f998d33b1387e95ac889616b86c849f18a04bd877a7ca5ccc5eadea7837f8cb4e96876aaae19a641386d6baf3aad6137bf6cde8163c6cf
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Release History: opentelemetry-instrumentation-ruby_kafka
2
2
 
3
+ ### v0.19.0 / 2022-06-09
4
+
5
+ * Upgrading Base dependency version
6
+ * FIXED: Broken test file requirements
7
+
8
+ ### v0.18.6 / 2022-05-02
9
+
10
+ * FIXED: RubyGems Fallback
11
+
12
+ ### v0.18.5 / 2021-12-02
13
+
14
+ * (No significant changes)
15
+
3
16
  ### v0.18.4 / 2021-09-29
4
17
 
5
18
  * (No significant changes)
@@ -28,7 +28,7 @@ module OpenTelemetry
28
28
  private
29
29
 
30
30
  def gem_version
31
- Gem.loaded_specs['ruby-kafka']&.version || Gem::Version.new(Kafka::VERSION)
31
+ Gem::Version.new(Kafka::VERSION)
32
32
  end
33
33
 
34
34
  def require_patches
@@ -4,6 +4,8 @@
4
4
  #
5
5
  # SPDX-License-Identifier: Apache-2.0
6
6
 
7
+ require_relative '../utils'
8
+
7
9
  module OpenTelemetry
8
10
  module Instrumentation
9
11
  module RubyKafka
@@ -17,7 +19,9 @@ module OpenTelemetry
17
19
  'messaging.destination_kind' => 'topic'
18
20
  }
19
21
 
20
- attributes['messaging.kafka.message_key'] = key if key
22
+ message_key = Utils.extract_message_key(key)
23
+ attributes['messaging.kafka.message_key'] = message_key if message_key
24
+
21
25
  attributes['messaging.kafka.partition'] = partition if partition
22
26
 
23
27
  tracer.in_span("#{topic} send", attributes: attributes, kind: :producer) do
@@ -35,7 +39,8 @@ module OpenTelemetry
35
39
  'messaging.kafka.partition' => message.partition
36
40
  }
37
41
 
38
- attributes['messaging.kafka.message_key'] = message.key if message.key
42
+ message_key = Utils.extract_message_key(message.key)
43
+ attributes['messaging.kafka.message_key'] = message_key if message_key
39
44
 
40
45
  parent_context = OpenTelemetry.propagation.extract(message.headers)
41
46
  OpenTelemetry::Context.with_current(parent_context) do
@@ -20,7 +20,8 @@ module OpenTelemetry
20
20
  'messaging.kafka.offset' => message.offset
21
21
  }
22
22
 
23
- attributes['messaging.kafka.message_key'] = message.key if message.key
23
+ message_key = Utils.extract_message_key(message.key)
24
+ attributes['messaging.kafka.message_key'] = message_key if message_key
24
25
 
25
26
  parent_context = OpenTelemetry.propagation.extract(message.headers)
26
27
  span_context = OpenTelemetry::Trace.current_span(parent_context).context
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright The OpenTelemetry Authors
4
+ #
5
+ # SPDX-License-Identifier: Apache-2.0
6
+
7
+ module OpenTelemetry
8
+ module Instrumentation
9
+ module RubyKafka
10
+ # Utilities to help with instrumenting kafka
11
+ module Utils
12
+ module_function
13
+
14
+ def extract_message_key(key)
15
+ # skip encode if already valid utf8
16
+ return key if key.nil? || (key.encoding == Encoding::UTF_8 && key.valid_encoding?)
17
+
18
+ key.encode(Encoding::UTF_8)
19
+ rescue Encoding::UndefinedConversionError
20
+ nil
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module RubyKafka
10
- VERSION = '0.18.4'
10
+ VERSION = '0.19.0'
11
11
  end
12
12
  end
13
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opentelemetry-instrumentation-ruby_kafka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.4
4
+ version: 0.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenTelemetry Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-30 00:00:00.000000000 Z
11
+ date: 2022-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.18.3
33
+ version: 0.21.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.18.3
40
+ version: 0.21.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: appraisal
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -86,14 +86,28 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '1.0'
89
+ version: '1.1'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '1.0'
96
+ version: '1.1'
97
+ - !ruby/object:Gem::Dependency
98
+ name: opentelemetry-test-helpers
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: rspec-mocks
99
113
  requirement: !ruby/object:Gem::Requirement
@@ -196,15 +210,16 @@ files:
196
210
  - lib/opentelemetry/instrumentation/ruby_kafka/patches/client.rb
197
211
  - lib/opentelemetry/instrumentation/ruby_kafka/patches/consumer.rb
198
212
  - lib/opentelemetry/instrumentation/ruby_kafka/patches/producer.rb
213
+ - lib/opentelemetry/instrumentation/ruby_kafka/utils.rb
199
214
  - lib/opentelemetry/instrumentation/ruby_kafka/version.rb
200
215
  homepage: https://github.com/open-telemetry/opentelemetry-ruby
201
216
  licenses:
202
217
  - Apache-2.0
203
218
  metadata:
204
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-ruby_kafka/v0.18.4/file.CHANGELOG.html
219
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-ruby_kafka/v0.19.0/file.CHANGELOG.html
205
220
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/instrumentation/ruby_kafka
206
221
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
207
- documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-ruby_kafka/v0.18.4
222
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-ruby_kafka/v0.19.0
208
223
  post_install_message:
209
224
  rdoc_options: []
210
225
  require_paths:
@@ -213,7 +228,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
213
228
  requirements:
214
229
  - - ">="
215
230
  - !ruby/object:Gem::Version
216
- version: 2.5.0
231
+ version: 2.6.0
217
232
  required_rubygems_version: !ruby/object:Gem::Requirement
218
233
  requirements:
219
234
  - - ">="