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.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/.BUNDLER_VERSION +1 -1
  3. data/.drone.jsonnet +3 -3
  4. data/.gitlab-ci.yml +12 -11
  5. data/.rubocop.yml +7 -0
  6. data/.ruby-version +1 -1
  7. data/CHANGELOG.md +7 -0
  8. data/GEM_VERSION +1 -1
  9. data/Gemfile +7 -7
  10. data/Gemfile.lock +80 -60
  11. data/bin/check_gemfile_lock +18 -0
  12. data/lib/opentracing/instrumentation/bunny.rb +11 -11
  13. data/lib/opentracing/instrumentation/bunny/regexp_routing_key_sanitazer.rb +1 -1
  14. data/lib/opentracing/instrumentation/common.rb +2 -0
  15. data/lib/opentracing/instrumentation/common/error_writer.rb +2 -2
  16. data/lib/opentracing/instrumentation/common/operation_name_builder.rb +23 -0
  17. data/lib/opentracing/instrumentation/faraday/response_logger.rb +4 -4
  18. data/lib/opentracing/instrumentation/faraday/trace_middleware.rb +1 -1
  19. data/lib/opentracing/instrumentation/hutch.rb +6 -6
  20. data/lib/opentracing/instrumentation/mongo.rb +2 -0
  21. data/lib/opentracing/instrumentation/mongo/query_sanitazer.rb +48 -5
  22. data/lib/opentracing/instrumentation/mongo/sample_safety_argument_checker.rb +30 -0
  23. data/lib/opentracing/instrumentation/mongo/trace_subscriber.rb +5 -5
  24. data/lib/opentracing/instrumentation/rack/http_tagger.rb +3 -3
  25. data/lib/opentracing/instrumentation/rack/trace_middleware.rb +5 -5
  26. data/lib/opentracing/instrumentation/redis/config.rb +5 -5
  27. data/lib/opentracing/instrumentation/redis/tracing_driver_wrapper.rb +4 -4
  28. data/lib/opentracing/instrumentation/sidekiq/client_middleware.rb +41 -18
  29. data/lib/opentracing/instrumentation/sidekiq/job_tagger.rb +7 -7
  30. data/lib/opentracing/instrumentation/sidekiq/server_middleware.rb +41 -15
  31. data/lib/opentracing/instrumentation/thrift.rb +9 -9
  32. data/lib/opentracing/instrumentation/thrift/traced_processor.rb +2 -2
  33. data/lib/opentracing/instrumentation/thrift/traced_processor_config.rb +1 -1
  34. data/lib/opentracing/instrumentation/thrift/traced_processor_tags_builder.rb +1 -0
  35. data/lib/opentracing/instrumentation/thrift/traced_protocol.rb +3 -3
  36. data/lib/opentracing/instrumentation/thrift/traced_protocol_factory.rb +1 -0
  37. data/lib/opentracing/instrumentation/thrift/traced_protocol_tags_builder.rb +1 -1
  38. data/opentracing-instrumentation.gemspec +11 -7
  39. metadata +42 -23
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b1d6a7f7070f79e0d57f243777fa02a2b8ac6d289b1f5bf54a3c47c171f86603
4
- data.tar.gz: fb4a1c4b4260c32be8e5b12b6cc48eec27cdf7bf220cb6bb82fba9fd7ed45b3d
3
+ metadata.gz: 2f1bf3278054a44d66c91a009850b1fc7f7386285ca95158743fc16e79669ae3
4
+ data.tar.gz: 2f45d267611e2d6a4c376c1955a8010d7f9f6830ec1679c63b8a4fc7bb627a0e
5
5
  SHA512:
6
- metadata.gz: 11b622db2d6df23aaa474cb5ad37a34c5a2bcd9136e92c0d966b9c36bc8cbea7ee5c3d85d31e47ceb44010dbc487b94042dedb23cf505d51ee2c1a9b8e5e700c
7
- data.tar.gz: 1623f9d0ca9a70ce161db8c9350cc3228932aa24e1367b0e2beb069b920747eeffd406c34b9949c08ab0f11371a033d0202e593aa2b0c12d72c18f06bb593032
6
+ metadata.gz: 9dc425554c43ee11d6f54d40831260a30925ba4c6b28c317c84e69873932ed34119f570698892f4239b847708209e0b82ee497e4a70dd44e859bbae87865576a
7
+ data.tar.gz: bd5ab5e2025f81c62b303915d272c29ab9260fc7ecfcf74abbbb2db3f2e49f12ea52f3876b7a81c3e132c3bc934baad6de01a1d221502e76ea78beac418dbee1
data/.BUNDLER_VERSION CHANGED
@@ -1 +1 @@
1
- 2.1.4
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: "docker",
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:2.1.4",
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="multiprotocol_thrift_rack_app-${CI_COMMIT_TAG}.gem"
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.4.0
1
+ 2.5.0
data/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ ## 0.2.1
2
+ - Truncate arrays into mongo command sanitazer
3
+
4
+ ## 0.2.0
5
+ - Drop support ruby 2.4
6
+ - Support ruby 3.0
7
+ - Update rubocop and fix new warnings
data/GEM_VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.15
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.15)
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.4.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.0)
34
- ast (2.4.0)
35
- bson (4.8.0)
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.1)
38
+ byebug (11.1.3)
39
39
  carrot-top (0.0.7)
