Skip to content

Commit 5134f20

Browse files
authored
Merge pull request #18 from sunfuze/master
fix: custom daemon addres raise error
2 parents 24b478e + 28e0cb8 commit 5134f20

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

lib/aws-xray-sdk/configuration.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def name=(v)
4242
# setting daemon address for components communicate with X-Ray daemon.
4343
def daemon_address=(v)
4444
v = ENV[DaemonConfig::DAEMON_ADDRESS_KEY] || v
45-
config = DaemonConfig.new(v)
45+
config = DaemonConfig.new(addr: v)
4646
emitter.daemon_config = config
4747
sampler.daemon_config = config if sampler.respond_to?(:daemon_config=)
4848
end

lib/aws-xray-sdk/context/default_context.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class DefaultContext
1212

1313
LOCAL_KEY = '_aws_xray_entity'.freeze
1414
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
1616
DEFAULT_STRATEGY = SUPPORTED_STRATEGY[0]
1717

1818
attr_reader :context_missing

lib/aws-xray-sdk/model/entity.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,9 @@ def to_h
143143
else
144144
h[:in_progress] = true
145145
end
146-
h[:subsegments] = subsegments unless subsegments.empty?
146+
147+
h[:subsegments] = subsegments.map(&:to_h) unless subsegments.empty?
148+
147149
h[:aws] = aws if aws
148150
if http_request || http_response
149151
h[:http] = {}

lib/aws-xray-sdk/model/metadata.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ def sub_meta(namespace)
1717
end
1818

1919
def to_h
20-
@data
20+
@data.keys.each_with_object({}) do |key, h|
21+
h[key] = @data[key].to_h
22+
h
23+
end
24+
2125
end
2226
end
2327

lib/aws-xray-sdk/sampling/local/sampler.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def sample_request?(sampling_req)
5858
return sample if sampling_req.nil? || sampling_req.empty?
5959
@custom_rules ||= []
6060
@custom_rules.each do |c|
61-
return should_sample?(c) if c.applies?(sampling_req: sampling_req)
61+
return should_sample?(c) if c.applies?(sampling_req)
6262
end
6363
# use previously made decision based on default rule
6464
# if no path-based rule has been matched

0 commit comments

Comments
 (0)