class Excon::Connection

Public Class Methods

install_tingyun_instrumentation() click to toggle source
# File lib/ting_yun/instrumentation/excon.rb, line 74
def self.install_tingyun_instrumentation
  alias request_without_tingyun_trace request
  alias request request_with_tingyun_trace
end

Public Instance Methods

request_with_tingyun_trace(params, &block) click to toggle source
# File lib/ting_yun/instrumentation/excon.rb, line 63
def request_with_tingyun_trace(params, &block)
  orig_response = nil
  resolved_params = tingyun_resolved_request_params(params)
  wrapped_request = ::TingYun::Http::ExconHTTPRequest.new(resolved_params)
  ::TingYun::Agent::CrossAppTracing.trace_http_request(wrapped_request) do
    orig_response = request_without_tingyun_trace(resolved_params, &block)
    ::TingYun::Http::ExconHTTPResponse.new(orig_response)
  end
  orig_response
end
tingyun_connection_params() click to toggle source
# File lib/ting_yun/instrumentation/excon.rb, line 53
def tingyun_connection_params
  (@connection || @data)
end
tingyun_resolved_request_params(request_params) click to toggle source
# File lib/ting_yun/instrumentation/excon.rb, line 57
def tingyun_resolved_request_params(request_params)
  resolved = tingyun_connection_params.merge(request_params)
  resolved[:headers] = resolved[:headers].merge(request_params[:headers] || {})
  resolved
end