40
40
  json
41
- coderay (1.1.2)
42
- concurrent-ruby (1.1.6)
43
- diff-lcs (1.3)
44
- faraday (1.0.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.2)
62
+ i18n (1.8.10)
52
63
  concurrent-ruby (~> 1.0)
53
- jaro_winkler (1.5.4)
54
- json (2.3.0)
55
- method_source (0.9.2)
56
- minitest (5.14.0)
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.19.1)
61
- parser (2.7.0.5)
62
- ast (~> 2.4.0)
63
- pry (0.12.2)
64
- coderay (~> 1.1.0)
65
- method_source (~> 0.9.0)
66
- pry-byebug (3.8.0)
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.10)
69
- rack (2.2.2)
78
+ pry (~> 0.13.0)
79
+ rack (2.2.3)
70
80
  rainbow (3.0.0)
71
- rake (13.0.1)
81
+ rake (13.0.3)
72
82
  redis (3.3.5)
73
- rexml (3.2.4)
74
- rspec (3.9.0)
75
- rspec-core (~> 3.9.0)
76
- rspec-expectations (~> 3.9.0)
77
- rspec-mocks (~> 3.9.0)
78
- rspec-core (3.9.1)
79
- rspec-support (~> 3.9.1)
80
- rspec-expectations (3.9.0)
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.9.0)
83
- rspec-mocks (3.9.1)
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.9.0)
86
- rspec-support (3.9.2)
87
- rubocop (0.80.1)
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 (>= 2.7.0.1)
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, < 1.7)
95
- rubocop-performance (1.5.2)
96
- rubocop (>= 0.71.0)
97
- rubocop-rspec (1.38.1)
98
- rubocop (>= 0.68.1)
99
- rubocop-thread_safety (0.3.4)
100
- rubocop (>= 0.51.0)
101
- ruby-progressbar (1.10.1)
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.11.0.0)
104
- tzinfo (1.2.6)
122
+ thrift (0.14.1)
123
+ tzinfo (1.2.9)
105
124
  thread_safe (~> 0.1)
106
- unicode-display_width (1.6.1)
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.1.4)
133
+ bundler (= 2.2.15)
115
134
  bunny (~> 2.0)
116
- faraday (~> 1.0.1)
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 (~> 0.80.0)
125
- rubocop-performance (~> 1.5.2)
126
- rubocop-rspec (~> 1.38.1)
127
- rubocop-thread_safety (~> 0.3.4)
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.11.0)
149
+ thrift (~> 0.14.1)
130
150
  tracing-matchers!
131
151
 
132
152
  BUNDLED WITH
133
- 2.1.4
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 + '/consume_operation_name_builder'
13
+ "#{module_path}/consume_operation_name_builder"
14
14
  autoload :ConsumeTagsBuilder,
15
- module_path + '/consume_tags_builder'
15
+ "#{module_path}/consume_tags_builder"
16
16
  autoload :ConsumeTracer,
17
- module_path + '/consume_tracer'
17
+ "#{module_path}/consume_tracer"
18
18
  autoload :ConsumeTracerConfig,
19
- module_path + '/consume_tracer_config'
19
+ "#{module_path}/consume_tracer_config"
20
20
  autoload :HeadersBuilder,
21
- module_path + '/headers_builder'
21
+ "#{module_path}/headers_builder"
22
22
  autoload :HeadersInjector,
23
- module_path + '/headers_injector'
23
+ "#{module_path}/headers_injector"
24
24
  autoload :PublishOperationNameBuilder,
25
- module_path + '/publish_operation_name_builder'
25
+ "#{module_path}/publish_operation_name_builder"
26
26
  autoload :PublishTagsBuilder,
27
- module_path + '/publish_tags_builder'
27
+ "#{module_path}/publish_tags_builder"
28
28
  autoload :PublishTracer,
29
- module_path + '/publish_tracer'
29
+ "#{module_path}/publish_tracer"
30
30
  autoload :PublishTracerConfig,
31
- module_path + '/publish_tracer_config'
31
+ "#{module_path}/publish_tracer_config"
32
32
  autoload :RegexpRoutingKeySanitazer,
33
- module_path + '/regexp_routing_key_sanitazer'
33
+ "#{module_path}/regexp_routing_key_sanitazer"
34
34
  end
35
35
  end
36
36
  end
@@ -32,7 +32,7 @@ module OpenTracing
32
32
  def sanitaze_routing_key(routing_key)
33
33
  routing_key
34
34
  .split(ROUTING_KEY_SEPARATOR)
35
- .map(&method(:filter_part))
35
+ .map { |part| filter_part(part) }
36
36
  .join(ROUTING_KEY_SEPARATOR)
37
37
  end
38
38
 
@@ -8,6 +8,8 @@ module OpenTracing
8
8
  module Common
9
9
  autoload :ErrorWriter,
10
10
  'opentracing/instrumentation/common/error_writer'
11
+ autoload :OperationNameBuilder,
12
+ 'opentracing/instrumentation/common/operation_name_builder'
11
13
  end
12
14
  end
13
15
  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
- attr_reader :log_error_event
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