opentracing-instrumentation 0.1.15 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.BUNDLER_VERSION +1 -1
- data/.drone.jsonnet +3 -3
- data/.gitlab-ci.yml +12 -11
- data/.rubocop.yml +7 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +7 -0
- data/GEM_VERSION +1 -1
- data/Gemfile +7 -7
- data/Gemfile.lock +80 -60
- data/bin/check_gemfile_lock +18 -0
- 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.rb +2 -0
- data/lib/opentracing/instrumentation/common/error_writer.rb +2 -2
- data/lib/opentracing/instrumentation/common/operation_name_builder.rb +23 -0
- 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.rb +2 -0
- data/lib/opentracing/instrumentation/mongo/query_sanitazer.rb +48 -5
- data/lib/opentracing/instrumentation/mongo/sample_safety_argument_checker.rb +30 -0
- 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 +41 -18
- data/lib/opentracing/instrumentation/sidekiq/job_tagger.rb +7 -7
- data/lib/opentracing/instrumentation/sidekiq/server_middleware.rb +41 -15
- 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_config.rb +1 -1
- 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 +11 -7
- metadata +42 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f1bf3278054a44d66c91a009850b1fc7f7386285ca95158743fc16e79669ae3
|
4
|
+
data.tar.gz: 2f45d267611e2d6a4c376c1955a8010d7f9f6830ec1679c63b8a4fc7bb627a0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9dc425554c43ee11d6f54d40831260a30925ba4c6b28c317c84e69873932ed34119f570698892f4239b847708209e0b82ee497e4a70dd44e859bbae87865576a
|
7
|
+
data.tar.gz: bd5ab5e2025f81c62b303915d272c29ab9260fc7ecfcf74abbbb2db3f2e49f12ea52f3876b7a81c3e132c3bc934baad6de01a1d221502e76ea78beac418dbee1
|
data/.BUNDLER_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.2.15
|
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
@@ -4,6 +4,8 @@ stages:
|
|
4
4
|
|
5
5
|
.test_shared: &test_shared
|
6
6
|
before_script:
|
7
|
+
# check version should be called before any bundle calls
|
8
|
+
- ./bin/check_gemfile_lock
|
7
9
|
- apk add --update
|
8
10
|
git
|
9
11
|
ruby-dev
|
@@ -14,7 +16,6 @@ stages:
|
|
14
16
|
|
15
17
|
- export BUNDLE_PATH=vendor/
|
16
18
|
- bundler install --jobs $(nproc)
|
17
|
-
- bundler update
|
18
19
|
|
19
20
|
- ruby --version
|
20
21
|
- gem --version
|
@@ -23,15 +24,6 @@ stages:
|
|
23
24
|
script:
|
24
25
|
- bundle exec rake
|
25
26
|
|
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
27
|
test/2.5:
|
36
28
|
<<: *test_shared
|
37
29
|
stage: test
|
@@ -59,6 +51,15 @@ test/2.7:
|
|
59
51
|
paths:
|
60
52
|
- vendor/ruby/2.7.0
|
61
53
|
|
54
|
+
test/3.0:
|
55
|
+
<<: *test_shared
|
56
|
+
stage: test
|
57
|
+
image: ruby:3.0-alpine
|
58
|
+
|
59
|
+
cache:
|
60
|
+
paths:
|
61
|
+
- vendor/ruby/3.0.0
|
62
|
+
|
62
63
|
publish:
|
63
64
|
stage: publish
|
64
65
|
image: ruby:2.7-alpine
|
@@ -71,7 +72,7 @@ publish:
|
|
71
72
|
- export SOURCE_GEM_VERSION=$(cat GEM_VERSION)
|
72
73
|
- test ${CI_COMMIT_TAG} == v${SOURCE_GEM_VERSION}
|
73
74
|
|
74
|
-
- export GEM_FILE_NAME="
|
75
|
+
- export GEM_FILE_NAME="opentracing-instrumentation-${CI_COMMIT_TAG}.gem"
|
75
76
|
- export GEM_FILE_PATH="pkg/${GEM_FILE_NAME}"
|
76
77
|
|
77
78
|
- mkdir -p pkg/
|
data/.rubocop.yml
CHANGED
@@ -1,11 +1,18 @@
|
|
1
1
|
require:
|
2
|
+
- rubocop-rake
|
2
3
|
- rubocop-rspec
|
3
4
|
- rubocop-performance
|
4
5
|
- rubocop-thread_safety
|
5
6
|
|
7
|
+
AllCops:
|
8
|
+
NewCops: enable
|
9
|
+
|
6
10
|
Layout/LineLength:
|
7
11
|
Max: 100
|
8
12
|
|
13
|
+
RSpec/MultipleMemoizedHelpers:
|
14
|
+
Max: 18
|
15
|
+
|
9
16
|
Style/TrailingCommaInHashLiteral:
|
10
17
|
EnforcedStyleForMultiline: comma
|
11
18
|
|
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
|
1
|
+
0.2.1
|
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
@@ -18,92 +18,111 @@ GIT
|
|
18
18
|
PATH
|
19
19
|
remote: .
|
20
20
|
specs:
|
21
|
-
opentracing-instrumentation (0.1
|
21
|
+
opentracing-instrumentation (0.2.1)
|
22
22
|
json
|
23
23
|
opentracing (~> 0.5.0)
|
24
24
|
|
25
25
|
GEM
|
26
26
|
remote: https://rubygems.org/
|
27
27
|
specs:
|
28
|
-
activesupport (5.2.
|
28
|
+
activesupport (5.2.6)
|
29
29
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
30
30
|
i18n (>= 0.7, < 2)
|
31
31
|
minitest (~> 5.1)
|
32
32
|
tzinfo (~> 1.1)
|
33
|
-
amq-protocol (2.3.
|
34
|
-
ast (2.4.
|
35
|
-
bson (4.
|
33
|
+
amq-protocol (2.3.2)
|
34
|
+
ast (2.4.2)
|
35
|
+
bson (4.12.0)
|
36
36
|
bunny (2.14.4)
|
37
37
|
amq-protocol (~> 2.3, >= 2.3.0)
|
38
|
-
byebug (11.1.
|
38
|
+
byebug (11.1.3)
|
39
39
|
carrot-top (0.0.7)
|
40
40
|
json
|
41
|
-
coderay (1.1.
|
42
|
-
concurrent-ruby (1.1.
|
43
|
-
diff-lcs (1.
|
44
|
-
faraday (1.
|
41
|
+
coderay (1.1.3)
|
42
|
+
concurrent-ruby (1.1.8)
|
43
|
+
diff-lcs (1.4.4)
|
44
|
+
faraday (1.4.2)
|
45
|
+
faraday-em_http (~> 1.0)
|
46
|
+
faraday-em_synchrony (~> 1.0)
|
47
|
+
faraday-excon (~> 1.1)
|
48
|
+
faraday-net_http (~> 1.0)
|
49
|
+
faraday-net_http_persistent (~> 1.1)
|
45
50
|
multipart-post (>= 1.2, < 3)
|
51
|
+
ruby2_keywords (>= 0.0.4)
|
52
|
+
faraday-em_http (1.0.0)
|
53
|
+
faraday-em_synchrony (1.0.0)
|
54
|
+
faraday-excon (1.1.0)
|
55
|
+
faraday-net_http (1.0.1)
|
56
|
+
faraday-net_http_persistent (1.1.0)
|
46
57
|
hutch (0.26.0)
|
47
58
|
activesupport (>= 4.2, < 6)
|
48
59
|
bunny (>= 2.12, < 2.15)
|
49
60
|
carrot-top (~> 0.0.7)
|
50
61
|
multi_json (~> 1.12)
|
51
|
-
i18n (1.8.
|
62
|
+
i18n (1.8.10)
|
52
63
|
concurrent-ruby (~> 1.0)
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
multi_json (1.14.1)
|
64
|
+
json (2.5.1)
|
65
|
+
method_source (1.0.0)
|
66
|
+
minitest (5.14.4)
|
67
|
+
multi_json (1.15.0)
|
58
68
|
multipart-post (2.1.1)
|
59
69
|
opentracing (0.5.0)
|
60
|
-
parallel (1.
|
61
|
-
parser (
|
62
|
-
ast (~> 2.4.
|
63
|
-
pry (0.
|
64
|
-
coderay (~> 1.1
|
65
|
-
method_source (~>
|
66
|
-
pry-byebug (3.
|
70
|
+
parallel (1.20.1)
|
71
|
+
parser (3.0.1.1)
|
72
|
+
ast (~> 2.4.1)
|
73
|
+
pry (0.13.1)
|
74
|
+
coderay (~> 1.1)
|
75
|
+
method_source (~> 1.0)
|
76
|
+
pry-byebug (3.9.0)
|
67
77
|
byebug (~> 11.0)
|
68
|
-
pry (~> 0.
|
69
|
-
rack (2.2.
|
78
|
+
pry (~> 0.13.0)
|
79
|
+
rack (2.2.3)
|
70
80
|
rainbow (3.0.0)
|
71
|
-
rake (13.0.
|
81
|
+
rake (13.0.3)
|
72
82
|
redis (3.3.5)
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
rspec-
|
77
|
-
rspec-
|
78
|
-
|
79
|
-
|
80
|
-
|
83
|
+
regexp_parser (2.1.1)
|
84
|
+
rexml (3.2.5)
|
85
|
+
rspec (3.10.0)
|
86
|
+
rspec-core (~> 3.10.0)
|
87
|
+
rspec-expectations (~> 3.10.0)
|
88
|
+
rspec-mocks (~> 3.10.0)
|
89
|
+
rspec-core (3.10.1)
|
90
|
+
rspec-support (~> 3.10.0)
|
91
|
+
rspec-expectations (3.10.1)
|
81
92
|
diff-lcs (>= 1.2.0, < 2.0)
|
82
|
-
rspec-support (~> 3.
|
83
|
-
rspec-mocks (3.
|
93
|
+
rspec-support (~> 3.10.0)
|
94
|
+
rspec-mocks (3.10.2)
|
84
95
|
diff-lcs (>= 1.2.0, < 2.0)
|
85
|
-
rspec-support (~> 3.
|
86
|
-
rspec-support (3.
|
87
|
-
rubocop (
|
88
|
-
jaro_winkler (~> 1.5.1)
|
96
|
+
rspec-support (~> 3.10.0)
|
97
|
+
rspec-support (3.10.2)
|
98
|
+
rubocop (1.15.0)
|
89
99
|
parallel (~> 1.10)
|
90
|
-
parser (>=
|
100
|
+
parser (>= 3.0.0.0)
|
91
101
|
rainbow (>= 2.2.2, < 4.0)
|
102
|
+
regexp_parser (>= 1.8, < 3.0)
|
92
103
|
rexml
|
104
|
+
rubocop-ast (>= 1.5.0, < 2.0)
|
93
105
|
ruby-progressbar (~> 1.7)
|
94
|
-
unicode-display_width (>= 1.4.0, <
|
95
|
-
rubocop-
|
96
|
-
|
97
|
-
rubocop-
|
98
|
-
rubocop (>= 0.
|
99
|
-
|
100
|
-
|
101
|
-
|
106
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
107
|
+
rubocop-ast (1.5.0)
|
108
|
+
parser (>= 3.0.1.1)
|
109
|
+
rubocop-performance (1.11.3)
|
110
|
+
rubocop (>= 1.7.0, < 2.0)
|
111
|
+
rubocop-ast (>= 0.4.0)
|
112
|
+
rubocop-rake (0.5.1)
|
113
|
+
rubocop
|
114
|
+
rubocop-rspec (2.3.0)
|
115
|
+
rubocop (~> 1.0)
|
116
|
+
rubocop-ast (>= 1.1.0)
|
117
|
+
rubocop-thread_safety (0.4.2)
|
118
|
+
rubocop (>= 0.53.0)
|
119
|
+
ruby-progressbar (1.11.0)
|
120
|
+
ruby2_keywords (0.0.4)
|
102
121
|
thread_safe (0.3.6)
|
103
|
-
thrift (0.
|
104
|
-
tzinfo (1.2.
|
122
|
+
thrift (0.14.1)
|
123
|
+
tzinfo (1.2.9)
|
105
124
|
thread_safe (~> 0.1)
|
106
|
-
unicode-display_width (
|
125
|
+
unicode-display_width (2.0.0)
|
107
126
|
|
108
127
|
PLATFORMS
|
109
128
|
ruby
|
@@ -111,9 +130,9 @@ PLATFORMS
|
|
111
130
|
DEPENDENCIES
|
112
131
|
activesupport (~> 5.2)
|
113
132
|
bson (~> 4.0)
|
114
|
-
bundler (= 2.
|
133
|
+
bundler (= 2.2.15)
|
115
134
|
bunny (~> 2.0)
|
116
|
-
faraday (~> 1.0
|
135
|
+
faraday (~> 1.0)
|
117
136
|
hutch (~> 0.26.0)
|
118
137
|
opentracing-instrumentation!
|
119
138
|
pry-byebug (~> 3.8)
|
@@ -121,13 +140,14 @@ DEPENDENCIES
|
|
121
140
|
rake (~> 13.0)
|
122
141
|
redis (~> 3.3.5)
|
123
142
|
rspec (~> 3.0)
|
124
|
-
rubocop (~>
|
125
|
-
rubocop-performance (~> 1.
|
126
|
-
rubocop-
|
127
|
-
rubocop-
|
143
|
+
rubocop (~> 1.15.0)
|
144
|
+
rubocop-performance (~> 1.11.3)
|
145
|
+
rubocop-rake (~> 0.5.1)
|
146
|
+
rubocop-rspec (~> 2.3.0)
|
147
|
+
rubocop-thread_safety (~> 0.4.2)
|
128
148
|
test-tracer!
|
129
|
-
thrift (~> 0.
|
149
|
+
thrift (~> 0.14.1)
|
130
150
|
tracing-matchers!
|
131
151
|
|
132
152
|
BUNDLED WITH
|
133
|
-
2.
|
153
|
+
2.2.15
|
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
GEMFILE_LOCK_PATH=Gemfile.lock
|
4
|
+
GEM_VERSION_PATH=GEM_VERSION
|
5
|
+
|
6
|
+
gem_versio=$(cat "${GEM_VERSION_PATH}")
|
7
|
+
|
8
|
+
expected_line="opentracing-instrumentation (${gem_versio})"
|
9
|
+
|
10
|
+
grep "${expected_line}" "${GEMFILE_LOCK_PATH}" > /dev/null
|
11
|
+
exit_code=$?
|
12
|
+
|
13
|
+
if [ $exit_code != 0 ]; then
|
14
|
+
echo "Update gem version ${GEMFILE_LOCK_PATH} and commit it" > /dev/stderr
|
15
|
+
exit 1
|
16
|
+
else
|
17
|
+
echo "Gem version into ${GEMFILE_LOCK_PATH} valid" > /dev/stdout
|
18
|
+
fi
|
@@ -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
|