Module: HTTPInstrumentation::Instrumentation::EthonHook::Easy

Defined in:
lib/http_instrumentation/instrumentation/ethon_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/ethon_hook.rb', line 49

def aliased
  @aliased
end

Instance Method Details

#http_request(url, action_name, *args) ⇒ Object



52
53
54
55
56
57
58
59
60
# File 'lib/http_instrumentation/instrumentation/ethon_hook.rb', line 52

def http_request(url, action_name, *args)
  @http_instrumentation_method = action_name
  @http_instrumentation_url = url
  if HTTPInstrumentation::Instrumentation::EthonHook::Easy.aliased
    http_request_without_http_instrumentation(url, action_name, *args)
  else
    super
  end
end

#perform(*args) ⇒ Object



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/http_instrumentation/instrumentation/ethon_hook.rb', line 62

def perform(*args)
  HTTPInstrumentation.instrument("ethon") do |payload|
    retval = if HTTPInstrumentation::Instrumentation::EthonHook::Easy.aliased
      perform_without_http_instrumentation(*args)
    else
      super
    end

    payload[:http_method] = @http_instrumentation_method
    payload[:url] = @http_instrumentation_url
    begin
      payload[:status_code] = response_code
    rescue
    end

    retval
  end
end