opentelemetry-instrumentation-concurrent_ruby 0.18.0 → 0.19.1
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: 67bae6475c04226b0b95b38d1256adffa5dda7d6bb8ab530f3491c58ed954949
|
4
|
+
data.tar.gz: 8e93ba391df8108ed923dbcd179b6e4189f70639035d40b32da753a39a2557b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f845d9b0a25fb2c3c2e4615444f53733e98e0caacc1943929a7a07235cb059ee99f442d4742c107362c36c69dcd023d8ea6060418764b0feb9fc3827c5a5aef
|
7
|
+
data.tar.gz: 6ed57e6c9f49fbe8060cffd3951064e1dda13bcd8f0f4832574658b9eb430c5043a63b4033f8d809832aeced97d5f855080a475c913a23c09c3b29d86d831d6d
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,21 @@
|
|
1
1
|
# Release History: opentelemetry-instrumentation-concurrent_ruby
|
2
2
|
|
3
|
+
### v0.19.1 / 2021-09-29
|
4
|
+
|
5
|
+
* (No significant changes)
|
6
|
+
|
7
|
+
### v0.19.0 / 2021-09-29
|
8
|
+
|
9
|
+
* ADDED: Add suport for `Concurrent::Promises::Future`
|
10
|
+
|
11
|
+
### v0.18.2 / 2021-08-12
|
12
|
+
|
13
|
+
* DOCS: Update docs to rely more on environment variable configuration
|
14
|
+
|
15
|
+
### v0.18.1 / 2021-06-23
|
16
|
+
|
17
|
+
* (No significant changes)
|
18
|
+
|
3
19
|
### v0.18.0 / 2021-05-21
|
4
20
|
|
5
21
|
* ADDED: Updated API depedency for 1.0.0.rc1
|
@@ -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.1
|
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-30 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.18.
|
33
|
+
version: 0.18.3
|
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.18.
|
40
|
+
version: 0.18.3
|
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.1/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.1
|
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
|