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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/opentelemetry/instrumentation/ruby_kafka/instrumentation.rb +1 -1
- data/lib/opentelemetry/instrumentation/ruby_kafka/patches/client.rb +7 -2
- data/lib/opentelemetry/instrumentation/ruby_kafka/patches/consumer.rb +2 -1
- data/lib/opentelemetry/instrumentation/ruby_kafka/utils.rb +25 -0
- data/lib/opentelemetry/instrumentation/ruby_kafka/version.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ce0035e7b4e1ad13b91ab90c157529e073fcfe85214f63042965cdec193449f
|
4
|
+
data.tar.gz: 5c0d6aede5d7e84702a399161109574eb1219dc5fca46f53dec218591ed2f7eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a568b807a7e2ff0f40ed40c2d06a576ee7bbc7442d2ca2d0fc9f3387ac13b91ee23bc047bbd040ec9e51e5151668fd42ddb48d27b7c442b5648da9b024d45b6
|
7
|
+
data.tar.gz: adf70c5f23b35199dd05c084555f1da8c8cf7c566a44e50cc5b7a388cc49d4d9e8adf941e117bbe15ede57ff91fc95eee3bb24cecb481c40065b05ae20cddd06
|
data/CHANGELOG.md
CHANGED
@@ -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
|
-
|
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
|
-
|
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
|
-
|
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
|
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
|
+
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:
|
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.
|
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.
|
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.
|
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.
|
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:
|