Sha256: d5ea7809cc927844bca5fe8eb5aa23242e51a5ea19dd32d774a448bee420bf41

Contents?: true

Size: 1.01 KB

Versions: 8

Compression:

Stored size: 1.01 KB

Contents

# Copyright (c) 2015 AppNeta, Inc.
# All rights reserved.

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

      ##
      # execute_with_oboe
      #
      # The wrapper method for RestClient::Request.execute
      #
      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
    end
  end
end

if Oboe::Config[:rest_client][:enabled]
  if defined?(::RestClient)
    Oboe.logger.info '[oboe/loading] Instrumenting rest-client' if Oboe::Config[:verbose]
    ::Oboe::Util.send_include(::RestClient::Request, ::Oboe::Inst::RestClientRequest)
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
oboe-2.7.19-java lib/oboe/inst/rest-client.rb
oboe-2.7.19 lib/oboe/inst/rest-client.rb
oboe-2.7.18-java lib/oboe/inst/rest-client.rb
oboe-2.7.18 lib/oboe/inst/rest-client.rb
oboe-2.7.17.1-java lib/oboe/inst/rest-client.rb
oboe-2.7.17.1 lib/oboe/inst/rest-client.rb
oboe-2.7.16.1 lib/oboe/inst/rest-client.rb
oboe-2.7.16.1-java lib/oboe/inst/rest-client.rb