Sha256: 8c4d011738440d57f4ae58898c4d4145bfaa2e4f03bdbe8126d13d42b6f10409

Contents?: true

Size: 979 Bytes

Versions: 39

Compression:

Stored size: 979 Bytes

Contents

# encoding: utf-8

LibraryDetection.defer do
  @name = :sequel

  depends_on do
    defined?(::Sequel)
  end

  depends_on do
    !OneApm::Manager.config[:disable_sequel_instrumentation]
  end

  def supported_sequel_version?
    Sequel.const_defined?( :MAJOR ) &&
      ( Sequel::MAJOR > 3 ||
        Sequel::MAJOR == 3 && Sequel::MINOR >= 37 )
  end

  executes do
    if supported_sequel_version?

      OneApm::Manager.logger.info 'Installing Sequel instrumentation'

      if Sequel::Database.respond_to?(:extension)
        Sequel::Database.extension :oneapm_instrumentation
      else
        OneApm::Manager.logger.warn("Detected Sequel version #{Sequel::VERSION}.")
      end

      Sequel.synchronize{Sequel::DATABASES.dup}.each do |db|
        db.extension :oneapm_instrumentation
      end

      Sequel::Model.plugin :oneapm_instrumentation

    else

      OneApm::Manager.logger.info "Sequel instrumentation requires at least version 3.37.0."

    end

  end

end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
oneapm_rpm-1.4.2 lib/one_apm/inst/orm/sequel.rb
oneapm_rpm-1.4.1 lib/one_apm/inst/orm/sequel.rb
oneapm_rpm-1.4.0 lib/one_apm/inst/orm/sequel.rb
oneapm_rpm-1.3.7 lib/one_apm/inst/orm/sequel.rb
oneapm_rpm-1.3.7.rc1 lib/one_apm/inst/orm/sequel.rb
oneapm_rpm-1.3.6 lib/one_apm/inst/orm/sequel.rb
oneapm_rpm-1.3.6.rc1 lib/one_apm/inst/orm/sequel.rb
oneapm_rpm-1.3.5 lib/one_apm/inst/orm/sequel.rb
oneapm_rpm-1.3.5.rc1 lib/one_apm/inst/orm/sequel.rb
oneapm_rpm-1.3.4 lib/one_apm/inst/orm/sequel.rb
oneapm_rpm-1.3.4.rc1 lib/one_apm/inst/orm/sequel.rb
oneapm_rpm-1.3.3 lib/one_apm/inst/orm/sequel.rb
oneapm_rpm-1.3.3.rc1 lib/one_apm/inst/orm/sequel.rb
oneapm_rpm-1.3.2 lib/one_apm/inst/orm/sequel.rb
oneapm_rpm-1.3.2.rc1 lib/one_apm/inst/orm/sequel.rb
oneapm_rpm-1.3.1 lib/one_apm/inst/orm/sequel.rb
oneapm_rpm-1.3.1.rc1 lib/one_apm/inst/orm/sequel.rb
oneapm_rpm-1.3.0 lib/one_apm/inst/orm/sequel.rb
oneapm_rpm-1.3.0.rc1 lib/one_apm/inst/orm/sequel.rb
oneapm_rpm-1.2.9 lib/one_apm/inst/orm/sequel.rb