Sha256: f04ba25ff99bd2512a787619c3d6faa60b3319c48a40d42337f281f65565805b
Contents?: true
Size: 1.21 KB
Versions: 39
Compression:
Stored size: 1.21 KB
Contents
# encoding: utf-8 LibraryDetection.defer do @name = :active_merchant depends_on do defined?(ActiveMerchant) && defined?(ActiveMerchant::Billing) && defined?(ActiveMerchant::Billing::Gateway) && ActiveMerchant::Billing::Gateway.respond_to?(:implementations) end executes do OneApm::Manager.logger.info 'Installing ActiveMerchant instrumentation' end executes do class ActiveMerchant::Billing::Gateway include OneApm::Support::MethodTracer end ActiveMerchant::Billing::Gateway.implementations.each do |gateway| gateway.class_eval do implemented_methods = public_instance_methods(false).map(&:to_sym) gateway_name = self.name.split('::').last [:authorize, :purchase, :credit, :void, :capture, :recurring, :store, :unstore, :update].each do |operation| if implemented_methods.include?(operation) add_method_tracer operation, "ActiveMerchant/gateway/#{gateway_name}/#{operation}" add_method_tracer operation, "ActiveMerchant/gateway/#{gateway_name}", :push_scope => false add_method_tracer operation, "ActiveMerchant/operation/#{operation}", :push_scope => false end end end end end end
Version data entries
39 entries across 39 versions & 1 rubygems