bc-lightstep-ruby 1.6.2 → 1.6.3

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: ccfa4a90c7eeb3fc2da14b4b87e2f52e88019a4dbe982d4bb45e754f61f74a05
4
- data.tar.gz: b6d738f2a70da084fd058567e122733dfb75f09e694bc7632892c8cf14d3da33
3
+ metadata.gz: ca2346b27774fd1f2a8429ea57c36d0a0d182d79a1ccad116e1fe4fc6e165ab6
4
+ data.tar.gz: 98984a6f2c4724c7d2a3501e9bca87c139d8f6bcaed42a6aac7f5e52805ce2a6
5
5
  SHA512:
6
- metadata.gz: ee804422af4f4ed6d5dbd3691a6addf2b204e2c91a3c7e43713956e6ca819d199db43347fae1639fc8d0ea3608b7720cbe6f2e94a88345dc253c76e56c987452
7
- data.tar.gz: '029241ef612688bc480d8d040c3bb697d836b7ccd4a095b6355b25c4849810e31e49c737941085e596965057283233e27dd1a5a70d990999757ae8985ebf7014'
6
+ metadata.gz: dda3505bfa75067453146759ee0c855ee1370a6425bb7409715b894bb8545f25995114167bc4c7a667671e964900c7d01a53fe78f39e226f1cc01bf76171c67c
7
+ data.tar.gz: 7c58372609942e677c2ee6dc97b22a0dd917992f3aec27791950e7df43e7d2bb479a35b9dd63c53a7d42aef4a35e22f88a2d088324c24368895ea1feeb0e53fa
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@ Changelog for the bc-lightstep-ruby gem.
2
2
 
3
3
  h3. Pending Release
4
4
 
5
+ h3. 1.6.3
6
+
7
+ - Add service.version to tags
8
+
5
9
  h3. 1.6.2
6
10
 
7
11
  - Add span.kind tags to boundary spans
@@ -43,9 +43,12 @@ module Bigcommerce
43
43
  component_name ||= ::Bigcommerce::Lightstep.component_name
44
44
  transport_factory ||= ::Bigcommerce::Lightstep::TransportFactory.new
45
45
  ::LightStep.logger = logger
46
+ tags = {}
47
+ tags['service.version'] = ::Bigcommerce::Lightstep.release unless ::Bigcommerce::Lightstep.release.empty?
46
48
  ::LightStep.configure(
47
49
  component_name: component_name,
48
- transport: transport_factory.build
50
+ transport: transport_factory.build,
51
+ tags: tags
49
52
  )
50
53
  ::LightStep.instance.max_span_records = ::Bigcommerce::Lightstep.max_buffered_spans
51
54
  ::LightStep.instance.max_log_records = ::Bigcommerce::Lightstep.max_log_records
@@ -113,13 +113,34 @@ module Bigcommerce
113
113
  ##
114
114
  # Automatically determine environment
115
115
  #
116
+ # @return [String]
117
+ #
116
118
  def environment
117
119
  if defined?(Rails)
118
120
  Rails.env
119
121
  else
120
- ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'development'
122
+ env['RACK_ENV'] || env['RAILS_ENV'] || 'development'
121
123
  end
122
124
  end
125
+
126
+ ##
127
+ # @return [String]
128
+ #
129
+ def release
130
+ unless @release
131
+ app_name = env.fetch('LIGHTSTEP_APP_NAME', env.fetch('NOMAD_JOB_NAME', '')).to_s
132
+ sha = env.fetch('LIGHTSTEP_RELEASE_SHA', env.fetch('NOMAD_META_RELEASE_SHA', '')).to_s
133
+ default_release = app_name.empty? && sha.empty? ? '' : "#{app_name}@#{sha}"
134
+ @release = env.fetch('LIGHTSTEP_RELEASE', default_release).to_s
135
+ end
136
+ @release
137
+ end
138
+
139
+ private
140
+
141
+ def env
142
+ ENV
143
+ end
123
144
  end
124
145
  end
125
146
  end
@@ -17,6 +17,6 @@
17
17
  #
18
18
  module Bigcommerce
19
19
  module Lightstep
20
- VERSION = '1.6.2'
20
+ VERSION = '1.6.3'
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: 1.6.2
4
+ version: 1.6.3
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-08-26 00:00:00.000000000 Z
11
+ date: 2019-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler