Module: NewRelic::Security::Instrumentation::NetLDAP::Chain

Defined in:
lib/newrelic_security/instrumentation-security/net_ldap/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/net_ldap/chain.rb', line 5

def self.instrument!
  ::Net::LDAP.class_eval do
    include NewRelic::Security::Instrumentation::NetLDAP

    alias_method :search_without_security, :search
  
    def search(args = {}, &block)
      retval = nil
      event = search_on_enter(args) { retval = search_without_security(args, &block) }
      search_on_exit(event) { return retval }
    end
  end
end