aws-xray-sdk 0.11.1 → 0.11.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/aws-xray-sdk/configuration.rb +1 -1
- data/lib/aws-xray-sdk/context/default_context.rb +1 -1
- data/lib/aws-xray-sdk/facets/helper.rb +1 -6
- data/lib/aws-xray-sdk/facets/rack.rb +2 -0
- data/lib/aws-xray-sdk/facets/resources/aws_params_whitelist.rb +9 -0
- data/lib/aws-xray-sdk/facets/resources/aws_services_whitelist.rb +1 -1
- data/lib/aws-xray-sdk/model/entity.rb +3 -1
- data/lib/aws-xray-sdk/model/metadata.rb +5 -1
- data/lib/aws-xray-sdk/model/trace_header.rb +16 -3
- data/lib/aws-xray-sdk/sampling/local/sampler.rb +1 -1
- data/lib/aws-xray-sdk/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 12bf7fe4479fe58271466a730e04d20a38d125aa
|
4
|
+
data.tar.gz: bd3f3df33fd65ea9f82aa5579316dd8d526d75e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f515f1e1016a02f04ad8fee38848fd95ed432dad394befc512781cd66d7c26b6bd0191c0a7895f1bc98cd5c864722fe01ed93b536d56557e167c94a81233ff80
|
7
|
+
data.tar.gz: 9527449a4c4aaccb8496bc6ff5d764609a287d986144538f3821576c44989bee3b8982387f1d9afab8d0663c09618c2f0e202c2abbb0343563c918fb2beba690
|
@@ -42,7 +42,7 @@ module XRay
|
|
42
42
|
# setting daemon address for components communicate with X-Ray daemon.
|
43
43
|
def daemon_address=(v)
|
44
44
|
v = ENV[DaemonConfig::DAEMON_ADDRESS_KEY] || v
|
45
|
-
config = DaemonConfig.new(v)
|
45
|
+
config = DaemonConfig.new(addr: v)
|
46
46
|
emitter.daemon_config = config
|
47
47
|
sampler.daemon_config = config if sampler.respond_to?(:daemon_config=)
|
48
48
|
end
|
@@ -12,7 +12,7 @@ module XRay
|
|
12
12
|
|
13
13
|
LOCAL_KEY = '_aws_xray_entity'.freeze
|
14
14
|
CONTEXT_MISSING_KEY = 'AWS_XRAY_CONTEXT_MISSING'.freeze
|
15
|
-
SUPPORTED_STRATEGY = %w[RUNTIME_ERROR LOG_ERROR].freeze
|
15
|
+
SUPPORTED_STRATEGY = %w[RUNTIME_ERROR LOG_ERROR IGNORE_ERROR].freeze
|
16
16
|
DEFAULT_STRATEGY = SUPPORTED_STRATEGY[0]
|
17
17
|
|
18
18
|
attr_reader :context_missing
|
@@ -42,12 +42,7 @@ module XRay
|
|
42
42
|
|
43
43
|
# Prepares a X-Ray header string based on the provided Segment/Subsegment.
|
44
44
|
def prep_header_str(entity:)
|
45
|
-
|
46
|
-
root = entity.segment.trace_id
|
47
|
-
parent_id = entity.id
|
48
|
-
sampled = entity.sampled ? 1 : 0
|
49
|
-
header = TraceHeader.new root: root, parent_id: parent_id, sampled: sampled
|
50
|
-
header.header_string
|
45
|
+
TraceHeader.from_entity(entity: entity).header_string
|
51
46
|
end
|
52
47
|
end
|
53
48
|
end
|
@@ -49,6 +49,8 @@ module XRay
|
|
49
49
|
resp_meta[:content_length] = len
|
50
50
|
end
|
51
51
|
segment.merge_http_response response: resp_meta
|
52
|
+
trace_header = {TRACE_HEADER => TraceHeader.from_entity(entity: segment).root_string}
|
53
|
+
headers.merge!(trace_header)
|
52
54
|
[status, headers, body]
|
53
55
|
rescue Exception => e
|
54
56
|
segment.apply_status_code status: 500
|
@@ -143,7 +143,9 @@ module XRay
|
|
143
143
|
else
|
144
144
|
h[:in_progress] = true
|
145
145
|
end
|
146
|
-
|
146
|
+
|
147
|
+
h[:subsegments] = subsegments.map(&:to_h) unless subsegments.empty?
|
148
|
+
|
147
149
|
h[:aws] = aws if aws
|
148
150
|
if http_request || http_response
|
149
151
|
h[:http] = {}
|
@@ -18,6 +18,14 @@ module XRay
|
|
18
18
|
@sampled = sampled.to_i if sampled
|
19
19
|
end
|
20
20
|
|
21
|
+
def self.from_entity(entity:)
|
22
|
+
return empty_header if entity.nil?
|
23
|
+
root = entity.segment.trace_id
|
24
|
+
parent_id = entity.id
|
25
|
+
sampled = entity.sampled ? 1 : 0
|
26
|
+
new root: root, parent_id: parent_id, sampled: sampled
|
27
|
+
end
|
28
|
+
|
21
29
|
def self.from_header_string(header_str:)
|
22
30
|
empty_header if header_str.to_s.empty?
|
23
31
|
header = header_str.delete(' ').downcase
|
@@ -35,15 +43,20 @@ module XRay
|
|
35
43
|
end
|
36
44
|
end
|
37
45
|
|
46
|
+
# @return [String] The header string of the root object
|
47
|
+
def root_string
|
48
|
+
%(Root=#{root})
|
49
|
+
end
|
50
|
+
|
38
51
|
# @return [String] The heading string constructed based on this header object.
|
39
52
|
def header_string
|
40
53
|
return '' unless root
|
41
54
|
if !parent_id
|
42
|
-
%(
|
55
|
+
%(#{root_string};Sampled=#{sampled})
|
43
56
|
elsif !sampled
|
44
|
-
%(
|
57
|
+
%(#{root_string};Parent=#{parent_id})
|
45
58
|
else
|
46
|
-
%(
|
59
|
+
%(#{root_string};Parent=#{parent_id};Sampled=#{sampled})
|
47
60
|
end
|
48
61
|
end
|
49
62
|
|
@@ -58,7 +58,7 @@ module XRay
|
|
58
58
|
return sample if sampling_req.nil? || sampling_req.empty?
|
59
59
|
@custom_rules ||= []
|
60
60
|
@custom_rules.each do |c|
|
61
|
-
return should_sample?(c) if c.applies?(sampling_req
|
61
|
+
return should_sample?(c) if c.applies?(sampling_req)
|
62
62
|
end
|
63
63
|
# use previously made decision based on default rule
|
64
64
|
# if no path-based rule has been matched
|
data/lib/aws-xray-sdk/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-xray-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amazon Web Services
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-xray
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '2.0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '2.0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: minitest
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -240,7 +240,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
240
240
|
version: '0'
|
241
241
|
requirements: []
|
242
242
|
rubyforge_project:
|
243
|
-
rubygems_version: 2.
|
243
|
+
rubygems_version: 2.6.14
|
244
244
|
signing_key:
|
245
245
|
specification_version: 4
|
246
246
|
summary: AWS X-Ray SDK for Ruby
|