opentelemetry-instrumentation-ruby_kafka 0.12.0 → 0.17.0

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: a1e4a1b9161c4b546f114ebb4dd245b31a65cb660e4bcb64269cd8b92400e53f
4
- data.tar.gz: 7f66abaa92b4dc4ab0b41b26aa39dbc3818c2e9197223211243985d079d58cfd
3
+ metadata.gz: '087545993e138641a9314c85f6c6e03e6f259f19274ea7038612a77e3d8a90cf'
4
+ data.tar.gz: e8f0c22542c8e49e895c20d2193ccc4eecff3169237f6efeb3ebdeda440facbe
5
5
  SHA512:
6
- metadata.gz: 93d4f1c8552777108e38640241b0904733e2e7f50afe99d6fab1621567b91119462cb44c667a90034efe013930bfd9dfd3a69f88f2592ff405a13b7a99c63b82
7
- data.tar.gz: 829d7321a191a7604a9c5b059bf11abec0748bbd5565c920c065d2b49e8dad32cdd26a8211e3d5481ba6c76235ede2fb781f0c21d5aaf798d6c1af34180c58a4
6
+ metadata.gz: 1eebd1d2d20db542cfd7dc44be4a0d56819bc2ba3a9e1f792ca506ddc162a94ef8364313cd67ba905b7f22017ca154710399cb29f7fc3eb3b02bf3f27d3814e0
7
+ data.tar.gz: ae1782ba4c1598b7b3db9fc1e2f2eee22c6bd5e078f71b6450ab22a9996f8f0e9829f6bc1eca1499581eba45d5f01ffe499e4c6303502971e4b3bad21490dbba
data/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Release History: opentelemetry-instrumentation-ruby_kafka
2
2
 
3
+ ### v0.17.0 / 2021-04-22
4
+
5
+ * (No significant changes)
6
+
7
+ ### v0.16.0 / 2021-03-17
8
+
9
+ * FIXED: Example scripts now reference local common lib
10
+ * DOCS: Replace Gitter with GitHub Discussions
11
+
12
+ ### v0.15.0 / 2021-02-18
13
+
14
+ * (No significant changes)
15
+
16
+ ### v0.14.0 / 2021-02-03
17
+
18
+ * BREAKING CHANGE: Replace getter and setter callables and remove rack specific propagators
19
+
20
+ * ADDED: Replace getter and setter callables and remove rack specific propagators
21
+
22
+ ### v0.13.0 / 2021-01-29
23
+
24
+ * FIXED: Add minimum gem version for ruby-kafka
25
+ * FIXED: Ruby_kafka baggage propagation
26
+ * FIXED: Remove unused ruby-kafka events file
27
+
3
28
  ### v0.12.0 / 2020-12-24
4
29
 
5
30
  * Initial release.
data/README.md CHANGED
@@ -32,13 +32,13 @@ end
32
32
 
33
33
  ## Examples
34
34
 
