Module: NewRelic::Security::Instrumentation::HTTPrb::Chain

Defined in:
lib/newrelic_security/instrumentation-security/httprb/chain.rb

Class Method Summary collapse

Class Method Details

.instrument!Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/newrelic_security/instrumentation-security/httprb/chain.rb', line 5

def self.instrument!
  ::HTTP::Client.class_eval do
    include NewRelic::Security::Instrumentation::HTTPrb
                
    alias_method :perform_without_security, :perform
  
    def perform(request, options)
      retval = nil
      event = perform_on_enter(request, options) { retval = perform_without_security(request, options) }
      perform_on_exit(event) { return retval }
    end
  end
end