Sha256: eb4a3a82ee26db9ca494391074c14e1f503be9688f0acfc9bbac2440014fddc4
Contents?: true
Size: 1.46 KB
Versions: 38
Compression:
Stored size: 1.46 KB
Contents
module Appsignal class Hooks # @api private module SequelLogExtension # Add query instrumentation def log_yield(sql, args = nil) Appsignal.instrument( "sql.sequel", nil, sql, Appsignal::EventFormatter::SQL_BODY_FORMAT ) do super end end end module SequelLogConnectionExtension # Add query instrumentation def log_connection_yield(sql, conn, args = nil) Appsignal.instrument( "sql.sequel", nil, sql, Appsignal::EventFormatter::SQL_BODY_FORMAT ) do super end end end class SequelHook < Appsignal::Hooks::Hook register :sequel def dependencies_present? defined?(::Sequel::Database) && Appsignal.config && Appsignal.config[:instrument_sequel] end def install # Register the extension... if ::Sequel::MAJOR >= 4 && ::Sequel::MINOR >= 35 ::Sequel::Database.register_extension( :appsignal_integration, Appsignal::Hooks::SequelLogConnectionExtension ) else ::Sequel::Database.register_extension( :appsignal_integration, Appsignal::Hooks::SequelLogExtension ) end # ... and automatically add it to future instances. ::Sequel::Database.extension(:appsignal_integration) end end end end
Version data entries
38 entries across 38 versions & 1 rubygems