35
- Example usage can be seen in the `./example/ruby_kafka.rb` file [here](https://github.com/open-telemetry/opentelemetry-ruby/blob/master/instrumentation/ruby_kafka/example/ruby_kafka.rb)
35
+ Example usage can be seen in the `./example/ruby_kafka.rb` file [here](https://github.com/open-telemetry/opentelemetry-ruby/blob/main/instrumentation/ruby_kafka/example/ruby_kafka.rb)
36
36
 
37
37
  ## How can I get involved?
38
38
 
39
39
  The `opentelemetry-instrumentation-ruby_kafka` gem source is [on github][repo-github], along with related gems including `opentelemetry-api` and `opentelemetry-sdk`.
40
40
 
41
- The OpenTelemetry Ruby gems are maintained by the OpenTelemetry-Ruby special interest group (SIG). You can get involved by joining us on our [gitter channel][ruby-gitter] or attending our weekly meeting. See the [meeting calendar][community-meetings] for dates and times. For more information on this and other language SIGs, see the OpenTelemetry [community page][ruby-sig].
41
+ The OpenTelemetry Ruby gems are maintained by the OpenTelemetry-Ruby special interest group (SIG). You can get involved by joining us in [GitHub Discussions][discussions-url] or attending our weekly meeting. See the [meeting calendar][community-meetings] for dates and times. For more information on this and other language SIGs, see the OpenTelemetry [community page][ruby-sig].
42
42
 
43
43
  ## License
44
44
 
@@ -47,7 +47,7 @@ The `opentelemetry-instrumentation-ruby_kafka` gem is distributed under the Apac
47
47
  [ruby_kafka-home]: https://github.com/zendesk/ruby-kafka
48
48
  [bundler-home]: https://bundler.io
49
49
  [repo-github]: https://github.com/open-telemetry/opentelemetry-ruby
50
- [license-github]: https://github.com/open-telemetry/opentelemetry-ruby/blob/master/LICENSE
50
+ [license-github]: https://github.com/open-telemetry/opentelemetry-ruby/blob/main/LICENSE
51
51
  [ruby-sig]: https://github.com/open-telemetry/community#ruby-sig
52
52
  [community-meetings]: https://github.com/open-telemetry/community#community-meetings
53
- [ruby-gitter]: https://gitter.im/open-telemetry/opentelemetry-ruby
53
+ [discussions-url]: https://github.com/open-telemetry/opentelemetry-ruby/discussions
@@ -5,6 +5,7 @@
5
5
  # SPDX-License-Identifier: Apache-2.0
6
6
 
7
7
  require 'opentelemetry'
8
+ require 'opentelemetry-instrumentation-base'
8
9
 
9
10
  module OpenTelemetry
10
11
  module Instrumentation
@@ -10,17 +10,27 @@ module OpenTelemetry
10
10
  # The Instrumentation class contains logic to detect and install the
11
11
  # KafkaRuby instrumentation
12
12
  class Instrumentation < OpenTelemetry::Instrumentation::Base
13
+ MINIMUM_VERSION = Gem::Version.new('0.7.0')
14
+
13
15
  install do |_config|
14
16
  require_patches
15
17
  patch
16
18
  end
17
19
 
18
20
  present do
19
- defined?(::Kafka)
21
+ !defined?(::Kafka).nil?
22
+ end
23
+
24
+ compatible do
25
+ gem_version >= MINIMUM_VERSION
20
26
  end
21
27
 
22
28
  private
23
29
 
30
+ def gem_version
31
+ Gem.loaded_specs['ruby-kafka'].version
32
+ end
33
+
24
34
  def require_patches
25
35
  require_relative 'patches/producer'
26
36
  require_relative 'patches/consumer'
@@ -21,7 +21,7 @@ module OpenTelemetry
21
21
  attributes['messaging.kafka.partition'] = partition if partition
22
22
 
23
23
  tracer.in_span("#{topic} send", attributes: attributes, kind: :producer) do
24
- OpenTelemetry.propagation.text.inject(headers)
24
+ OpenTelemetry.propagation.inject(headers)
25
25
  super
26
26
  end
27
27
  end
@@ -37,9 +37,11 @@ module OpenTelemetry
37
37
 
38
38
  attributes['messaging.kafka.message_key'] = message.key if message.key
39
39
 
40
- parent_context = OpenTelemetry.propagation.text.extract(message.headers)
41
- tracer.in_span("#{topic} process", with_parent: parent_context, attributes: attributes, kind: :consumer) do
42
- yield message
40
+ parent_context = OpenTelemetry.propagation.extract(message.headers)
41
+ OpenTelemetry::Context.with_current(parent_context) do
42
+ tracer.in_span("#{topic} process", attributes: attributes, kind: :consumer) do
43
+ yield message
44
+ end
43
45
  end
44
46
  end
45
47
  end
@@ -22,12 +22,14 @@ module OpenTelemetry
22
22
 
23
23
  attributes['messaging.kafka.message_key'] = message.key if message.key
24
24
 
25
- span_context = OpenTelemetry::Trace.current_span(OpenTelemetry.propagation.text.extract(message.headers)).context
26
- link = OpenTelemetry::Trace::Link.new(span_context) if span_context.valid?
27
- links = [link] if link
25
+ parent_context = OpenTelemetry.propagation.extract(message.headers)
26
+ span_context = OpenTelemetry::Trace.current_span(parent_context).context
27
+ links = [OpenTelemetry::Trace::Link.new(span_context)] if span_context.valid?
28
28
 
29
- tracer.in_span("#{message.topic} process", links: links, attributes: attributes, kind: :consumer) do
30
- yield message
29
+ OpenTelemetry::Context.with_current(parent_context) do
30
+ tracer.in_span("#{message.topic} process", links: links, attributes: attributes, kind: :consumer) do
31
+ yield message
32
+ end
31
33
  end
32
34
  end
33
35
  end
@@ -45,7 +47,7 @@ module OpenTelemetry
45
47
  }
46
48
 
47
49
  links = batch.messages.map do |message|
48
- span_context = OpenTelemetry::Trace.current_span(OpenTelemetry.propagation.text.extract(message.headers)).context
50
+ span_context = OpenTelemetry::Trace.current_span(OpenTelemetry.propagation.extract(message.headers)).context
49
51
  OpenTelemetry::Trace::Link.new(span_context) if span_context.valid?
50
52
  end
51
53
  links.compact!
@@ -18,7 +18,7 @@ module OpenTelemetry
18
18
  }
