Module: NewRelic::Agent::Instrumentation::ActiveRecordNotifications::BaseExtensions50

Defined in:
lib/new_relic/agent/instrumentation/active_record_notifications.rb

Instance Method Summary collapse

Instance Method Details

#log(sql, name = 'SQL', binds = [], type_casted_binds = [], statement_name = nil) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/new_relic/agent/instrumentation/active_record_notifications.rb', line 41

def log(sql, name = 'SQL', binds = [], type_casted_binds = [], statement_name = nil)
  @instrumenter.instrument(
    SQL_ACTIVE_RECORD,
    sql: sql,
    name: name,
    binds: binds,
    type_casted_binds: type_casted_binds,
    statement_name: statement_name,
    connection_id: object_id,
    connection: self
  ) { yield }
rescue => e
  raise translate_exception_class(e, sql)
end