aws-xray 0.37.0 → 0.37.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
  SHA1:
3
- metadata.gz: 70c0c92edb0c36053747d206937c7680085fcca7
4
- data.tar.gz: 91debde7d3a0e42b5e41a8cc8acd371b1ec4a57e
3
+ metadata.gz: af7b77e24f5f52985838b57d93790ac4e070ef16
4
+ data.tar.gz: 3698224665b0676507b3e6c60e2bd09ab99b5cb5
5
5
  SHA512:
6
- metadata.gz: c327317839ca9a2a602f32717dd409b652ce0e00b21011a45faca2d56a753d3f32604993b85e54fb6110cb41e561aca0d266faf29fb3a68d1744d96f9d090727
7
- data.tar.gz: 07bd95bf600341d8faaed5f7d8da5217e7365a26e1bef35d416b43e7d118b50dad7533971a347773e3f7ca88c4d30b76e1ca7847fd283d208c814519990a79aa
6
+ metadata.gz: 0e49d7f911912787e94dfba13a260a64ec2bfc31bdbb4f4fd50de666871dec086affdf43936694e774f716437670d42e98fad89fcfb1bf281c10dffd052a844f
7
+ data.tar.gz: dfd2ae23e980676923521a0049ce7e49e6d78bda17aa1e11cf2dac2d33fbd939bf8eb7c942323e745532afff632d6e1f0a821acb959b8600db216294d784d13e
data/bump ADDED
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env ruby
2
+ level = ARGV.first
3
+ if level.nil?
4
+ warn "Example: #{__FILE__} (tiny|minor|major)"
5
+ exit 1
6
+ end
7
+
8
+ path = 'lib/aws/xray/version.rb'
9
+ regexp = /VERSION = '(.+)'.freeze$/
10
+ version = File.read(path).scan(regexp)[0][0]
11
+ version_strs = version.split('.')
12
+
13
+ if version_strs.size > 3
14
+ warn "Current version includes a prelease suffix, drop it: #{version}"
15
+ version_strs = version_strs[0..2]
16
+ end
17
+
18
+ case level
19
+ when 'tiny'
20
+ version_strs[2] = version_strs[2].to_i + 1
21
+ when 'minor'
22
+ version_strs[1] = version_strs[1].to_i + 1
23
+ version_strs[2] = 0
24
+ when 'major'
25
+ version_strs[0] = version_strs[0].to_i + 1
26
+ version_strs[1] = 0
27
+ version_strs[2] = 0
28
+ else
29
+ warn "Example: #{__FILE__} (tiny|minor|major)"
30
+ exit 1
31
+ end
32
+
33
+ next_version = version_strs.join('.')
34
+ File.write(path, File.read(path).gsub(regexp, "VERSION = '#{next_version}'.freeze"))
35
+ system('git', 'add', path)
36
+ system('git', 'commit', '-m', "v#{next_version}")
@@ -80,7 +80,6 @@ module Aws
80
80
  yield base_segment
81
81
  rescue Exception => e
82
82
  base_segment.set_error(fault: true, e: e)
83
- record_traced! if @trace.sampled?
84
83
  raise e
85
84
  ensure
86
85
  base_segment.finish unless base_segment.finished?
@@ -102,7 +101,6 @@ module Aws
102
101
  yield sub
103
102
  rescue Exception => e
104
103
  sub.set_error(fault: true, e: e)
105
- record_traced! if @trace.sampled?
106
104
  raise e
107
105
  ensure
108
106
  sub.finish unless sub.finished?
@@ -152,13 +150,6 @@ module Aws
152
150
  @subsegment_name = nil
153
151
  name
154
152
  end
155
-
156
- def record_traced!
157
- ::Raven.tags_context(traced: '1') if defined?(::Raven)
158
- rescue => e
159
- Aws::Xray.config.logger.error("#{e.message}\n#{e.backtrace.join("\n")}")
160
- # Ignore the error
161
- end
162
153
  end
163
154
  end
164
155
  end
@@ -25,6 +25,7 @@ module Aws
25
25
  trace = build_trace(env[TRACE_ENV])
26
26
  env[ORIGINAL_TRACE_ENV] = env[TRACE_ENV] if env[TRACE_ENV] # just for the record
27
27
  env[TRACE_ENV] = trace.to_header_value
28
+ record_context!(trace)
28
29
 
29
30
  Aws::Xray.trace(name: @name, trace: trace) do |seg|
30
31
  seg.set_http_request(Request.build_from_rack_env(env))
@@ -47,6 +48,13 @@ module Aws
47
48
  def excluded_path?(path)
48
49
  !!@excluded_paths.find {|p| p === path }
49
50
  end
51
+
52
+ def record_context!(trace)
53
+ ::Raven.tags_context(xray_sampled: trace.sampled? ? '1' : '0') if defined?(::Raven)
54
+ rescue => e
55
+ Aws::Xray.config.logger.error("#{e.message}\n#{e.backtrace.join("\n")}")
56
+ # Ignore the error
57
+ end
50
58
  end
51
59
  end
52
60
  end
@@ -1,5 +1,5 @@
1
1
  module Aws
2
2
  module Xray
3
- VERSION = '0.37.0'
3
+ VERSION = '0.37.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-xray
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.37.0
4
+ version: 0.37.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taiki Ono
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-26 00:00:00.000000000 Z
11
+ date: 2017-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -254,6 +254,7 @@ files:
254
254
  - aws-xray.gemspec
255
255
  - bin/console
256
256
  - bin/setup
257
+ - bump
257
258
  - example/Gemfile
258
259
  - example/Procfile
259
260
  - example/README.md
@@ -291,7 +292,6 @@ files:
291
292
  - lib/aws/xray/version.rb
292
293
  - lib/aws/xray/version_detector.rb
293
294
  - lib/aws/xray/worker.rb
294
- - prepare_release.rb
295
295
  homepage: https://github.com/taiki45/aws-xray
296
296
  licenses:
297
297
  - MIT
@@ -312,7 +312,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
312
312
  version: '0'
313
313
  requirements: []
314
314
  rubyforge_project:
315
- rubygems_version: 2.6.13
315
+ rubygems_version: 2.5.2.1
316
316
  signing_key:
317
317
  specification_version: 4
318
318
  summary: The unofficial X-Ray Tracing SDK for Ruby.
@@ -1,11 +0,0 @@
1
- after = ARGV.first
2
- if after.nil?
3
- $stderr.puts "Example: ruby #{__FILE__} v0.6.0"
4
- exit 1
5
- end
6
-
7
- path = 'lib/aws/xray/version.rb'
8
- version_str = after.gsub('v', '')
9
- File.write(path, File.read(path).gsub(/VERSION = '.+'$/, "VERSION = '#{version_str}'"))
10
- system('git', 'add', path)
11
- system('git', 'commit', '-m', after)