19
19
 
20
20
  tracer.in_span("#{topic} send", attributes: attributes, kind: :producer) do
21
- OpenTelemetry.propagation.text.inject(headers)
21
+ OpenTelemetry.propagation.inject(headers)
22
22
  super
23
23
  end
24
24
  end
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module RubyKafka
10
- VERSION = '0.12.0'
10
+ VERSION = '0.17.0'
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.12.0
4
+ version: 0.17.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: 2020-12-24 00:00:00.000000000 Z
11
+ date: 2021-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -16,14 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.12.0
19
+ version: 0.17.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: 0.12.0
26
+ version: 0.17.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: opentelemetry-instrumentation-base
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.17.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.17.0
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: appraisal
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -80,6 +94,20 @@ dependencies:
80
94
  - - "~>"
81
95
  - !ruby/object:Gem::Version
82
96
  version: '0.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rspec-mocks
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
83
111
  - !ruby/object:Gem::Dependency
84
112
  name: rubocop
85
113
  requirement: !ruby/object:Gem::Requirement
@@ -164,7 +192,6 @@ files:
164
192
  - lib/opentelemetry-instrumentation-ruby_kafka.rb
165
193
  - lib/opentelemetry/instrumentation.rb
166
194
  - lib/opentelemetry/instrumentation/ruby_kafka.rb
167
- - lib/opentelemetry/instrumentation/ruby_kafka/events.rb
168
195
  - lib/opentelemetry/instrumentation/ruby_kafka/instrumentation.rb
169
196
  - lib/opentelemetry/instrumentation/ruby_kafka/patches/client.rb
170
197
  - lib/opentelemetry/instrumentation/ruby_kafka/patches/consumer.rb
@@ -174,10 +201,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
174
201
  licenses:
175
202
  - Apache-2.0
176
203
  metadata:
177
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-ruby_kafka/v0.12.0/file.CHANGELOG.html
178
- source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/master/instrumentation/ruby_kafka
204
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-ruby_kafka/v0.17.0/file.CHANGELOG.html
205
+ source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/instrumentation/ruby_kafka
179
206
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
180
- documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-ruby_kafka/v0.12.0
207
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-ruby_kafka/v0.17.0
181
208
  post_install_message:
182
209
  rdoc_options: []
183
210
  require_paths:
@@ -193,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
193
220
  - !ruby/object:Gem::Version
194
221
  version: '0'
195
222
  requirements: []
196
- rubygems_version: 3.1.4
223
+ rubygems_version: 3.1.6
197
224
  signing_key:
198
225
  specification_version: 4
199
226
  summary: RubyKafka instrumentation for the OpenTelemetry framework
@@ -1,31 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Copyright The OpenTelemetry Authors
4
- #
5
- # SPDX-License-Identifier: Apache-2.0
6
-
7
- require_relative 'events/connection/request'
8
- require_relative 'events/consumer_group/heartbeat'
9
- require_relative 'events/consumer_group/join_group'
10
- require_relative 'events/consumer_group/leave_group'
11
- require_relative 'events/consumer_group/sync_group'
12
- require_relative 'events/produce_operation/send_messages'
13
- require_relative 'events/producer/deliver_messages'
14
-
15
- module OpenTelemetry
16
- module Instrumentation
17
- module RubyKafka
18
- module Events
19
- ALL = [
20
- Events::Connection::Request,
21
- Events::ConsumerGroup::Heartbeat,
22
- Events::ConsumerGroup::JoinGroup,
23
- Events::ConsumerGroup::LeaveGroup,
24
- Events::ConsumerGroup::SyncGroup,
25
- Events::ProduceOperation::SendMessages,
26
- Events::Producer::DeliverMessages
27
- ].freeze
28
- end
29
- end
30
- end
31
- end