opentelemetry-instrumentation-ruby_kafka 0.20.1 → 0.21.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -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/client.rb +1 -1
- 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 +9 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 304cebb35fa179634d1ea9f3baf2559021ed69bdae1d2a1348dd4511b5df1260
|
4
|
+
data.tar.gz: c0273721ce9c27a4c9ce55e1d7d9647b743f85b9e141755f7001ee5258dc36ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53a19b2190a50b3ad22c4817af0867e5808d604c862f85e5ff0381de148d8282f64df5c65aee3c9e0ed70465caddd19498defb12a5a47d33266ad9b996ea0e66
|
7
|
+
data.tar.gz: 58f1e0e7e7131c87f9ec663d2c9b48192e4e98c106e7c2159ab2228aa61252489097e513509ea1add7f8f1204c846966c45dc7f25d843fed07462b7574f1ca27
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Release History: opentelemetry-instrumentation-ruby_kafka
|
2
2
|
|
3
|
+
### v0.21.0 / 2023-09-07
|
4
|
+
|
5
|
+
* FIXED: Align messaging instrumentation operation names
|
6
|
+
|
7
|
+
### v0.20.2 / 2023-08-09
|
8
|
+
|
9
|
+
* FIXED: propagate context from async producer
|
10
|
+
|
3
11
|
### v0.20.1 / 2023-06-05
|
4
12
|
|
5
13
|
* FIXED: Base config options
|
@@ -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
|
@@ -24,7 +24,7 @@ module OpenTelemetry
|
|
24
24
|
|
25
25
|
attributes['messaging.kafka.partition'] = partition if partition
|
26
26
|
|
27
|
-
tracer.in_span("#{topic}
|
27
|
+
tracer.in_span("#{topic} publish", attributes: attributes, kind: :producer) do
|
28
28
|
OpenTelemetry.propagation.inject(headers)
|
29
29
|
super
|
30
30
|
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} publish", 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.
|
4
|
+
version: 0.21.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: 2023-
|
11
|
+
date: 2023-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opentelemetry-api
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 2.
|
47
|
+
version: '2.5'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 2.
|
54
|
+
version: '2.5'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.
|
131
|
+
version: 1.56.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.56.1
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: ruby-kafka
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -178,20 +178,6 @@ dependencies:
|
|
178
178
|
- - "~>"
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: '0.9'
|
181
|
-
- !ruby/object:Gem::Dependency
|
182
|
-
name: yard-doctest
|
183
|
-
requirement: !ruby/object:Gem::Requirement
|
184
|
-
requirements:
|
185
|
-
- - "~>"
|
186
|
-
- !ruby/object:Gem::Version
|
187
|
-
version: 0.1.6
|
188
|
-
type: :development
|
189
|
-
prerelease: false
|
190
|
-
version_requirements: !ruby/object:Gem::Requirement
|
191
|
-
requirements:
|
192
|
-
- - "~>"
|
193
|
-
- !ruby/object:Gem::Version
|
194
|
-
version: 0.1.6
|
195
181
|
description: RubyKafka instrumentation for the OpenTelemetry framework
|
196
182
|
email:
|
197
183
|
- cncf-opentelemetry-contributors@lists.cncf.io
|
@@ -207,6 +193,7 @@ files:
|
|
207
193
|
- lib/opentelemetry/instrumentation.rb
|
208
194
|
- lib/opentelemetry/instrumentation/ruby_kafka.rb
|
209
195
|
- lib/opentelemetry/instrumentation/ruby_kafka/instrumentation.rb
|
196
|
+
- lib/opentelemetry/instrumentation/ruby_kafka/patches/async_producer.rb
|
210
197
|
- lib/opentelemetry/instrumentation/ruby_kafka/patches/client.rb
|
211
198
|
- lib/opentelemetry/instrumentation/ruby_kafka/patches/consumer.rb
|
212
199
|
- lib/opentelemetry/instrumentation/ruby_kafka/patches/producer.rb
|
@@ -216,10 +203,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby-contrib
|
|
216
203
|
licenses:
|
217
204
|
- Apache-2.0
|
218
205
|
metadata:
|
219
|
-
changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-ruby_kafka/0.
|
206
|
+
changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-ruby_kafka/0.21.0/file/CHANGELOG.md
|
220
207
|
source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/ruby_kafka
|
221
208
|
bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
|
222
|
-
documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-ruby_kafka/0.
|
209
|
+
documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-ruby_kafka/0.21.0
|
223
210
|
post_install_message:
|
224
211
|
rdoc_options: []
|
225
212
|
require_paths:
|