opentelemetry-instrumentation-ruby_kafka 0.20.1 → 0.20.2
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 +2 -0
- data/lib/opentelemetry/instrumentation/ruby_kafka/patches/async_producer.rb +26 -0
- data/lib/opentelemetry/instrumentation/ruby_kafka/patches/producer.rb +9 -3
- data/lib/opentelemetry/instrumentation/ruby_kafka/version.rb +1 -1
- data/lib/opentelemetry/instrumentation/ruby_kafka.rb +2 -2
- data/lib/opentelemetry/instrumentation.rb +1 -1
- data/lib/opentelemetry-instrumentation-ruby_kafka.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: 3fc93b53a9e290e09a9682342efefccab2eeca8ec6de527eae81c2f16fca74d7
|
4
|
+
data.tar.gz: 60cd6ff58f39eac71c8163a2e734aa0ac3d6f51eae6de0fc855c448088f69bab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8b62e4319b6970795cb314c0550e07d4d83be4a753850a8c0bbe0a1cfe7f231d2c6239558dfeb7201c0355b35b3f8bb3e663daa4d2b7501694a4e2f572b6b01
|
7
|
+
data.tar.gz: 7db39cffc72d33aab5fad426af7eb05f2457b1a2ede39986ac4f535dbb8e0c9b12651019892acc5fe87429ad5d577af4d21a2a463f9d76b82d72d693887bbe5d
|
data/CHANGELOG.md
CHANGED
@@ -32,12 +32,14 @@ module OpenTelemetry
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def require_patches
|
35
|
+
require_relative 'patches/async_producer'
|
35
36
|
require_relative 'patches/producer'
|
36
37
|
require_relative 'patches/consumer'
|
37
38
|
require_relative 'patches/client'
|
38
39
|
end
|
39
40
|
|
40
41
|
def patch
|
42
|
+
::Kafka::AsyncProducer.prepend(Patches::AsyncProducer)
|
41
43
|
::Kafka::Producer.prepend(Patches::Producer)
|
42
44
|
::Kafka::Consumer.prepend(Patches::Consumer)
|
43
45
|
::Kafka::Client.prepend(Patches::Client)
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenTelemetry
|
4
|
+
module Instrumentation
|
5
|
+
module RubyKafka
|
6
|
+
module Patches
|
7
|
+
# The AsyncProducer module contains the instrumentation patch the AsyncProducer#produce method
|
8
|
+
module AsyncProducer
|
9
|
+
def produce(value, topic:, **options)
|
10
|
+
options = __otel_merge_options!(**options)
|
11
|
+
super
|
12
|
+
end
|
13
|
+
|
14
|
+
def __otel_merge_options!(**options)
|
15
|
+
options ||= { headers: {} }
|
16
|
+
# The propagator mutates the carrier (first positional argument), so we need to set headers to empty hash so
|
17
|
+
# that there's something to mutate
|
18
|
+
options[:headers] = {} unless options[:headers]
|
19
|
+
OpenTelemetry.propagation.inject(options[:headers])
|
20
|
+
options
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -17,9 +17,15 @@ module OpenTelemetry
|
|
17
17
|
'messaging.destination_kind' => 'topic'
|
18
18
|
}
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
# If trace context is present in headers, extract and use it as parent. If there is _no_ trace context key
|
21
|
+
# in the headers, OpenTelemetry.propagation.extract will return an unmodified copy of the the current
|
22
|
+
# Thread's context, so the next two lines preserve the correct Thread-local context.
|
23
|
+
ctx = OpenTelemetry.propagation.extract(headers)
|
24
|
+
OpenTelemetry::Context.with_current(ctx) do
|
25
|
+
tracer.in_span("#{topic} send", attributes: attributes, kind: :producer) do
|
26
|
+
OpenTelemetry.propagation.inject(headers)
|
27
|
+
super
|
28
|
+
end
|
23
29
|
end
|
24
30
|
end
|
25
31
|
|
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.20.
|
4
|
+
version: 0.20.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenTelemetry Authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opentelemetry-api
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.
|
131
|
+
version: 1.55.1
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 1.
|
138
|
+
version: 1.55.1
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: ruby-kafka
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -207,6 +207,7 @@ files:
|
|
207
207
|
- lib/opentelemetry/instrumentation.rb
|
208
208
|
- lib/opentelemetry/instrumentation/ruby_kafka.rb
|
209
209
|
- lib/opentelemetry/instrumentation/ruby_kafka/instrumentation.rb
|
210
|
+
- lib/opentelemetry/instrumentation/ruby_kafka/patches/async_producer.rb
|
210
211
|
- lib/opentelemetry/instrumentation/ruby_kafka/patches/client.rb
|
211
212
|
- lib/opentelemetry/instrumentation/ruby_kafka/patches/consumer.rb
|
212
213
|
- lib/opentelemetry/instrumentation/ruby_kafka/patches/producer.rb
|
@@ -216,10 +217,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby-contrib
|
|
216
217
|
licenses:
|
217
218
|
- Apache-2.0
|
218
219
|
metadata:
|
219
|
-
changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-ruby_kafka/0.20.
|
220
|
+
changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-ruby_kafka/0.20.2/file/CHANGELOG.md
|
220
221
|
source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/ruby_kafka
|
221
222
|
bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
|
222
|
-
documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-ruby_kafka/0.20.
|
223
|
+
documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-ruby_kafka/0.20.2
|
223
224
|
post_install_message:
|
224
225
|
rdoc_options: []
|
225
226
|
require_paths:
|