sidekiq-instrumentation 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 53ecfbe825442a4f1f52b8fece60933d9dfa6d6f8218fc8ee1a2114b3b833616
4
- data.tar.gz: 87a485d5e9db7d78cbc74fd251e5e74df110ae93ba598a73a98ab2fab4fb52e4
3
+ metadata.gz: 15a4684ee4a4994dc8a76c0e7d0905dd498a06a58f619066ceb0ff089d3df379
4
+ data.tar.gz: 1fee9c0892325630863049961ce5f4e0f1c00a934d6f23e0ccdf34cc5cd16b4d
5
5
  SHA512:
6
- metadata.gz: a3dd5c28eaaab836b53182f4f26087bcc55007fd3fd8898053bcbcc8e6c13a7d8d04e3096e5791e93e8e396a82cc1ae18e2282d1fa9afb19d45b18aa63b33d5b
7
- data.tar.gz: c6a5a212435c9722f72cc8945c5b924bf895ae442294805af0b7997aa657377bba12e57c846bd825bb9f07dace6ee2e52a3c5c6bbb1cc36ba1813fbb0b88eb1b
6
+ metadata.gz: 7d68879b7e44765920ec54f006d6aa2bc8222f2de00080dacbace7306f33f32ccc15326b1a6813973109ce5db81b46128471fb5879aeac0011a5a3b2b8c3df21
7
+ data.tar.gz: 6036c4aac84429b921a2003c61d0076eb5775efbb67bd07fb1c7d0a048e8aa78e63529d38e92aa82aca1a77dd9d5655ec3609f54c0719c8285fd4aef171f872f
@@ -1,10 +1,13 @@
1
1
 
2
2
  Changelog
3
3
  =========
4
+ ## 1.2.1 07/09/2020
5
+ * Ensure child spans are nested under the root Sidekiq span in the trace
6
+
4
7
  ## 1.2.0 05/28/2020
5
8
  * Ignore active scope in consumers
6
9
 
7
10
  ## 1.1.0 05/27/2020
8
11
  * Set up build pipeline with circleci and gem-publisher
9
12
  * Fixed linting issues
10
- * Renamed gem to `sidekiq-instrumentation`
13
+ * Renamed gem to `sidekiq-instrumentation`
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sidekiq-instrumentation (1.2.0)
4
+ sidekiq-instrumentation (1.2.1)
5
5
  opentracing (>= 0.3.1)
6
6
 
7
7
  GEM
@@ -90,4 +90,4 @@ DEPENDENCIES
90
90
  tracing-matchers (~> 1.0, >= 1.3.0)
91
91
 
92
92
  BUNDLED WITH
93
- 1.17.2
93
+ 1.17.3
@@ -12,29 +12,27 @@ module Sidekiq
12
12
  @active_span = active_span
13
13
  end
14
14
 
15
+ # rubocop:disable Metrics/MethodLength
15
16
  def call(_worker, job, _queue)
16
- span = build_span(job)
17
-
18
- yield
19
- rescue StandardError => e
20
- tag_errors(span, e) if span
21
- raise
22
- ensure
23
- span&.finish
24
- end
25
-
26
- private
27
-
28
- def build_span(job)
29
17
  parent_span_context = extract(job)
30
18
 
31
19
  follows_from = OpenTracing::Reference.follows_from(parent_span_context)
32
20
 
33
- tracer.start_span(operation_name(job),
34
- references: [follows_from],
35
- ignore_active_scope: true,
36
- tags: tags(job, "consumer"))
21
+ tracer.start_active_span(operation_name(job),
22
+ references: [follows_from],
23
+ ignore_active_scope: true,
24
+ tags: tags(job, "consumer")) do |scope|
25
+ begin
26
+ yield
27
+ rescue StandardError => e
28
+ tag_errors(scope.span, e) if scope.span
29
+ raise
30
+ end
31
+ end
37
32
  end
33
+ # rubocop:enable Metrics/MethodLength
34
+
35
+ private
38
36
 
39
37
  def tag_errors(span, error)
40
38
  span.set_tag("error", true)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sidekiq
4
4
  module Tracer
5
- VERSION = "1.2.0"
5
+ VERSION = "1.2.1"
6
6
  end
7
7
  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.0
4
+ version: 1.2.1
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-06-09 00:00:00.000000000 Z
12
+ date: 2020-07-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: opentracing