opentelemetry-instrumentation-ruby_kafka 0.12.0 → 0.13.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: 133f65fac0ceb65bcee0a8999e31f5421b1d5bff31074700024207fdddd04db2
4
+ data.tar.gz: 2fed53fb52f1daa811262fd1b50e515b2edd4752ec54ff273ff52a4421a4edd9
5
5
  SHA512:
6
- metadata.gz: 93d4f1c8552777108e38640241b0904733e2e7f50afe99d6fab1621567b91119462cb44c667a90034efe013930bfd9dfd3a69f88f2592ff405a13b7a99c63b82
7
- data.tar.gz: 829d7321a191a7604a9c5b059bf11abec0748bbd5565c920c065d2b49e8dad32cdd26a8211e3d5481ba6c76235ede2fb781f0c21d5aaf798d6c1af34180c58a4
6
+ metadata.gz: 5056b08fd6bba75591875d2282faef9b7a05804edeb98654b5d576b1ceaaa5db20841abbd3531df1f1d209b240d3cd56f7309e85957cee88f068f6efd959da77
7
+ data.tar.gz: 6a4560d370ca069a1d08b8ba61c40469c50d8a32c7958aa47ccbe0893966ab07e2d3f410c210a834719d85ea327ce2060ccada199352b13188c10c9d6cd7d355
@@ -1,5 +1,11 @@
1
1
  # Release History: opentelemetry-instrumentation-ruby_kafka
2
2
 
3
+ ### v0.13.0 / 2021-01-29
4
+
5
+ * FIXED: Add minimum gem version for ruby-kafka
6
+ * FIXED: Ruby_kafka baggage propagation
7
+ * FIXED: Remove unused ruby-kafka events file
8
+
3
9
  ### v0.12.0 / 2020-12-24
4
10
 
5
11
  * Initial release.
data/README.md CHANGED
@@ -32,7 +32,7 @@ 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
 
@@ -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
53
  [ruby-gitter]: https://gitter.im/open-telemetry/opentelemetry-ruby
@@ -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'
@@ -38,8 +38,10 @@ module OpenTelemetry
38
38
  attributes['messaging.kafka.message_key'] = message.key if message.key
39
39
 
40
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
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.text.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
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module RubyKafka
10
- VERSION = '0.12.0'
10
+ VERSION = '0.13.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.13.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-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.12.0
19
+ version: 0.13.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.13.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: appraisal
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec-mocks
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: rubocop
85
99
  requirement: !ruby/object:Gem::Requirement
@@ -164,7 +178,6 @@ files:
164
178
  - lib/opentelemetry-instrumentation-ruby_kafka.rb
165
179
  - lib/opentelemetry/instrumentation.rb
166
180
  - lib/opentelemetry/instrumentation/ruby_kafka.rb
167
- - lib/opentelemetry/instrumentation/ruby_kafka/events.rb
168
181
  - lib/opentelemetry/instrumentation/ruby_kafka/instrumentation.rb
169
182
  - lib/opentelemetry/instrumentation/ruby_kafka/patches/client.rb
170
183
  - lib/opentelemetry/instrumentation/ruby_kafka/patches/consumer.rb
@@ -174,10 +187,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
174
187
  licenses:
175
188
  - Apache-2.0
176
189
  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
190
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-ruby_kafka/v0.13.0/file.CHANGELOG.html
191
+ source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/instrumentation/ruby_kafka
179
192
  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
193
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-ruby_kafka/v0.13.0
181
194
  post_install_message:
182
195
  rdoc_options: []
183
196
  require_paths:
@@ -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