aws-xray 0.30.1 → 0.31.0
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/README.md +1 -1
- data/aws-xray.gemspec +1 -0
- data/lib/aws/xray.rb +1 -1
- data/lib/aws/xray/context.rb +4 -2
- data/lib/aws/xray/faraday.rb +1 -1
- data/lib/aws/xray/hooks/net_http.rb +1 -1
- data/lib/aws/xray/rack.rb +1 -1
- data/lib/aws/xray/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec204a6182574fe431e244db52a75dfdde4ff3d4
|
4
|
+
data.tar.gz: 2cc7a2963eceb3eb50a2d36d0f41128df1d8b70c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7c5c8e2ad818a848e0adabd9386a1c4a355896d364eacbc5ede702aad07ea4b2e4787eb737a0bc19b7b372f460be24681ba0ee4c805e5347530f402ffcbde51
|
7
|
+
data.tar.gz: 4ad68d2b3e93166a27a766749ac90ad6289503462b6ccac2b67c62867de2184d29f3dd8d0b879f79c171aacc5c9d35c5283e3d2f1a69a198c557dd62f07374ab
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
Only breaking or notable changes.
|
3
3
|
|
4
|
+
## v0.31.0
|
5
|
+
- Rename tracing methods while keeping old methods:
|
6
|
+
- `#base_trace` -> `#start_segment`
|
7
|
+
- `#child_trace` -> `#start_subsegment`
|
8
|
+
|
4
9
|
## v0.30.0
|
5
10
|
- Drop faraday dependency. Users who want to use Faraday middleware must require `aws/xray/faraday`.
|
data/README.md
CHANGED
@@ -87,7 +87,7 @@ end
|
|
87
87
|
Aws::Xray.trace(name: 'my-app-batch') do |seg|
|
88
88
|
client.get('/foo')
|
89
89
|
|
90
|
-
Aws::Xray::Context.current.
|
90
|
+
Aws::Xray::Context.current.start_subsegment(name: 'fetch-user', remote: true) do |sub|
|
91
91
|
# DB access or something to trace.
|
92
92
|
end
|
93
93
|
end
|
data/aws-xray.gemspec
CHANGED
data/lib/aws/xray.rb
CHANGED
data/lib/aws/xray/context.rb
CHANGED
@@ -74,7 +74,7 @@ module Aws
|
|
74
74
|
#
|
75
75
|
# @yield [Aws::Xray::Segment]
|
76
76
|
# @return [Object] A value which given block returns.
|
77
|
-
def
|
77
|
+
def start_segment
|
78
78
|
base_segment = Segment.build(@name, @trace)
|
79
79
|
@base_segment_id = base_segment.id
|
80
80
|
|
@@ -88,12 +88,13 @@ module Aws
|
|
88
88
|
Client.send_segment(base_segment) if @trace.sampled?
|
89
89
|
end
|
90
90
|
end
|
91
|
+
alias_method :base_trace, :start_segment
|
91
92
|
|
92
93
|
# @param [Boolean] remote
|
93
94
|
# @param [String] name Arbitrary name of the sub segment. e.g. "funccall_f".
|
94
95
|
# @yield [Aws::Xray::Subsegment]
|
95
96
|
# @return [Object] A value which given block returns.
|
96
|
-
def
|
97
|
+
def start_subsegment(remote:, name:)
|
97
98
|
raise SegmentDidNotStartError unless @base_segment_id
|
98
99
|
sub = Subsegment.build(@trace, @base_segment_id, remote: remote, name: overwrite_name(name))
|
99
100
|
|
@@ -107,6 +108,7 @@ module Aws
|
|
107
108
|
Client.send_segment(sub) if @trace.sampled?
|
108
109
|
end
|
109
110
|
end
|
111
|
+
alias_method :child_trace, :start_subsegment
|
110
112
|
|
111
113
|
# Temporary disabling tracing for given id in given block.
|
112
114
|
# CAUTION: the disabling will NOT be propagated between threads!!
|
data/lib/aws/xray/faraday.rb
CHANGED
@@ -17,7 +17,7 @@ module Aws
|
|
17
17
|
|
18
18
|
name = @name || req_env.request_headers['Host'] || "unknown-request-from-#{Context.current.name}"
|
19
19
|
|
20
|
-
Context.current.
|
20
|
+
Context.current.start_subsegment(remote: true, name: name) do |sub|
|
21
21
|
propagate_trace = sub.generate_trace
|
22
22
|
req_env.request_headers[TRACE_HEADER] = propagate_trace.to_header_value
|
23
23
|
sub.set_http_request(Request.build_from_faraday_env(req_env))
|
@@ -22,7 +22,7 @@ module Aws
|
|
22
22
|
user_agent: req['User-Agent'],
|
23
23
|
)
|
24
24
|
name = req[NAME_HEADER] || req['Host'] || address
|
25
|
-
Context.current.
|
25
|
+
Context.current.start_subsegment(remote: true, name: name) do |sub|
|
26
26
|
propagate_trace = sub.generate_trace
|
27
27
|
req[TRACE_HEADER] = propagate_trace.to_header_value
|
28
28
|
sub.set_http_request(request_record)
|
data/lib/aws/xray/rack.rb
CHANGED
@@ -27,7 +27,7 @@ module Aws
|
|
27
27
|
env[TRACE_ENV] = trace.to_header_value
|
28
28
|
|
29
29
|
Context.with_new_context(@name, trace) do
|
30
|
-
Context.current.
|
30
|
+
Context.current.start_segment do |seg|
|
31
31
|
seg.set_http_request(Request.build_from_rack_env(env))
|
32
32
|
status, headers, body = @app.call(env)
|
33
33
|
length = headers['Content-Length'] || 0
|
data/lib/aws/xray/version.rb
CHANGED
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.
|
4
|
+
version: 0.31.0
|
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-06-
|
11
|
+
date: 2017-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -164,6 +164,20 @@ dependencies:
|
|
164
164
|
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: simplecov
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
167
181
|
- !ruby/object:Gem::Dependency
|
168
182
|
name: webmock
|
169
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -252,7 +266,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
252
266
|
version: '0'
|
253
267
|
requirements: []
|
254
268
|
rubyforge_project:
|
255
|
-
rubygems_version: 2.
|
269
|
+
rubygems_version: 2.6.11
|
256
270
|
signing_key:
|
257
271
|
specification_version: 4
|
258
272
|
summary: The unofficial X-Ray Tracing SDK for Ruby.
|