bc-lightstep-ruby 2.2.1 → 2.2.2

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: da452a7f373b4db3b6ee125e9b42787c4dca7e3848ef91fdbe24fc0991044b45
4
- data.tar.gz: 10eb39929ce15f3df29924becdf69afd397f52297a8f74dd1504fc67ea634e2a
3
+ metadata.gz: 4f3a1bf19d2bd647344092637b395c79889582497e7505fe88a15e54ca490f49
4
+ data.tar.gz: 3dd48770cacc6e088edcbb63e26a9da3954b5112cc840890d79df3285c73b3b0
5
5
  SHA512:
6
- metadata.gz: 4474f23f5dc1c0a7046df0cd3a748450df0c91619dedf5d123eb6ace4a5cc81884be514fbc70f62cfa4875ba3f4ebb3f59b580e8d59a7c2460d9949d68bdb476
7
- data.tar.gz: 33d96552fe76aa2e70b20ef0e35c7b532ba0baf7d3e8528fd7fceafea7132b6a13fac6fa5d6f14bb54672090ce9e1f8ecf7c5f34f0e0e30ecbd2e808ec02baf8
6
+ metadata.gz: 7d8849b91e102c4ad4cac2272368d19b8f523f3195b280f9a7007344135c436ca9f7f0e44a0a0403dc4f1ea854a5de27e001d96eb96b40498d28ce63280f3501
7
+ data.tar.gz: 4fe13e2093848bba17236988b49649fbeeba3291f4c545d0732e7b4b79182c855719dcc7363f36e39141ff895976047fb369560abaaf328c688df2b426855dba
@@ -2,6 +2,11 @@ Changelog for the bc-lightstep-ruby gem.
2
2
 
3
3
  ### Pending Release
4
4
 
5
+ ### 2.2.2
6
+
7
+ - Fix issue where parent span determination can be nil if lightstep is not initialized
8
+ - Add tests for Ruby 2.7
9
+
5
10
  ### 2.2.1
6
11
 
7
12
  - Only set error tag in exceptions if not already set
@@ -34,7 +34,6 @@ Gem::Specification.new do |spec|
34
34
  spec.required_ruby_version = '>= 2.6'
35
35
 
36
36
  spec.add_development_dependency 'activerecord', '> 4'
37
- spec.add_development_dependency 'bundler', '~> 1.11'
38
37
  spec.add_development_dependency 'bundler-audit', '~> 0.6'
39
38
  spec.add_development_dependency 'rake', '>= 12.0'
40
39
  spec.add_development_dependency 'rspec', '~> 3.8'
@@ -128,7 +128,7 @@ module Bigcommerce
128
128
  def determine_parent(context:)
129
129
  # first attempt to find parent from args, if not, use carrier (headers) to lookup parent
130
130
  # 1 = FORMAT_TEXT_MAP (this constant is removed in future lightstep versions)
131
- current_parent = context.is_a?(::LightStep::SpanContext) ? context : tracer.extract(1, context || {})
131
+ current_parent = extract_parent_from_context(context)
132
132
  # if no passed in parent, use the active thread parent
133
133
  current_parent = active_span if current_parent.nil?
134
134
  current_parent
@@ -155,6 +155,22 @@ module Bigcommerce
155
155
  def mark_root_span(span)
156
156
  span.instance_variable_set(:@root_span, true)
157
157
  end
158
+
159
+ ##
160
+ # @param [Hash|::LightStep::SpanContext] context
161
+ # @return [::LightStep::SpanContext]
162
+ # @return [NilClass]
163
+ #
164
+ def extract_parent_from_context(context)
165
+ return context if context.is_a?(::LightStep::SpanContext)
166
+
167
+ tracer.extract(1, context || {})
168
+ rescue StandardError => _e
169
+ # sometimes LightStep, when `start` is not run first, will error here. This protects this until the upstream
170
+ # library can be fixed. We essentially just want to silently no-op here, as this failing simply means there's
171
+ # no context to extract.
172
+ nil
173
+ end
158
174
  end
159
175
  end
160
176
  end
@@ -17,6 +17,6 @@
17
17
  #
18
18
  module Bigcommerce
19
19
  module Lightstep
20
- VERSION = '2.2.1'
20
+ VERSION = '2.2.2'
21
21
  end
22
22
  end
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: 2.2.1
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shaun McCormick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-29 00:00:00.000000000 Z
11
+ date: 2021-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - ">"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '4'
27
- - !ruby/object:Gem::Dependency
28
- name: bundler
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '1.11'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '1.11'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: bundler-audit
43
29
  requirement: !ruby/object:Gem::Requirement
@@ -260,7 +246,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
260
246
  - !ruby/object:Gem::Version
261
247
  version: '0'
262
248
  requirements: []
263
- rubygems_version: 3.0.6
249
+ rubygems_version: 3.2.3
264
250
  signing_key:
265
251
  specification_version: 4
266
252
  summary: Gem for lightstep distributed tracing