def do_get_block_with_newrelic(req, proxy, conn, &block)
wrapped_request = NewRelic::Agent::HTTPClients::HTTPClientRequest.new(req)
segment = NewRelic::Agent::Transaction.start_external_request_segment(
wrapped_request.type, wrapped_request.uri, wrapped_request.method)
begin
response = nil
segment.add_request_headers wrapped_request
do_get_block_without_newrelic(req, proxy, conn, &block)
response = conn.pop
conn.push response
wrapped_response = ::NewRelic::Agent::HTTPClients::HTTPClientResponse.new(response)
segment.read_response_headers wrapped_response
response
ensure
segment.finish
end
end