31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
# File 'lib/oboe/inst/em-http-request.rb', line 31
def (*args, &block)
report_kvs = {}
xtrace = nil
blacklisted = Oboe::API.blacklisted?(@uri)
begin
report_kvs[:HTTPStatus] = args[2]
report_kvs[:Async] = 1
rescue => e
Oboe.logger.debug "[oboe/debug] em-http-request KV error: #{e.inspect}"
end
(*args, &block)
unless blacklisted
= args[0]
context = Oboe::Context.toString
task_id = Oboe::XTrace.task_id(context)
if .is_a?(Hash) && .key?('X-Trace')
xtrace = ['X-Trace']
end
if Oboe::XTrace.valid?(xtrace) && Oboe.tracing?
if task_id == Oboe::XTrace.task_id(xtrace)
Oboe::Context.fromString(xtrace)
else
Oboe.logger.debug "Mismatched returned X-Trace ID : #{xtrace}"
end
end
end
::Oboe::API.log_exit('em-http-request', report_kvs)
end
|