opentelemetry-instrumentation-ruby_kafka 0.18.3 → 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: 3c197d8f9658380579166a37e44625baeece12899ed428cf9f82c4e451fc2edf
4
- data.tar.gz: 201ecc2e0eb0c5856b390f7dd4099ae7ce0089be871f15bd0418fff12f6609bc
3
+ metadata.gz: 3ce0035e7b4e1ad13b91ab90c157529e073fcfe85214f63042965cdec193449f
4
+ data.tar.gz: 5c0d6aede5d7e84702a399161109574eb1219dc5fca46f53dec218591ed2f7eb
5
5
  SHA512:
6
- metadata.gz: 573936f80cf6ff98ad603bb73d86e1a96581c922b1b32195d40168a8fd9b2a9d82984afb2fb0d471673c613f1560d13f1b0f98959f17989f65e2d5c1728721e2
7
- data.tar.gz: adf455e7acfb9712be7e6fc1db17657bd7aa3dccf489b9af7c155a2733bfc70c011fd80ad60360081b1d8ab1035ad881f06624dc4d475e4a3f1c43b31f09f529
6
+ metadata.gz: 2a568b807a7e2ff0f40ed40c2d06a576ee7bbc7442d2ca2d0fc9f3387ac13b91ee23bc047bbd040ec9e51e5151668fd42ddb48d27b7c442b5648da9b024d45b6
7
+ data.tar.gz: adf70c5f23b35199dd05c084555f1da8c8cf7c566a44e50cc5b7a388cc49d4d9e8adf941e117bbe15ede57ff91fc95eee3bb24cecb481c40065b05ae20cddd06
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Release History: opentelemetry-instrumentation-ruby_kafka
2
2
 
3
+ ### v0.18.6 / 2022-05-02
4
+
5
+ * FIXED: RubyGems Fallback
6
+
7
+ ### v0.18.5 / 2021-12-02
8
+
9
+ * (No significant changes)
10
+
11
+ ### v0.18.4 / 2021-09-29
12
+
13
+ * (No significant changes)
14
+
3
15
  ### v0.18.3 / 2021-09-29
4
16
 
5
17
  * FIXED: Use Kafka::VERSION fallback for compatibility
@@ -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.3'
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.3
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-09-29 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
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.0.0.rc3
19
+ version: '1.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.0.0.rc3
26
+ version: '1.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: opentelemetry-instrumentation-base
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.18.2
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.18.2
40
+ version: 0.20.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: appraisal
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 1.0.0.rc1
89
+ version: '1.0'
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.0.rc1
96
+ version: '1.0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rspec-mocks
99
99
  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.3/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.3
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: