in lib/aws-xray-sdk/sampling/sampling_rule.rb [34:57]
def applies?(sampling_req)
return false if sampling_req.nil? || sampling_req.empty?
host = sampling_req[:host]
http_method = sampling_req[:http_method]
url_path = sampling_req[:url_path]
service = sampling_req[:service]
host_match = !host || SearchPattern.wildcard_match?(pattern: @host, text: host)
path_match = !url_path || SearchPattern.wildcard_match?(pattern: @path, text: url_path)
method_match = !http_method || SearchPattern.wildcard_match?(pattern: @method, text: http_method)
service_match = !service || SearchPattern.wildcard_match?(pattern: @service, text: service)
if sampling_req.key?(:service_type)
service_type = sampling_req[:service_type]
service_type_match = SearchPattern.wildcard_match?(pattern: @service_type, text: service_type)
else
service_type_match = @service_type == '*'
end
host_match && path_match && method_match && service_match && service_type_match
end