opentracing-instrumentation 0.1.18 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.drone.jsonnet +3 -3
- data/.gitlab-ci.yml +9 -9
- data/.rubocop.yml +6 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +4 -0
- data/GEM_VERSION +1 -1
- data/Gemfile +7 -7
- data/Gemfile.lock +28 -23
- data/lib/opentracing/instrumentation/bunny.rb +11 -11
- data/lib/opentracing/instrumentation/bunny/regexp_routing_key_sanitazer.rb +1 -1
- data/lib/opentracing/instrumentation/common/error_writer.rb +2 -2
- data/lib/opentracing/instrumentation/faraday/response_logger.rb +4 -4
- data/lib/opentracing/instrumentation/faraday/trace_middleware.rb +1 -1
- data/lib/opentracing/instrumentation/hutch.rb +6 -6
- data/lib/opentracing/instrumentation/mongo/query_sanitazer.rb +4 -3
- data/lib/opentracing/instrumentation/mongo/trace_subscriber.rb +5 -5
- data/lib/opentracing/instrumentation/rack/http_tagger.rb +3 -3
- data/lib/opentracing/instrumentation/rack/trace_middleware.rb +5 -5
- data/lib/opentracing/instrumentation/redis/config.rb +5 -5
- data/lib/opentracing/instrumentation/redis/tracing_driver_wrapper.rb +4 -4
- data/lib/opentracing/instrumentation/sidekiq/client_middleware.rb +8 -10
- data/lib/opentracing/instrumentation/sidekiq/job_tagger.rb +2 -2
- data/lib/opentracing/instrumentation/sidekiq/server_middleware.rb +8 -10
- data/lib/opentracing/instrumentation/thrift.rb +9 -9
- data/lib/opentracing/instrumentation/thrift/traced_processor.rb +2 -2
- data/lib/opentracing/instrumentation/thrift/traced_processor_tags_builder.rb +1 -0
- data/lib/opentracing/instrumentation/thrift/traced_protocol.rb +3 -3
- data/lib/opentracing/instrumentation/thrift/traced_protocol_factory.rb +1 -0
- data/lib/opentracing/instrumentation/thrift/traced_protocol_tags_builder.rb +1 -1
- data/opentracing-instrumentation.gemspec +6 -4
- metadata +17 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8879aaa3c59021d2ca28453df552f98e0d15b6770c12cf16aea578438e332013
|
4
|
+
data.tar.gz: '087834496d2097fe029aa460470651447f9d2bba325e95b3fd3a8cc873d137d4'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5c204ba373e323a0ac3ba96d1ba81a4be53ef537890304a30cb7f701ffc5ce0a989f5ac7eeb2b5c1850908d606d090dc61bff08f3ee49090a6d656b3071597d
|
7
|
+
data.tar.gz: fa54f0a639bf05536ba3d0fd0771c75497ba619dde142c8e1d5575fd5a782f0eb7ff0e33cc5148cd4338d6a526dc9893ade3d13c95e0f45455a00f93c0786862
|
data/.drone.jsonnet
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
local TestPipeline(os, arch, ruby_version) = {
|
2
2
|
kind: "pipeline",
|
3
|
-
type: "
|
3
|
+
type: "kubernetes",
|
4
4
|
name: os + "_" + arch + "_ruby_" + ruby_version,
|
5
5
|
|
6
6
|
platform: {
|
@@ -14,7 +14,7 @@ local TestPipeline(os, arch, ruby_version) = {
|
|
14
14
|
image: "ruby:" + ruby_version + "-alpine",
|
15
15
|
commands: [
|
16
16
|
"apk add --update git ruby-dev build-base",
|
17
|
-
"gem install bundler
|
17
|
+
"gem install bundler:$$(cat .BUNDLER_VERSION)",
|
18
18
|
"bundle",
|
19
19
|
"rake",
|
20
20
|
]
|
@@ -23,10 +23,10 @@ local TestPipeline(os, arch, ruby_version) = {
|
|
23
23
|
};
|
24
24
|
|
25
25
|
local TARGETS = [
|
26
|
-
{os: "linux", arch: "arm64", ruby_version: "2.4"},
|
27
26
|
{os: "linux", arch: "arm", ruby_version: "2.5"},
|
28
27
|
{os: "linux", arch: "arm", ruby_version: "2.6"},
|
29
28
|
{os: "linux", arch: "arm64", ruby_version: "2.7"},
|
29
|
+
{os: "linux", arch: "arm64", ruby_version: "3.0"},
|
30
30
|
];
|
31
31
|
|
32
32
|
[
|
data/.gitlab-ci.yml
CHANGED
@@ -23,15 +23,6 @@ stages:
|
|
23
23
|
script:
|
24
24
|
- bundle exec rake
|
25
25
|
|
26
|
-
test/2.4:
|
27
|
-
<<: *test_shared
|
28
|
-
stage: test
|
29
|
-
image: ruby:2.4-alpine
|
30
|
-
|
31
|
-
cache:
|
32
|
-
paths:
|
33
|
-
- vendor/ruby/2.4.0
|
34
|
-
|
35
26
|
test/2.5:
|
36
27
|
<<: *test_shared
|
37
28
|
stage: test
|
@@ -59,6 +50,15 @@ test/2.7:
|
|
59
50
|
paths:
|
60
51
|
- vendor/ruby/2.7.0
|
61
52
|
|
53
|
+
test/3.0:
|
54
|
+
<<: *test_shared
|
55
|
+
stage: test
|
56
|
+
image: ruby:3.0-alpine
|
57
|
+
|
58
|
+
cache:
|
59
|
+
paths:
|
60
|
+
- vendor/ruby/3.0.0
|
61
|
+
|
62
62
|
publish:
|
63
63
|
stage: publish
|
64
64
|
image: ruby:2.7-alpine
|
data/.rubocop.yml
CHANGED
@@ -3,9 +3,15 @@ require:
|
|
3
3
|
- rubocop-performance
|
4
4
|
- rubocop-thread_safety
|
5
5
|
|
6
|
+
AllCops:
|
7
|
+
NewCops: enable
|
8
|
+
|
6
9
|
Layout/LineLength:
|
7
10
|
Max: 100
|
8
11
|
|
12
|
+
RSpec/MultipleMemoizedHelpers:
|
13
|
+
Max: 18
|
14
|
+
|
9
15
|
Style/TrailingCommaInHashLiteral:
|
10
16
|
EnforcedStyleForMultiline: comma
|
11
17
|
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.5.0
|
data/CHANGELOG.md
ADDED
data/GEM_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/Gemfile
CHANGED
@@ -7,13 +7,13 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
|
7
7
|
# Specify your gem's dependencies in opentracing-instrumentation.gemspec
|
8
8
|
gemspec
|
9
9
|
|
10
|
-
gem 'test-tracer',
|
11
|
-
github: 'michal-granec/ruby-test-tracer',
|
12
|
-
branch: 'update_opentracing_dependencies'
|
13
|
-
gem 'tracing-matchers',
|
14
|
-
github: 'c0va23/ruby-tracing-matchers',
|
15
|
-
branch: 'feature/michal-granec/ruby-test-tracer-compatibility'
|
16
|
-
|
17
10
|
group :development do
|
11
|
+
gem 'test-tracer',
|
12
|
+
github: 'michal-granec/ruby-test-tracer',
|
13
|
+
branch: 'update_opentracing_dependencies'
|
14
|
+
gem 'tracing-matchers',
|
15
|
+
github: 'c0va23/ruby-tracing-matchers',
|
16
|
+
branch: 'feature/michal-granec/ruby-test-tracer-compatibility'
|
17
|
+
|
18
18
|
gem 'pry-byebug', '~> 3.8'
|
19
19
|
end
|
data/Gemfile.lock
CHANGED
@@ -31,7 +31,7 @@ GEM
|
|
31
31
|
minitest (~> 5.1)
|
32
32
|
tzinfo (~> 1.1)
|
33
33
|
amq-protocol (2.3.0)
|
34
|
-
ast (2.4.
|
34
|
+
ast (2.4.2)
|
35
35
|
bson (4.8.0)
|
36
36
|
bunny (2.14.4)
|
37
37
|
amq-protocol (~> 2.3, >= 2.3.0)
|
@@ -50,16 +50,15 @@ GEM
|
|
50
50
|
multi_json (~> 1.12)
|
51
51
|
i18n (1.8.2)
|
52
52
|
concurrent-ruby (~> 1.0)
|
53
|
-
jaro_winkler (1.5.4)
|
54
53
|
json (2.3.0)
|
55
54
|
method_source (0.9.2)
|
56
|
-
minitest (5.14.
|
55
|
+
minitest (5.14.4)
|
57
56
|
multi_json (1.14.1)
|
58
57
|
multipart-post (2.1.1)
|
59
58
|
opentracing (0.5.0)
|
60
|
-
parallel (1.
|
61
|
-
parser (
|
62
|
-
ast (~> 2.4.
|
59
|
+
parallel (1.20.1)
|
60
|
+
parser (3.0.1.1)
|
61
|
+
ast (~> 2.4.1)
|
63
62
|
pry (0.12.2)
|
64
63
|
coderay (~> 1.1.0)
|
65
64
|
method_source (~> 0.9.0)
|
@@ -70,7 +69,8 @@ GEM
|
|
70
69
|
rainbow (3.0.0)
|
71
70
|
rake (13.0.1)
|
72
71
|
redis (3.3.5)
|
73
|
-
|
72
|
+
regexp_parser (2.1.1)
|
73
|
+
rexml (3.2.5)
|
74
74
|
rspec (3.9.0)
|
75
75
|
rspec-core (~> 3.9.0)
|
76
76
|
rspec-expectations (~> 3.9.0)
|
@@ -84,26 +84,31 @@ GEM
|
|
84
84
|
diff-lcs (>= 1.2.0, < 2.0)
|
85
85
|
rspec-support (~> 3.9.0)
|
86
86
|
rspec-support (3.9.2)
|
87
|
-
rubocop (
|
88
|
-
jaro_winkler (~> 1.5.1)
|
87
|
+
rubocop (1.15.0)
|
89
88
|
parallel (~> 1.10)
|
90
|
-
parser (>=
|
89
|
+
parser (>= 3.0.0.0)
|
91
90
|
rainbow (>= 2.2.2, < 4.0)
|
91
|
+
regexp_parser (>= 1.8, < 3.0)
|
92
92
|
rexml
|
93
|
+
rubocop-ast (>= 1.5.0, < 2.0)
|
93
94
|
ruby-progressbar (~> 1.7)
|
94
|
-
unicode-display_width (>= 1.4.0, <
|
95
|
-
rubocop-
|
96
|
-
|
97
|
-
rubocop-
|
98
|
-
rubocop (>= 0.
|
99
|
-
|
100
|
-
|
101
|
-
|
95
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
96
|
+
rubocop-ast (1.5.0)
|
97
|
+
parser (>= 3.0.1.1)
|
98
|
+
rubocop-performance (1.11.3)
|
99
|
+
rubocop (>= 1.7.0, < 2.0)
|
100
|
+
rubocop-ast (>= 0.4.0)
|
101
|
+
rubocop-rspec (2.3.0)
|
102
|
+
rubocop (~> 1.0)
|
103
|
+
rubocop-ast (>= 1.1.0)
|
104
|
+
rubocop-thread_safety (0.4.2)
|
105
|
+
rubocop (>= 0.53.0)
|
106
|
+
ruby-progressbar (1.11.0)
|
102
107
|
thread_safe (0.3.6)
|
103
108
|
thrift (0.11.0.0)
|
104
109
|
tzinfo (1.2.6)
|
105
110
|
thread_safe (~> 0.1)
|
106
|
-
unicode-display_width (
|
111
|
+
unicode-display_width (2.0.0)
|
107
112
|
|
108
113
|
PLATFORMS
|
109
114
|
ruby
|
@@ -121,10 +126,10 @@ DEPENDENCIES
|
|
121
126
|
rake (~> 13.0)
|
122
127
|
redis (~> 3.3.5)
|
123
128
|
rspec (~> 3.0)
|
124
|
-
rubocop (~>
|
125
|
-
rubocop-performance (~> 1.
|
126
|
-
rubocop-rspec (~>
|
127
|
-
rubocop-thread_safety (~> 0.
|
129
|
+
rubocop (~> 1.15.0)
|
130
|
+
rubocop-performance (~> 1.11.3)
|
131
|
+
rubocop-rspec (~> 2.3.0)
|
132
|
+
rubocop-thread_safety (~> 0.4.2)
|
128
133
|
test-tracer!
|
129
134
|
thrift (~> 0.11.0)
|
130
135
|
tracing-matchers!
|
@@ -10,27 +10,27 @@ module OpenTracing
|
|
10
10
|
module_path = 'opentracing/instrumentation/bunny'
|
11
11
|
|
12
12
|
autoload :ConsumeOperationNameBuilder,
|
13
|
-
module_path
|
13
|
+
"#{module_path}/consume_operation_name_builder"
|
14
14
|
autoload :ConsumeTagsBuilder,
|
15
|
-
module_path
|
15
|
+
"#{module_path}/consume_tags_builder"
|
16
16
|
autoload :ConsumeTracer,
|
17
|
-
module_path
|
17
|
+
"#{module_path}/consume_tracer"
|
18
18
|
autoload :ConsumeTracerConfig,
|
19
|
-
module_path
|
19
|
+
"#{module_path}/consume_tracer_config"
|
20
20
|
autoload :HeadersBuilder,
|
21
|
-
module_path
|
21
|
+
"#{module_path}/headers_builder"
|
22
22
|
autoload :HeadersInjector,
|
23
|
-
module_path
|
23
|
+
"#{module_path}/headers_injector"
|
24
24
|
autoload :PublishOperationNameBuilder,
|
25
|
-
module_path
|
25
|
+
"#{module_path}/publish_operation_name_builder"
|
26
26
|
autoload :PublishTagsBuilder,
|
27
|
-
module_path
|
27
|
+
"#{module_path}/publish_tags_builder"
|
28
28
|
autoload :PublishTracer,
|
29
|
-
module_path
|
29
|
+
"#{module_path}/publish_tracer"
|
30
30
|
autoload :PublishTracerConfig,
|
31
|
-
module_path
|
31
|
+
"#{module_path}/publish_tracer_config"
|
32
32
|
autoload :RegexpRoutingKeySanitazer,
|
33
|
-
module_path
|
33
|
+
"#{module_path}/regexp_routing_key_sanitazer"
|
34
34
|
end
|
35
35
|
end
|
36
36
|
end
|
@@ -10,8 +10,8 @@ module OpenTracing
|
|
10
10
|
LOG_ERROR_EVENT = 'error'
|
11
11
|
ERROR_TAG = 'error'
|
12
12
|
|
13
|
-
attr_reader :set_error_tag
|
14
|
-
|
13
|
+
attr_reader :set_error_tag,
|
14
|
+
:log_error_event
|
15
15
|
|
16
16
|
# @param set_error_tag [TrueClass,ErrorClass] enable set error tag
|
17
17
|
# @param log_error_event [TrueClass, ErrorClass] enable log exception
|
@@ -20,10 +20,10 @@ module OpenTracing
|
|
20
20
|
content_type: 'Content-Type',
|
21
21
|
}.freeze
|
22
22
|
|
23
|
-
attr_reader :request_tag_headers
|
24
|
-
|
25
|
-
|
26
|
-
|
23
|
+
attr_reader :request_tag_headers,
|
24
|
+
:request_log_headers,
|
25
|
+
:response_tag_headers,
|
26
|
+
:response_log_headers
|
27
27
|
|
28
28
|
def initialize(
|
29
29
|
request_log_headers: DEFAULT_REQUEST_LOG_HEADERS,
|
@@ -12,17 +12,17 @@ module OpenTracing
|
|
12
12
|
module_path = 'opentracing/instrumentation/hutch'
|
13
13
|
|
14
14
|
autoload :ConsumeOperationNameBuilder,
|
15
|
-
module_path
|
15
|
+
"#{module_path}/consume_operation_name_builder"
|
16
16
|
autoload :ConsumeTagsBuilder,
|
17
|
-
module_path
|
17
|
+
"#{module_path}/consume_tags_builder"
|
18
18
|
autoload :ConsumeTracer,
|
19
|
-
module_path
|
19
|
+
"#{module_path}/consume_tracer"
|
20
20
|
autoload :ConsumeTracerBuilder,
|
21
|
-
module_path
|
21
|
+
"#{module_path}/consume_tracer_builder"
|
22
22
|
autoload :ConsumeTracerConfig,
|
23
|
-
module_path
|
23
|
+
"#{module_path}/consume_tracer_config"
|
24
24
|
autoload :GlobalPropertiesBuilder,
|
25
|
-
module_path
|
25
|
+
"#{module_path}/global_properties_builder"
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -23,6 +23,7 @@ module OpenTracing
|
|
23
23
|
safe_classes: DEFAULT_SAFE_CLASSES,
|
24
24
|
exclude_keys: DEFAULT_EXCLUDE_KEYS
|
25
25
|
)
|
26
|
+
super()
|
26
27
|
@safety_argument_checker = safety_argument_checker
|
27
28
|
@safe_classes = safe_classes
|
28
29
|
@exclude_keys = exclude_keys
|
@@ -38,9 +39,9 @@ module OpenTracing
|
|
38
39
|
|
39
40
|
private
|
40
41
|
|
41
|
-
attr_reader :safe_classes
|
42
|
-
|
43
|
-
|
42
|
+
attr_reader :safe_classes,
|
43
|
+
:exclude_keys,
|
44
|
+
:safety_argument_checker
|
44
45
|
|
45
46
|
OBJECT_ID_PLACEHOLDER = '$oid'
|
46
47
|
STRING_PLACEHOLDER = '$string'
|
@@ -43,11 +43,11 @@ module OpenTracing
|
|
43
43
|
|
44
44
|
private
|
45
45
|
|
46
|
-
attr_reader :tracer
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
46
|
+
attr_reader :tracer,
|
47
|
+
:scope_store,
|
48
|
+
:monitor,
|
49
|
+
:operation_name_builder,
|
50
|
+
:sanitazer
|
51
51
|
|
52
52
|
def build_operation_name(event)
|
53
53
|
operation_name_builder.build_operation_name(event)
|
@@ -50,15 +50,15 @@ module OpenTracing
|
|
50
50
|
|
51
51
|
def prepare_request_mapping(source_mapping)
|
52
52
|
source_mapping.map do |key, header|
|
53
|
-
rack_header =
|
54
|
-
tag_name =
|
53
|
+
rack_header = "HTTP_#{header.tr('-', '_').upcase}"
|
54
|
+
tag_name = "http.request.#{key}"
|
55
55
|
[tag_name, rack_header]
|
56
56
|
end.to_h
|
57
57
|
end
|
58
58
|
|
59
59
|
def prepare_response_mapping(source_mapping)
|
60
60
|
source_mapping.map do |key, header|
|
61
|
-
tag_name =
|
61
|
+
tag_name = "http.response.#{key}"
|
62
62
|
header_regexp = /^#{header}$/i
|
63
63
|
[tag_name, header_regexp]
|
64
64
|
end.to_h
|
@@ -36,10 +36,10 @@ module OpenTracing
|
|
36
36
|
|
37
37
|
private
|
38
38
|
|
39
|
-
attr_reader :app
|
40
|
-
|
41
|
-
|
42
|
-
|
39
|
+
attr_reader :app,
|
40
|
+
:http_tagger,
|
41
|
+
:tracer,
|
42
|
+
:logger
|
43
43
|
|
44
44
|
def trace_request(env)
|
45
45
|
extracted_ctx = tracer.extract(OpenTracing::FORMAT_RACK, env)
|
@@ -84,7 +84,7 @@ module OpenTracing
|
|
84
84
|
def set_header_tags(span, headers)
|
85
85
|
http_tagger
|
86
86
|
.response_tags(headers)
|
87
|
-
.each(
|
87
|
+
.each { |(key, value)| span.set_tag(key, value) }
|
88
88
|
end
|
89
89
|
|
90
90
|
def error_tag(span, error)
|
@@ -14,11 +14,11 @@ module OpenTracing
|
|
14
14
|
DEFAULT_LOG_REPLY = false
|
15
15
|
DEFAULT_COMPONENT = 'kv'
|
16
16
|
|
17
|
-
attr_accessor :tracer
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
attr_accessor :tracer,
|
18
|
+
:operation_name_pattern,
|
19
|
+
:log_args,
|
20
|
+
:log_reply,
|
21
|
+
:component
|
22
22
|
|
23
23
|
def initialize(
|
24
24
|
tracer: OpenTracing.global_tracer,
|
@@ -35,8 +35,8 @@ module OpenTracing
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
-
attr_reader :connection
|
39
|
-
|
38
|
+
attr_reader :connection,
|
39
|
+
:span_builder
|
40
40
|
|
41
41
|
def initialize(
|
42
42
|
connection:,
|
@@ -80,8 +80,8 @@ module OpenTracing
|
|
80
80
|
|
81
81
|
private
|
82
82
|
|
83
|
-
attr_reader :pipeline_scope
|
84
|
-
|
83
|
+
attr_reader :pipeline_scope,
|
84
|
+
:error_writer
|
85
85
|
|
86
86
|
def peer_addr
|
87
87
|
"#{@host}:#{@port}"
|
@@ -16,12 +16,12 @@ module OpenTracing
|
|
16
16
|
operation_name_template: DEFAULT_OPERATION_NAME_TEMPLATE,
|
17
17
|
)
|
18
18
|
|
19
|
-
attr_reader :tracer
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
19
|
+
attr_reader :tracer,
|
20
|
+
:tagger,
|
21
|
+
:error_writter,
|
22
|
+
:logger,
|
23
|
+
:span_kind,
|
24
|
+
:operation_name_builder
|
25
25
|
|
26
26
|
# rubocop:disable Metrics/ParameterLists
|
27
27
|
def initialize(
|
@@ -41,12 +41,10 @@ module OpenTracing
|
|
41
41
|
end
|
42
42
|
# rubocop:enable Metrics/ParameterLists
|
43
43
|
|
44
|
-
def call(_worker_class, job, _queue, _redis_pool)
|
44
|
+
def call(_worker_class, job, _queue, _redis_pool, &block)
|
45
45
|
scope = safe_start_scope(job)
|
46
46
|
inject(scope.span.context, job)
|
47
|
-
log(scope.span, job)
|
48
|
-
yield
|
49
|
-
end
|
47
|
+
log(scope.span, job, &block)
|
50
48
|
ensure
|
51
49
|
safe_close_scope(scope)
|
52
50
|
end
|
@@ -12,8 +12,8 @@ module OpenTracing
|
|
12
12
|
|
13
13
|
DEFAULT_COMPONENT = 'sidekiq'
|
14
14
|
|
15
|
-
attr_accessor :component
|
16
|
-
|
15
|
+
attr_accessor :component,
|
16
|
+
:log_args
|
17
17
|
|
18
18
|
# @param component [String] component name
|
19
19
|
# @param log_args [TrueClass, FalseClass] enable attribute logging
|
@@ -18,12 +18,12 @@ module OpenTracing
|
|
18
18
|
operation_name_template: DEFAULT_OPERATION_NAME_TEMPLATE,
|
19
19
|
)
|
20
20
|
|
21
|
-
attr_reader :tracer
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
21
|
+
attr_reader :tracer,
|
22
|
+
:tagger,
|
23
|
+
:error_writter,
|
24
|
+
:logger,
|
25
|
+
:span_kind,
|
26
|
+
:operation_name_builder
|
27
27
|
|
28
28
|
# rubocop:disable Metrics/ParameterLists
|
29
29
|
def initialize(
|
@@ -43,12 +43,10 @@ module OpenTracing
|
|
43
43
|
end
|
44
44
|
# rubocop:enable Metrics/ParameterLists
|
45
45
|
|
46
|
-
def call(_worker, job, _queue)
|
46
|
+
def call(_worker, job, _queue, &block)
|
47
47
|
scope = safe_start_scope(job)
|
48
48
|
|
49
|
-
log(scope.span, job)
|
50
|
-
yield
|
51
|
-
end
|
49
|
+
log(scope.span, job, &block)
|
52
50
|
ensure
|
53
51
|
scope&.close
|
54
52
|
end
|
@@ -16,23 +16,23 @@ module OpenTracing
|
|
16
16
|
}.freeze
|
17
17
|
|
18
18
|
autoload :TracedProcessor,
|
19
|
-
module_path
|
19
|
+
"#{module_path}/traced_processor"
|
20
20
|
autoload :TracedProcessorConfig,
|
21
|
-
module_path
|
21
|
+
"#{module_path}/traced_processor_config"
|
22
22
|
autoload :TracedProcessorOperationNameBuilder,
|
23
|
-
module_path
|
23
|
+
"#{module_path}/traced_processor_operation_name_builder"
|
24
24
|
autoload :TracedProcessorTagsBuilder,
|
25
|
-
module_path
|
25
|
+
"#{module_path}/traced_processor_tags_builder"
|
26
26
|
autoload :TracedProtocol,
|
27
|
-
module_path
|
27
|
+
"#{module_path}/traced_protocol"
|
28
28
|
autoload :TracedProtocolConfig,
|
29
|
-
module_path
|
29
|
+
"#{module_path}/traced_protocol_config"
|
30
30
|
autoload :TracedProtocolFactory,
|
31
|
-
module_path
|
31
|
+
"#{module_path}/traced_protocol_factory"
|
32
32
|
autoload :TracedProtocolOperationNameBuilder,
|
33
|
-
module_path
|
33
|
+
"#{module_path}/traced_protocol_operation_name_builder"
|
34
34
|
autoload :TracedProtocolTagsBuilder,
|
35
|
-
module_path
|
35
|
+
"#{module_path}/traced_protocol_tags_builder"
|
36
36
|
end
|
37
37
|
end
|
38
38
|
end
|
@@ -24,6 +24,8 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
25
|
spec.require_paths = ['lib']
|
26
26
|
|
27
|
+
spec.required_ruby_version = "> #{File.read('.ruby-version').strip}"
|
28
|
+
|
27
29
|
spec.add_runtime_dependency 'json'
|
28
30
|
spec.add_runtime_dependency 'opentracing', '~> 0.5.0'
|
29
31
|
|
@@ -37,9 +39,9 @@ Gem::Specification.new do |spec|
|
|
37
39
|
spec.add_development_dependency 'rake', '~> 13.0'
|
38
40
|
spec.add_development_dependency 'redis', '~> 3.3.5'
|
39
41
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
40
|
-
spec.add_development_dependency 'rubocop', '~>
|
41
|
-
spec.add_development_dependency 'rubocop-performance', '~> 1.
|
42
|
-
spec.add_development_dependency 'rubocop-rspec', '~>
|
43
|
-
spec.add_development_dependency 'rubocop-thread_safety', '~> 0.
|
42
|
+
spec.add_development_dependency 'rubocop', '~> 1.15.0'
|
43
|
+
spec.add_development_dependency 'rubocop-performance', '~> 1.11.3'
|
44
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 2.3.0'
|
45
|
+
spec.add_development_dependency 'rubocop-thread_safety', '~> 0.4.2'
|
44
46
|
spec.add_development_dependency 'thrift', '~> 0.11.0'
|
45
47
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opentracing-instrumentation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fedorenko Dmitrij
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -184,56 +184,56 @@ dependencies:
|
|
184
184
|
requirements:
|
185
185
|
- - "~>"
|
186
186
|
- !ruby/object:Gem::Version
|
187
|
-
version:
|
187
|
+
version: 1.15.0
|
188
188
|
type: :development
|
189
189
|
prerelease: false
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
192
|
- - "~>"
|
193
193
|
- !ruby/object:Gem::Version
|
194
|
-
version:
|
194
|
+
version: 1.15.0
|
195
195
|
- !ruby/object:Gem::Dependency
|
196
196
|
name: rubocop-performance
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
198
198
|
requirements:
|
199
199
|
- - "~>"
|
200
200
|
- !ruby/object:Gem::Version
|
201
|
-
version: 1.
|
201
|
+
version: 1.11.3
|
202
202
|
type: :development
|
203
203
|
prerelease: false
|
204
204
|
version_requirements: !ruby/object:Gem::Requirement
|
205
205
|
requirements:
|
206
206
|
- - "~>"
|
207
207
|
- !ruby/object:Gem::Version
|
208
|
-
version: 1.
|
208
|
+
version: 1.11.3
|
209
209
|
- !ruby/object:Gem::Dependency
|
210
210
|
name: rubocop-rspec
|
211
211
|
requirement: !ruby/object:Gem::Requirement
|
212
212
|
requirements:
|
213
213
|
- - "~>"
|
214
214
|
- !ruby/object:Gem::Version
|
215
|
-
version:
|
215
|
+
version: 2.3.0
|
216
216
|
type: :development
|
217
217
|
prerelease: false
|
218
218
|
version_requirements: !ruby/object:Gem::Requirement
|
219
219
|
requirements:
|
220
220
|
- - "~>"
|
221
221
|
- !ruby/object:Gem::Version
|
222
|
-
version:
|
222
|
+
version: 2.3.0
|
223
223
|
- !ruby/object:Gem::Dependency
|
224
224
|
name: rubocop-thread_safety
|
225
225
|
requirement: !ruby/object:Gem::Requirement
|
226
226
|
requirements:
|
227
227
|
- - "~>"
|
228
228
|
- !ruby/object:Gem::Version
|
229
|
-
version: 0.
|
229
|
+
version: 0.4.2
|
230
230
|
type: :development
|
231
231
|
prerelease: false
|
232
232
|
version_requirements: !ruby/object:Gem::Requirement
|
233
233
|
requirements:
|
234
234
|
- - "~>"
|
235
235
|
- !ruby/object:Gem::Version
|
236
|
-
version: 0.
|
236
|
+
version: 0.4.2
|
237
237
|
- !ruby/object:Gem::Dependency
|
238
238
|
name: thrift
|
239
239
|
requirement: !ruby/object:Gem::Requirement
|
@@ -261,6 +261,7 @@ files:
|
|
261
261
|
- ".gitlab-ci.yml"
|
262
262
|
- ".rubocop.yml"
|
263
263
|
- ".ruby-version"
|
264
|
+
- CHANGELOG.md
|
264
265
|
- GEM_VERSION
|
265
266
|
- Gemfile
|
266
267
|
- Gemfile.lock
|
@@ -337,23 +338,23 @@ homepage: https://gitlab.com/c0va23/ruby-opentracing-instrumentation.
|
|
337
338
|
licenses:
|
338
339
|
- MIT
|
339
340
|
metadata: {}
|
340
|
-
post_install_message:
|
341
|
+
post_install_message:
|
341
342
|
rdoc_options: []
|
342
343
|
require_paths:
|
343
344
|
- lib
|
344
345
|
required_ruby_version: !ruby/object:Gem::Requirement
|
345
346
|
requirements:
|
346
|
-
- - "
|
347
|
+
- - ">"
|
347
348
|
- !ruby/object:Gem::Version
|
348
|
-
version:
|
349
|
+
version: 2.5.0
|
349
350
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
350
351
|
requirements:
|
351
352
|
- - ">="
|
352
353
|
- !ruby/object:Gem::Version
|
353
354
|
version: '0'
|
354
355
|
requirements: []
|
355
|
-
rubygems_version: 3.1.
|
356
|
-
signing_key:
|
356
|
+
rubygems_version: 3.1.6
|
357
|
+
signing_key:
|
357
358
|
specification_version: 4
|
358
359
|
summary: OpenTracing instrumentation for popular ruby libraries
|
359
360
|
test_files: []
|