Module: Oboe::Inst::RestClientRequest

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



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

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

Instance Method Details

#execute_with_oboe(&block) ⇒ Object

execute_with_oboe

The wrapper method for RestClient::Request.execute



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/oboe/inst/rest-client.rb', line 16

def execute_with_oboe & block
  kvs = {}
  kvs['Backtrace'] = Oboe::API.backtrace if Oboe::Config[:rest_client][:collect_backtraces]
  Oboe::API.log_entry("rest-client", kvs)

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