opentelemetry-instrumentation-concurrent_ruby 0.18.2 → 0.19.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: 2014ca4a849d67e0ff012d203ed95defb6ec847d7035e163a5024a56229b29b0
4
- data.tar.gz: 35a0031a8e04314305a4c05893e60375db2bf1f219da97b4c25d14f021ea3668
3
+ metadata.gz: 38fc0370ca9ba419dcd660453f0e9d212ae72a57e60d426bbad999c12af9d340
4
+ data.tar.gz: 40bef73ed660e8ea412b16ed20ab87ae35f712d572994e9b20f7a68837fabdf9
5
5
  SHA512:
6
- metadata.gz: 01d6b4c059890cf3d2a8b375a22d1f5bede5ca4e4410674fce14b45a666c52b9cc786c4f3211fcaddad4acbcfa4518cec90b9c2d1517670dbfd81501179b4e28
7
- data.tar.gz: '0186e1576d45b2f8523800c6d5a48a6171cff504deb16fcb39549b514e4d8b648a6f6f29d6b10193fbcb0febd67ab13687725a8a4aa462c1237fe1bd2dc42401'
6
+ metadata.gz: 8d560698ab93692a06cfffbd0b666c8515c63353e5f89ec4fce35672e2918158ae1af49c89e8b84c4d85632fb85541c392b0b7f517a57d50a3e40479c0d0e5f7
7
+ data.tar.gz: 6e5227b916ea828642a25f152cece35492e71fd70c677dac7b51f5ca04adbcafc8b7ec698088029871388f876770a8cf4b70245f279851121a09e915422a0df5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Release History: opentelemetry-instrumentation-concurrent_ruby
2
2
 
3
+ ### v0.19.0 / 2021-09-29
4
+
5
+ * ADDED: Add suport for `Concurrent::Promises::Future`
6
+
3
7
  ### v0.18.2 / 2021-08-12
4
8
 
5
9
  * DOCS: Update docs to rely more on environment variable configuration
@@ -16,17 +16,17 @@ module OpenTelemetry
16
16
  end
17
17
 
18
18
  present do
19
- defined?(::Concurrent::Future)
19
+ defined?(::Concurrent::ThreadPoolExecutor)
20
20
  end
21
21
 
22
22
  private
23
23
 
24
24
  def require_dependencies
25
- require_relative 'patches/future'
25
+ require_relative 'patches/thread_pool_executor'
26
26
  end
27
27
 
28
28
  def patch
29
- ::Concurrent::Future.send(:include, Patches::Future)
29
+ ::Concurrent::ThreadPoolExecutor.prepend Patches::ThreadPoolExecutor
30
30
  end
31
31
  end
32
32
  end
@@ -0,0 +1,28 @@
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 ConcurrentRuby
10
+ module Patches
11
+ # Concurrent::ThreadPoolExecutor patch for instrumentation
12
+ module ThreadPoolExecutor
13
+ # @see Concurrent::ExecutorService#post
14
+ def post(*args, **kwargs, &task)
15
+ context = OpenTelemetry::Context.current
16
+ return super unless context
17
+
18
+ super(*args, **kwargs) do
19
+ OpenTelemetry::Context.with_current(context) do
20
+ task.call(*args, **kwargs)
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Instrumentation
9
9
  module ConcurrentRuby
10
- VERSION = '0.18.2'
10
+ VERSION = '0.19.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-concurrent_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.2
4
+ version: 0.19.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: 2021-08-16 00:00:00.000000000 Z
11
+ date: 2021-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -178,18 +178,17 @@ files:
178
178
  - lib/opentelemetry-instrumentation-concurrent_ruby.rb
179
179
  - lib/opentelemetry/instrumentation.rb
180
180
  - lib/opentelemetry/instrumentation/concurrent_ruby.rb
181
- - lib/opentelemetry/instrumentation/concurrent_ruby/context_composite_executor_service.rb
182
181
  - lib/opentelemetry/instrumentation/concurrent_ruby/instrumentation.rb
183
- - lib/opentelemetry/instrumentation/concurrent_ruby/patches/future.rb
182
+ - lib/opentelemetry/instrumentation/concurrent_ruby/patches/thread_pool_executor.rb
184
183
  - lib/opentelemetry/instrumentation/concurrent_ruby/version.rb
185
184
  homepage: https://github.com/open-telemetry/opentelemetry-ruby
186
185
  licenses:
187
186
  - Apache-2.0
188
187
  metadata:
189
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-concurrent_ruby/v0.18.2/file.CHANGELOG.html
188
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-concurrent_ruby/v0.19.0/file.CHANGELOG.html
190
189
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/instrumentation/concurrent_ruby
191
190
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
192
- documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-concurrent_ruby/v0.18.2
191
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-instrumentation-concurrent_ruby/v0.19.0
193
192
  post_install_message:
194
193
  rdoc_options: []
195
194
  require_paths:
@@ -1,40 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Copyright The OpenTelemetry Authors
4
- #
5
- # SPDX-License-Identifier: Apache-2.0
6
-
7
- require 'concurrent/executor/executor_service'
8
- require 'forwardable'
9
-
10
- module OpenTelemetry
11
- module Instrumentation
12
- module ConcurrentRuby
13
- # Wraps existing executor to carry over trace context
14
- class ContextCompositeExecutorService
15
- extend Forwardable
16
- include Concurrent::ExecutorService
17
-
18
- attr_accessor :composited_executor
19
-
20
- def initialize(composited_executor)
21
- @composited_executor = composited_executor
22
- end
23
-
24
- # post method runs the task within composited executor
25
- # in a different thread
26
- def post(*args, &task)
27
- context = OpenTelemetry::Context.current
28
-
29
- @composited_executor.post(*args) do
30
- OpenTelemetry::Context.with_current(context) do
31
- yield
32
- end
33
- end
34
- end
35
-
36
- delegate %i[can_overflow? serialized?] => :composited_executor
37
- end
38
- end
39
- end
40
- end
@@ -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 '../context_composite_executor_service'
8
-
9
- module OpenTelemetry
10
- module Instrumentation
11
- module ConcurrentRuby
12
- module Patches
13
- # Concurrent::Future patch for instrumentation
14
- module Future
15
- def self.included(base)
16
- base.class_eval do
17
- alias_method :ns_initialize_without_otel, :ns_initialize
18
- remove_method(:ns_initialize)
19
-
20
- def ns_initialize(value, opts)
21
- ns_initialize_without_otel(value, opts)
22
-
23
- @executor = ContextCompositeExecutorService.new(@executor)
24
- end
25
- end
26
- end
27
- end
28
- end
29
- end
30
- end
31
- end