sidekiq-instrumentation 1.2.1 → 1.2.2.ejacobs1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/sidekiq/tracer.rb +7 -7
- data/lib/sidekiq/tracer/server_middleware.rb +5 -2
- data/lib/sidekiq/tracer/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 332c892cee99ef96c6d9d1cb8022b1492b37907ec3f494c033460061fab39dd2
|
4
|
+
data.tar.gz: 8e6172fec42f502ff1ad80ebfd1a13a06ea040ea73190456dfa172520aa656b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c40967f6cb33f99e827c43fd39fc5bd1c488cb62eee62f939f8e99d9d63673d2d2df7e39da13ddf8de0a51bffb113065a264d7da5c2bb6406361ae26033eb68
|
7
|
+
data.tar.gz: 6e6ad4257a86594557c290b0d46a9631dfae0229a5052241da779dd580fb583bb0ad6615fe5ecfe33f20307eeccbc57669a7ec517b5c9a38b4fef6638d67cf7e
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/sidekiq/tracer.rb
CHANGED
@@ -11,9 +11,9 @@ require "sidekiq/tracer/server_middleware"
|
|
11
11
|
module Sidekiq
|
12
12
|
module Tracer
|
13
13
|
class << self
|
14
|
-
def instrument(tracer: OpenTracing.global_tracer, active_span: nil)
|
14
|
+
def instrument(tracer: OpenTracing.global_tracer, active_span: nil, after_trace: nil)
|
15
15
|
instrument_client(tracer: tracer, active_span: active_span)
|
16
|
-
instrument_server(tracer: tracer, active_span: active_span)
|
16
|
+
instrument_server(tracer: tracer, active_span: active_span, after_trace: after_trace)
|
17
17
|
end
|
18
18
|
|
19
19
|
def instrument_client(tracer: OpenTracing.global_tracer, active_span: nil)
|
@@ -22,23 +22,23 @@ module Sidekiq
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
def instrument_server(tracer: OpenTracing.global_tracer, active_span: nil)
|
25
|
+
def instrument_server(tracer: OpenTracing.global_tracer, active_span: nil, after_trace: nil)
|
26
26
|
Sidekiq.configure_server do |config|
|
27
27
|
config.client_middleware { |chain| add_client_middleware(chain, tracer, active_span) }
|
28
|
-
config.server_middleware { |chain| add_server_middleware(chain, tracer, active_span) }
|
28
|
+
config.server_middleware { |chain| add_server_middleware(chain, tracer, active_span, after_trace) }
|
29
29
|
end
|
30
30
|
|
31
31
|
return unless defined?(Sidekiq::Testing)
|
32
32
|
|
33
|
-
Sidekiq::Testing.server_middleware { |chain| add_server_middleware(chain, tracer, active_span) }
|
33
|
+
Sidekiq::Testing.server_middleware { |chain| add_server_middleware(chain, tracer, active_span, after_trace) }
|
34
34
|
end
|
35
35
|
|
36
36
|
def add_client_middleware(chain, tracer, active_span)
|
37
37
|
chain.add Sidekiq::Tracer::ClientMiddleware, tracer: tracer, active_span: active_span
|
38
38
|
end
|
39
39
|
|
40
|
-
def add_server_middleware(chain, tracer, active_span)
|
41
|
-
chain.add Sidekiq::Tracer::ServerMiddleware, tracer: tracer, active_span: active_span
|
40
|
+
def add_server_middleware(chain, tracer, active_span, after_trace)
|
41
|
+
chain.add Sidekiq::Tracer::ServerMiddleware, tracer: tracer, active_span: active_span, after_trace: after_trace
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
@@ -5,11 +5,12 @@ module Sidekiq
|
|
5
5
|
class ServerMiddleware
|
6
6
|
include Commons
|
7
7
|
|
8
|
-
attr_reader :tracer, :active_span
|
8
|
+
attr_reader :tracer, :active_span, :after_trace
|
9
9
|
|
10
|
-
def initialize(tracer:, active_span:)
|
10
|
+
def initialize(tracer:, active_span:, after_trace:)
|
11
11
|
@tracer = tracer
|
12
12
|
@active_span = active_span
|
13
|
+
@after_trace = after_trace
|
13
14
|
end
|
14
15
|
|
15
16
|
# rubocop:disable Metrics/MethodLength
|
@@ -27,6 +28,8 @@ module Sidekiq
|
|
27
28
|
rescue StandardError => e
|
28
29
|
tag_errors(scope.span, e) if scope.span
|
29
30
|
raise
|
31
|
+
ensure
|
32
|
+
after_trace&.call(scope.span) if scope.span
|
30
33
|
end
|
31
34
|
end
|
32
35
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-instrumentation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2.ejacobs1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- iaintshine
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-09-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: opentracing
|
@@ -204,9 +204,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
204
204
|
version: '0'
|
205
205
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
206
206
|
requirements:
|
207
|
-
- - "
|
207
|
+
- - ">"
|
208
208
|
- !ruby/object:Gem::Version
|
209
|
-
version:
|
209
|
+
version: 1.3.1
|
210
210
|
requirements: []
|
211
211
|
rubygems_version: 3.1.2
|
212
212
|
signing_key:
|