Module: TraceView::Inst::RestClientRequest

Defined in:
lib/traceview/inst/rest-client.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



7
8
9
# File 'lib/traceview/inst/rest-client.rb', line 7

def self.included(klass)
  ::TraceView::Util.method_alias(klass, :execute, ::RestClient::Request)
end

Instance Method Details

#execute_with_traceview(&block) ⇒ Object

execute_with_traceview

The wrapper method for RestClient::Request.execute



16
17
18
19
20
21
22
23
24
25
26
27
28
# 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