opentelemetry-instrumentation-ruby_kafka 0.18.5 → 0.18.6

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: 2c2c0fc98f0ba8b720bcb59c1d1a14e052489bcf11f80a25230021bd8a3d40f1
4
- data.tar.gz: fc1d29818408f225b00c3e573e423114821be7e1bf4a4fef5f97955616a22a51
3
+ metadata.gz: 3ce0035e7b4e1ad13b91ab90c157529e073fcfe85214f63042965cdec193449f
4
+ data.tar.gz: 5c0d6aede5d7e84702a399161109574eb1219dc5fca46f53dec218591ed2f7eb
5
5
  SHA512:
6
- metadata.gz: a6c7d24906f06abd5461f63e559ff02fa8d59ff2eee652595dd4b9a5eee3a039343d75280f106ca710adfd887c0d3758a4d318ae41992ea378ee2764c13f76b1
7
- data.tar.gz: 5876237070d61604603bf24273866f2640be50f08970321cd67f165618805f4ae8094f7432abc3555b1033d6eab13ec84728187d45d2f835d4d32b68ce31259b
6
+ metadata.gz: 2a568b807a7e2ff0f40ed40c2d06a576ee7bbc7442d2ca2d0fc9f3387ac13b91ee23bc047bbd040ec9e51e5151668fd42ddb48d27b7c442b5648da9b024d45b6
7
+ data.tar.gz: adf70c5f23b35199dd05c084555f1da8c8cf7c566a44e50cc5b7a388cc49d4d9e8adf941e117bbe15ede57ff91fc95eee3bb24cecb481c40065b05ae20cddd06
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Release History: opentelemetry-instrumentation-ruby_kafka
2
2
 
3
+ ### v0.18.6 / 2022-05-02
4
+
5
+ * FIXED: RubyGems Fallback
6
+
3
7
  ### v0.18.5 / 2021-12-02
4
8
 
5
9
  * (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.5'
10
+ VERSION = '0.18.6'
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.5
4
+ version: 0.18.6
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-12-02 00:00:00.000000000 Z
11
+ date: 2022-05-02 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.19.0
33
+ version: 0.20.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.19.0
40
+ version: 0.20.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: appraisal
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -196,15 +196,16 @@ files:
196
196
  - lib/opentelemetry/instrumentation/ruby_kafka/patches/client.rb
197
197
  - lib/opentelemetry/instrumentation/ruby_kafka/patches/consumer.rb
198
198
  - lib/opentelemetry/instrumentation/ruby_kafka/patches/producer.rb
199
+ - lib/opentelemetry/instrumentation/ruby_kafka/utils.rb
199
200
  - lib/opentelemetry/instrumentation/ruby_kafka/version.rb
200
201
  homepage: https://github.com/open-telemetry/opentelemetry-ruby
201
202
  licenses:
202
203
  - Apache-2.0
203
204
  metadata:
204
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-ruby_kafka/v0.18.5/file.CHANGELOG.html
205
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-ruby_kafka/v0.18.6/file.CHANGELOG.html
205
206
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/instrumentation/ruby_kafka
206
207
  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.5
208
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-ruby_kafka/v0.18.6
208
209
  post_install_message:
209
210
  rdoc_options: []
210
211
  require_paths: