bc-lightstep-ruby 1.1.7 → 1.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/bigcommerce/lightstep/tracer.rb +17 -5
- data/lib/bigcommerce/lightstep/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cb5dab38cc9f046ed427e5ecccad6cb61349a87af82bdf5b7531e7b48058765
|
4
|
+
data.tar.gz: f55e6662e3cfec30437ff8b7357598f1fb24278340fb2e0c51ab2cb3ec573f47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1b59b7f0cfc79daaf4bb35f76970d2d1b7fe9eec5a96f86c043fd3dab03b597747b3f06a992172b5763ac5d9fa958a6026dece3f9d68f817aa3739feb44f574
|
7
|
+
data.tar.gz: a8d02320ac6d91ff706b0b5778ee3a35d8d39958f77007745e36d5b528d5c5b0a8fd5e7bcc85785c97456bae0b94b75dae21e9601da49c5248e5ee5137c93206
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,11 @@ Changelog for the bc-lightstep-ruby gem.
|
|
2
2
|
|
3
3
|
h3. Pending Release
|
4
4
|
|
5
|
+
h3. 1.1.8
|
6
|
+
|
7
|
+
- Handle issue that occurs if lightstep is disabled but the start_span method is still called
|
8
|
+
- Remove FORMAT_TEXT_MAP reference as this is no longer present in later lightstep gem versions
|
9
|
+
|
5
10
|
h3. 1.1.7
|
6
11
|
|
7
12
|
- Better handling of exceptions and tagged errors
|
@@ -36,13 +36,17 @@ module Bigcommerce
|
|
36
36
|
# @param [Hash] tags (Optional)
|
37
37
|
#
|
38
38
|
def start_span(name, context: nil, start_time: nil, tags: nil)
|
39
|
-
if
|
39
|
+
if enabled?
|
40
40
|
# enable the tracer (for fork support)
|
41
41
|
tracer.enable
|
42
|
-
elsif tracer.enabled?
|
42
|
+
elsif tracer && tracer.enabled?
|
43
43
|
# We are not enabled and the tracer is currently on
|
44
44
|
# https://github.com/lightstep/lightstep-tracer-ruby/blob/master/lib/lightstep/tracer.rb#L129-L130
|
45
|
-
|
45
|
+
# we have to set this through instance_variable_set because of a bug in the core lightstep gem which
|
46
|
+
# assumes the presence of a reporter, which happens in the initializer, which may not be called
|
47
|
+
# because the reporter attempts to flush spans on initialization (which is bad if lightstep isn't
|
48
|
+
# present)
|
49
|
+
tracer.instance_variable_set(:@enabled, false)
|
46
50
|
end
|
47
51
|
|
48
52
|
# find the currently active span
|
@@ -65,7 +69,7 @@ module Bigcommerce
|
|
65
69
|
raise
|
66
70
|
ensure
|
67
71
|
# finish this span if the reporter is initialized
|
68
|
-
span.finish if reporter_initialized?
|
72
|
+
span.finish if enabled? && reporter_initialized?
|
69
73
|
|
70
74
|
# now set back the parent as the active span
|
71
75
|
self.active_span = last_active_span
|
@@ -98,6 +102,13 @@ module Bigcommerce
|
|
98
102
|
tracer.instance_variable_defined?(:@reporter) && !tracer.instance_variable_get(:@reporter).nil?
|
99
103
|
end
|
100
104
|
|
105
|
+
##
|
106
|
+
# @return [Boolean]
|
107
|
+
#
|
108
|
+
def enabled?
|
109
|
+
Bigcommerce::Lightstep.enabled
|
110
|
+
end
|
111
|
+
|
101
112
|
private
|
102
113
|
|
103
114
|
##
|
@@ -108,7 +119,8 @@ module Bigcommerce
|
|
108
119
|
#
|
109
120
|
def determine_parent(context:)
|
110
121
|
# first attempt to find parent from args, if not, use carrier (headers) to lookup parent
|
111
|
-
|
122
|
+
# 1 = FORMAT_TEXT_MAP (this constant is removed in future lightstep versions)
|
123
|
+
current_parent = context.is_a?(::LightStep::SpanContext) ? context : tracer.extract(1, context || {})
|
112
124
|
# if no passed in parent, use the active thread parent
|
113
125
|
current_parent = active_span if current_parent.nil?
|
114
126
|
current_parent
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bc-lightstep-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shaun McCormick
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|