Sha256: 339d5c0352482897de282bb6385fffbbce78fb8da33450062a7755d4333e662d
Contents?: true
Size: 1004 Bytes
Versions: 16
Compression:
Stored size: 1004 Bytes
Contents
module Instana module Instrumentation module RestClientRequest def self.included(klass) if klass.method_defined?(:execute) klass.class_eval do alias execute_without_instana execute alias execute execute_with_instana end end end def execute_with_instana & block # Since RestClient uses net/http under the covers, we just # provide span visibility here. HTTP related KVs are reported # in the Net::HTTP instrumentation ::Instana.tracer.log_entry(:'rest-client') execute_without_instana(&block) rescue => e ::Instana.tracer.log_error(e) raise ensure ::Instana.tracer.log_exit(:'rest-client') end end end end if defined?(::RestClient::Request) && ::Instana.config[:'rest-client'][:enabled] ::Instana.logger.warn "Instrumenting RestClient" ::RestClient::Request.send(:include, ::Instana::Instrumentation::RestClientRequest) end
Version data entries
16 entries across 16 versions & 1 rubygems