module ScoutApm::Instruments::MopedInstrumentationPrepend
Public Instance Methods
Source
# File lib/scout_apm/instruments/moped.rb, line 59 def process(operation, &callback) if operation.respond_to?(:collection) collection = operation.collection name = "Process/#{collection}/#{operation.class.to_s.split('::').last}" self.class.instrument("MongoDB", name, :annotate_layer => { :query => scout_sanitize_log(operation.log_inspect) }) do super(operation, &callback) end end end
Calls superclass method
Source
# File lib/scout_apm/instruments/moped.rb, line 70 def scout_sanitize_log(log) return nil if log.length > 1000 # safeguard - don't sanitize large SQL statements log.gsub(/(=>")((?:[^"]|"")*)"/) do $1 + '?' + '"' end end
replaces values w/ ?