bc-lightstep-ruby 1.3.3 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 343f17b3edc68376d9f44b423a260f228b645eec
4
- data.tar.gz: 8ff858f66134f12d4dc6d11656be70ed649904d3
2
+ SHA256:
3
+ metadata.gz: 75614155acef737a30e80669b9decb41b2289f18f1519c049732bcdb78f034d4
4
+ data.tar.gz: 4b937baecd5fdb865b462a5a5ff92d30f9f88e4f1c9f555c994c5c61fdcec76d
5
5
  SHA512:
6
- metadata.gz: b23a35a2914161eb3a9401d719eac7e011645a9ae3e3959c39d64d12e09d07aab8cd6383dd9df36d1d7c3eb1de1da52e1987fb3df88de3822e4ce80b16d1cd5b
7
- data.tar.gz: ad1e1ae8ee6f4f053101e977c80d1c0b58fa56be035b74296d6f9e203e21e2bc4e411a57d3a141f1b24e309c6ee146ac7363d6287c65930df14bd99126f5ef09
6
+ metadata.gz: d1e310ce0281e96dc8bdbe176cbf88a1d43067e90313f53933e163cc5bf53c30cc1275b27b8f3eede24de85d5c834e888a9e399d5ef344869ba44176face4373
7
+ data.tar.gz: d64dc9e30cddbc9dd9e0bedb56d738738f1a709b21e9e26190ea530114eae9748310738e07238e796b2a8c5bd69c24c6fe3e53e204512b06a3ce1201c354f640
@@ -2,6 +2,11 @@ Changelog for the bc-lightstep-ruby gem.
2
2
 
3
3
  h3. Pending Release
4
4
 
5
+ h3. 1.4.0
6
+
7
+ - Add `frozen_string_literal: true` to all files
8
+ - Deprecate ruby 2.2 support
9
+
5
10
  h3. 1.3.3
6
11
 
7
12
  - Updates gemspec to allow for newer Faraday versions
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # bc-lightstep-ruby - LightStep distributed tracing
2
2
 
