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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/opentelemetry/instrumentation/concurrent_ruby/instrumentation.rb +3 -3
- data/lib/opentelemetry/instrumentation/concurrent_ruby/patches/thread_pool_executor.rb +28 -0
- data/lib/opentelemetry/instrumentation/concurrent_ruby/version.rb +1 -1
- metadata +5 -6
- data/lib/opentelemetry/instrumentation/concurrent_ruby/context_composite_executor_service.rb +0 -40
- data/lib/opentelemetry/instrumentation/concurrent_ruby/patches/future.rb +0 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38fc0370ca9ba419dcd660453f0e9d212ae72a57e60d426bbad999c12af9d340
|
4
|
+
data.tar.gz: 40bef73ed660e8ea412b16ed20ab87ae35f712d572994e9b20f7a68837fabdf9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d560698ab93692a06cfffbd0b666c8515c63353e5f89ec4fce35672e2918158ae1af49c89e8b84c4d85632fb85541c392b0b7f517a57d50a3e40479c0d0e5f7
|
7
|
+
data.tar.gz: 6e5227b916ea828642a25f152cece35492e71fd70c677dac7b51f5ca04adbcafc8b7ec698088029871388f876770a8cf4b70245f279851121a09e915422a0df5
|
data/CHANGELOG.md
CHANGED
@@ -16,17 +16,17 @@ module OpenTelemetry
|
|
16
16
|
end
|
17
17
|
|
18
18
|
present do
|
19
|
-
defined?(::Concurrent::
|
19
|
+
defined?(::Concurrent::ThreadPoolExecutor)
|
20
20
|
end
|
21
21
|
|
22
22
|
private
|
23
23
|
|
24
24
|
def require_dependencies
|
25
|
-
require_relative 'patches/
|
25
|
+
require_relative 'patches/thread_pool_executor'
|
26
26
|
end
|
27
27
|
|
28
28
|
def patch
|
29
|
-
::Concurrent::
|
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
|
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.
|
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-
|
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/
|
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.
|
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.
|
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:
|
data/lib/opentelemetry/instrumentation/concurrent_ruby/context_composite_executor_service.rb
DELETED
@@ -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
|