Module: AppPerfRpm::Instruments::TyphoeusRequest

Defined in:
lib/app_perf_rpm/instruments/typhoeus.rb

Instance Method Summary collapse

Instance Method Details

#run_with_traceObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/app_perf_rpm/instruments/typhoeus.rb', line 4

def run_with_trace
  if ::AppPerfRpm.tracing?
    span = ::AppPerfRpm::Tracer.start_span("typhoeus")
    response = run_without_trace
    span.finish

    uri = URI(response.effective_url)

    span.options = {
      "http_status" => response.code,
      "remote_url" => uri.to_s,
      "http_method" => options[:method]
    }
    span.submit(opts)

    response
  else
    run_without_trace
  end
end