Sha256: 0ebcb9cc8d17d8f214a6924a5572d2f8c9a4a81eebbf416fc24fc43a81fc6e88

Contents?: true

Size: 1.33 KB

Versions: 32

Compression:

Stored size: 1.33 KB

Contents

# -*- ruby -*-
# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.

DependencyDetection.defer do
  @name = :sequel

  depends_on do
    defined?(::Sequel)
  end

  depends_on do
    !NewRelic::Agent.config[:disable_sequel_instrumentation] &&
    !NewRelic::Agent.config[:disable_database_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?

      ::NewRelic::Agent.logger.info 'Installing Sequel instrumentation'

      if Sequel::Database.respond_to?( :extension )
        Sequel::Database.extension :newrelic_instrumentation
      else
        NewRelic::Agent.logger.info "Detected Sequel version %s." % [ Sequel::VERSION ]
        NewRelic::Agent.logger.info "Please see additional documentation: " +
          "https://newrelic.com/docs/ruby/sequel-instrumentation"
      end

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

      Sequel::Model.plugin :newrelic_instrumentation

    else

      NewRelic::Agent.logger.info "Sequel instrumentation requires at least version 3.37.0."

    end

  end

end

Version data entries

32 entries across 32 versions & 2 rubygems

Version Path
newrelic_rpm-5.0.0.342 lib/new_relic/agent/instrumentation/sequel.rb
newrelic_rpm-4.8.0.341 lib/new_relic/agent/instrumentation/sequel.rb
newrelic_rpm-4.7.1.340 lib/new_relic/agent/instrumentation/sequel.rb
newrelic_rpm-4.7.0.339 lib/new_relic/agent/instrumentation/sequel.rb
newrelic_rpm-4.6.0.338 lib/new_relic/agent/instrumentation/sequel.rb
newrelic_rpm-4.5.0.337 lib/new_relic/agent/instrumentation/sequel.rb
newrelic_rpm-4.4.0.336 lib/new_relic/agent/instrumentation/sequel.rb
newrelic_rpm-4.3.0.335 lib/new_relic/agent/instrumentation/sequel.rb
newrelic_rpm-4.2.0.334 lib/new_relic/agent/instrumentation/sequel.rb
newrelic_rpm-4.1.0.333 lib/new_relic/agent/instrumentation/sequel.rb
newrelic_rpm-4.0.0.332 lib/new_relic/agent/instrumentation/sequel.rb
newrelic_rpm-3.18.1.330 lib/new_relic/agent/instrumentation/sequel.rb
newrelic_rpm-3.18.0.329 lib/new_relic/agent/instrumentation/sequel.rb
newrelic_rpm-3.17.2.327 lib/new_relic/agent/instrumentation/sequel.rb
newrelic_rpm-3.17.1.326 lib/new_relic/agent/instrumentation/sequel.rb
newrelic_rpm-3.17.0.325 lib/new_relic/agent/instrumentation/sequel.rb
newrelic_rpm-3.16.3.323 lib/new_relic/agent/instrumentation/sequel.rb
newrelic_rpm-3.16.2.321 lib/new_relic/agent/instrumentation/sequel.rb
newrelic_rpm-3.16.1.320 lib/new_relic/agent/instrumentation/sequel.rb
newrelic_rpm-3.16.0.318 lib/new_relic/agent/instrumentation/sequel.rb