opentelemetry-instrumentation-concurrent_ruby 0.18.1 → 0.19.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -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 +11 -12
- 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: b6d1107172979bd758eedb9d0cca52b729f78164fad5d7f39350d4f515ca7917
|
4
|
+
data.tar.gz: 568349b3ca6f37644f4c3474ac32d81e46eb9566f8470322141b28e5aca7743e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52c968cfd5784c750e3b94c8130d044087e8d6c3a01e28063844aa7556eaded22dfc8c205fd77848d80c008acdadc6b1227b0642f7eea6d3fe8035c1c772377c
|
7
|
+
data.tar.gz: 9b0d624103f8f837022e3f0bf34a39c29797fb8bd97a0a648c270229186da737b3e6d9a4aee34497cbdb9fa3a7749866942135a1b216bdcd7770e7bdf2b7707b
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,21 @@
|
|
1
1
|
# Release History: opentelemetry-instrumentation-concurrent_ruby
|
2
2
|
|
3
|
+
### v0.19.2 / 2021-12-02
|
4
|
+
|
5
|
+
* (No significant changes)
|
6
|
+
|
7
|
+
### v0.19.1 / 2021-09-29
|
8
|
+
|
9
|
+
* (No significant changes)
|
10
|
+
|
11
|
+
### v0.19.0 / 2021-09-29
|
12
|
+
|
13
|
+
* ADDED: Add suport for `Concurrent::Promises::Future`
|
14
|
+
|
15
|
+
### v0.18.2 / 2021-08-12
|
16
|
+
|
17
|
+
* DOCS: Update docs to rely more on environment variable configuration
|
18
|
+
|
3
19
|
### v0.18.1 / 2021-06-23
|
4
20
|
|
5
21
|
* (No significant changes)
|
@@ -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.2
|
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-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opentelemetry-api
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.0
|
19
|
+
version: '1.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: 1.0
|
26
|
+
version: '1.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: opentelemetry-instrumentation-base
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.19.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.19.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: appraisal
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 1.0
|
103
|
+
version: '1.0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 1.0
|
110
|
+
version: '1.0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: rubocop
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -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.2/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.2
|
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
|