Module: Contrast::Agent::Inventory::Policy::DataStores

Extended by:
Components::Logger::InstanceMethods
Defined in:
lib/contrast/agent/inventory/policy/datastores.rb

Overview

This Module is how we apply the Data Store detection required for the FlowMap feature. It is called from our patches of the targeted methods in which database operations occur. It is responsible for deciding if the given invocation is worth reporting or not.

Constant Summary collapse

DATA_STORE_MARKER =

The key used in policy.json to indicate the database type to report.

'data_store'

Class Method Summary collapse

Methods included from Components::Logger::InstanceMethods

cef_logger, logger

Class Method Details

.report_data_store(_method, _exception, properties, object, _args) ⇒ Object



22
23
24
25
26
27
28
29
30
31
# File 'lib/contrast/agent/inventory/policy/datastores.rb', line 22

def report_data_store _method, _exception, properties, object, _args
  return unless ::Contrast::INVENTORY.enable

  marker = properties[DATA_STORE_MARKER]
  return unless marker

  file_report(marker)
rescue StandardError => e
  logger.error('Error reporting database call', e, object: object)
end