3
- [![Build Status](https://travis-ci.com/bigcommerce/bc-lightstep-ruby.svg?token=D3Cc4LCF9BgpUx4dpPpv&branch=master)](https://travis-ci.com/bigcommerce/bc-lightstep-ruby) [![Gem Version](https://badge.fury.io/rb/bc-lightstep-ruby.svg)](https://badge.fury.io/rb/bc-lightstep-ruby) [![Inline docs](http://inch-ci.org/github/bigcommerce/bc-lightstep-ruby.svg?branch=master)](http://inch-ci.org/github/bigcommerce/bc-lightstep-ruby)
3
+ [![CircleCI](https://circleci.com/gh/bigcommerce/bc-lightstep-ruby/tree/master.svg?style=svg)](https://circleci.com/gh/bigcommerce/bc-lightstep-ruby/tree/master) [![Gem Version](https://badge.fury.io/rb/bc-lightstep-ruby.svg)](https://badge.fury.io/rb/bc-lightstep-ruby) [![Inline docs](http://inch-ci.org/github/bigcommerce/bc-lightstep-ruby.svg?branch=master)](http://inch-ci.org/github/bigcommerce/bc-lightstep-ruby)
4
4
 
5
5
  Adds [LightStep](https://lightstep.com) tracing support for Ruby. This is an extension of the
6
6
  [LightStep ruby gem](https://github.com/lightstep/lightstep-tracer-ruby) and adds extra functionality and resiliency.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (c) 2018-present, BigCommerce Pty. Ltd. All rights reserved
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (c) 2018-present, BigCommerce Pty. Ltd. All rights reserved
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -27,6 +29,7 @@ require_relative 'lightstep/redis/tracer'
27
29
 
28
30
  ##
29
31
  # Main base module
32
+ #
30
33
  module Bigcommerce
31
34
  ##
32
35
  # Lightstep module
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (c) 2018-present, BigCommerce Pty. Ltd. All rights reserved
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -38,7 +40,7 @@ module Bigcommerce
38
40
  max_buffered_spans: 1_000,
39
41
  max_log_records: 1_000,
40
42
  max_reporting_interval_seconds: 3.0,
41
- redis_excluded_commands: %w(ping),
43
+ redis_excluded_commands: %w[ping],
42
44
  redis_allow_root_spans: false,
43
45
  enabled: true
44
46
  }.freeze
@@ -103,7 +105,7 @@ module Bigcommerce
103
105
 
104
106
  self.verbosity = ENV.fetch('LIGHTSTEP_VERBOSITY', 1).to_i
105
107
  self.logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
106
- self.enabled = ENV.fetch('LIGHTSTEP_ENABLED', 1).to_i > 0
108
+ self.enabled = ENV.fetch('LIGHTSTEP_ENABLED', 1).to_i.positive?
107
109
  end
108
110
 
109
111
  ##
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (c) 2018-present, BigCommerce Pty. Ltd. All rights reserved
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (c) 2018-present, BigCommerce Pty. Ltd. All rights reserved
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -23,9 +25,9 @@ module Bigcommerce
23
25
  HTTP_STATUS_INTERNAL_ERROR = 500
24
26
  HTTP_STATUS_SERVICE_UNAVAIL = 503
25
27
 
26
- OT_TAG_TRACE_ID = 'ot-tracer-traceid'.freeze
27
- OT_TAG_SPAN_ID = 'ot-tracer-spanid'.freeze
28
- OT_TAG_SAMPLED = 'ot-tracer-sampled'.freeze
28
+ OT_TAG_TRACE_ID = 'ot-tracer-traceid'
29
+ OT_TAG_SPAN_ID = 'ot-tracer-spanid'
30
+ OT_TAG_SAMPLED = 'ot-tracer-sampled'
29
31
 
30
32
  def initialize(app, service_name = nil)
31
33
  @app = app
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Bigcommerce
2
4
  module Lightstep
3
5
  ##
@@ -29,7 +31,7 @@ module Bigcommerce
29
31
  span.set_tag('http.host', request.host)
30
32
  begin
31
33
  resp = yield
32
- rescue StandardError => _
34
+ rescue StandardError => _e
33
35
  span.set_tag('error', true)
34
36
  span.set_tag('http.status_code', Bigcommerce::Lightstep.http1_error_code)
35
37
  tracer.clear_active_span!
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (c) 2018-present, BigCommerce Pty. Ltd. All rights reserved
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -72,7 +74,7 @@ module Bigcommerce
72
74
  end
73
75
  begin
74
76
  resp = yield
75
- rescue StandardError => _
77
+ rescue StandardError => _e
76
78
  span.set_tag('error', true)
77
79
  raise # re-raise the error
78
80
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (c) 2018-present, BigCommerce Pty. Ltd. All rights reserved
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -27,7 +29,7 @@ module Bigcommerce
27
29
 
28
30
  wrap unless @wrapped
29
31
  @wrapped = true
30
- rescue ::LoadError => _
32
+ rescue ::LoadError => _e
31
33
  @wrapped = false
32
34
  # noop
33
35
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (c) 2018-present, BigCommerce Pty. Ltd. All rights reserved
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -39,7 +41,7 @@ module Bigcommerce
39
41
  if enabled?
40
42
  # enable the tracer (for fork support)
41
43
  tracer.enable
42
- elsif tracer && tracer.enabled?
44
+ elsif tracer&.enabled?
43
45
  # We are not enabled and the tracer is currently on
44
46
  # https://github.com/lightstep/lightstep-tracer-ruby/blob/master/lib/lightstep/tracer.rb#L129-L130
45
47
  # we have to set this through instance_variable_set because of a bug in the core lightstep gem which
@@ -62,6 +64,7 @@ module Bigcommerce
62
64
  self.active_span = span
63
65
 
64
66
  # run the process
67
+ result = nil
65
68
  begin
66
69
  result = yield span
67
70
  rescue StandardError
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (c) 2018-present, BigCommerce Pty. Ltd. All rights reserved
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -25,12 +27,12 @@ module Bigcommerce
25
27
  class Transport < ::LightStep::Transport::Base
26
28
  class InvalidAccessTokenError < StandardError; end
27
29
 
28
- ENCRYPTION_TLS = 'tls'.freeze
29
- ENCRYPTION_NONE = 'none'.freeze
30
- HEADER_ACCESS_TOKEN = 'LightStep-Access-Token'.freeze
31
- LIGHTSTEP_HOST = 'collector.lightstep.com'.freeze
30
+ ENCRYPTION_TLS = 'tls'
31
+ ENCRYPTION_NONE = 'none'
32
+ HEADER_ACCESS_TOKEN = 'LightStep-Access-Token'
33
+ LIGHTSTEP_HOST = 'collector.lightstep.com'
32
34
  LIGHTSTEP_PORT = 443
33
- REPORTS_API_ENDPOINT = '/api/v0/reports'.freeze
35
+ REPORTS_API_ENDPOINT = '/api/v0/reports'
34
36
 
35
37
  # Initialize the transport
36
38
  # @param host [String] host of the domain to the endpoind to push data
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (c) 2018-present, BigCommerce Pty. Ltd. All rights reserved
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright (c) 2018-present, BigCommerce Pty. Ltd. All rights reserved
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
@@ -15,6 +17,6 @@
15
17
  #
16
18
  module Bigcommerce
17
19
  module Lightstep
18
- VERSION = '1.3.3'.freeze
20
+ VERSION = '1.4.0'
19
21
  end
20
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: 1.3.3
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shaun McCormick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-27 00:00:00.000000000 Z
11
+ date: 2019-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -141,8 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
141
  - !ruby/object:Gem::Version
142
142
  version: '0'
143
143
  requirements: []
144
- rubyforge_project:
145
- rubygems_version: 2.6.12
144
+ rubygems_version: 3.0.2
146
145
  signing_key:
147
146
  specification_version: 4
148
147
  summary: Gem for lightstep distributed tracing