lhc 10.2.0 → 10.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: 3fc6f67c5590c8d29e3975dd469db633f164cfe3ba7109d0219757f8a6d5b4d2
4
- data.tar.gz: 14b0ad5191daa8a24ac9179705d6f984ff125db3a800fa7cb995643fb0d3201f
3
+ metadata.gz: 5995d465230282a514f8578d41bd62ff6013550f15408e3ff174a087d8ce8247
4
+ data.tar.gz: 574aaaa921e4f7ee9f724082d21ed2188fb8ae054645e0238a18838ad5fbf7c1
5
5
  SHA512:
6
- metadata.gz: 4e5e21160102890932469d254ded92bdcd7beac5a922cede08a52b431dc3f70fc419f0a3b8eac64cf4c68dc0190bec4d9eb6f7d0cb232803e0d805ac691b8e5b
7
- data.tar.gz: 48fdca5e9f48be632024b24b7be5819551ca03316f20509c679652eb1b79feff662d4e7b1533434bac02cfcd9f1376c2d366399346125db8e256bbba9a4ed05f
6
+ metadata.gz: 4886f53416547af48f05145d1400cdd91da733eb7231e56d646232084295c6c927f2cde2c408ac9b058450964049aee2d62caf29c0096f5f36a4e6b307169fad
7
+ data.tar.gz: e06fb5be41f70e2f6cdf7009c3fe574843b47638003625edb38f3e36e311744e9e297fc21c080d978284d63039e8b5849d0f78e7f5613e923c79127ba16e354c
@@ -11,7 +11,7 @@ class LHC::Zipkin < LHC::Interceptor
11
11
  TRUE = '1' # true in binary annotation
12
12
 
13
13
  def before_request
14
- return unless dependencies?
14
+ return if !dependencies? || !tracing?
15
15
  ZipkinTracer::TraceContainer.with_trace_id(trace_id) do
16
16
  # add headers even if the current trace_id should not be sampled
17
17
  B3_HEADERS.each { |method, header| request.headers[header] = trace_id.send(method).to_s }
@@ -28,6 +28,10 @@ class LHC::Zipkin < LHC::Interceptor
28
28
 
29
29
  private
30
30
 
31
+ def tracing?
32
+ ZipkinTracer::TraceContainer.current
33
+ end
34
+
31
35
  def start_trace!
32
36
  record_path
33
37
  record_remote_endpoint
@@ -97,7 +101,6 @@ class LHC::Zipkin < LHC::Interceptor
97
101
  def dependencies?
98
102
  (
99
103
  defined?(ZipkinTracer::TraceContainer) &&
100
- ZipkinTracer::TraceContainer.current &&
101
104
  defined?(::Trace) &&
102
105
  defined?(::Trace::Annotation) &&
103
106
  defined?(::Trace::BinaryAnnotation) &&
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LHC
4
- VERSION ||= '10.2.0'
4
+ VERSION ||= '10.2.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lhc
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.2.0
4
+ version: 10.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - https://github.com/local-ch/lhc/contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-15 00:00:00.000000000 Z
11
+ date: 2019-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport