Module: HTTPInstrumentation::Instrumentation::TyphoeusHook::Easy

Defined in:
lib/http_instrumentation/instrumentation/typhoeus_hook.rb

Class Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.aliasedObject

Returns the value of attribute aliased.



49
50
51
# File 'lib/http_instrumentation/instrumentation/typhoeus_hook.rb', line 49

def aliased
  @aliased
end

Instance Method Details

#run(*args) ⇒ Object



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/http_instrumentation/instrumentation/typhoeus_hook.rb', line 52

def run(*args)
  HTTPInstrumentation.instrument("typhoeus") do |payload|
    retval = if HTTPInstrumentation::Instrumentation::TyphoeusHook::Easy.aliased
      run_without_http_instrumentation(*args)
    else
      super
    end

    begin
      payload[:http_method] = options[:method]
      payload[:url] = url
      payload[:status_code] = response&.response_code
    rescue
    end

    retval
  end
end