Module NewRelic::Agent::Database
In: lib/new_relic/agent/database.rb
lib/new_relic/agent/database/obfuscator.rb
lib/new_relic/agent/database/explain_plan_helpers.rb
lib/new_relic/agent/database/obfuscation_helpers.rb
lib/new_relic/agent/database/postgres_explain_obfuscator.rb

Methods

Classes and Modules

Module NewRelic::Agent::Database::ExplainPlanHelpers
Module NewRelic::Agent::Database::ObfuscationHelpers
Module NewRelic::Agent::Database::PostgresExplainObfuscator
Class NewRelic::Agent::Database::ConnectionManager
Class NewRelic::Agent::Database::Obfuscator
Class NewRelic::Agent::Database::Statement

Constants

MAX_QUERY_LENGTH = 16384
RECORD_FOR = [:raw, :obfuscated].freeze
KNOWN_OPERATIONS = [ 'alter', 'select', 'update', 'delete', 'insert', 'create', 'show', 'set', 'exec', 'execute', 'call'
SQL_COMMENT_REGEX = Regexp.new('/\*.*?\*/', Regexp::MULTILINE).freeze
EMPTY_STRING = ''.freeze

Public Instance methods

Properly encode, truncate, and dup the incoming query. Take care not to the dup the query more than once as correctly encoded may also dup the query.

Perform this in the runtime environment of a managed application, to explain the sql statement executed within a node of a transaction sample. Returns an array of two arrays. The first array contains the headers, while the second consists of arrays of strings for each column returned by the explain query. Note this happens only for statements whose execution time exceeds a threshold (e.g. 500ms) and only within the slowest transaction in a report period, selected for shipment to New Relic

[Validate]