6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/app_perf_rpm/instruments/rack.rb', line 6
def call(env)
req = ::Rack::Request.new(env)
span = AppPerfRpm.tracer.start_span("rack")
span.set_tag "type", "web"
span.set_tag "domain", req.host
span.set_tag "url", req.path
span.set_tag "class", @app.class.name
span.set_tag "backtrace", ::AppPerfRpm::Backtrace.backtrace
span.set_tag "source", ::AppPerfRpm::Backtrace.
@app.call(env)
rescue Exception => e
if span
span.set_tag('error', true)
span.log_error(e)
end
raise
ensure
span.finish if span
end
|