module TraceView::Inst::RestClientRequest

Public Class Methods

included(klass) click to toggle source
# File lib/traceview/inst/rest-client.rb, line 7
def self.included(klass)
  ::TraceView::Util.method_alias(klass, :execute, ::RestClient::Request)
end

Public Instance Methods

execute_with_traceview(& block) click to toggle source

execute_with_traceview

The wrapper method for RestClient::Request.execute

# File lib/traceview/inst/rest-client.rb, line 16
def execute_with_traceview & block
  kvs = {}
  kvs[:Backtrace] = TraceView::API.backtrace if TraceView::Config[:rest_client][:collect_backtraces]
  TraceView::API.log_entry(:'rest-client', kvs)

  # The core rest-client call
  execute_without_traceview(&block)
rescue => e
  TraceView::API.log_exception(:'rest-client', e)
  raise e
ensure
  TraceView::API.log_exit(:'rest-client')
end