Sha256: a832f5e767e709621aacba5f4aedb9b891ddae95c4515464f33120ecb40a5fe6

Contents?: true

Size: 1.11 KB

Versions: 8

Compression:

Stored size: 1.11 KB

Contents

require 'ddtrace/contrib/integration'
require 'ddtrace/contrib/action_pack/configuration/settings'
require 'ddtrace/contrib/action_pack/patcher'
require 'ddtrace/contrib/rails/utils'

module Datadog
  module Contrib
    module ActionPack
      # Describes the ActionPack integration
      class Integration
        include Contrib::Integration

        MINIMUM_VERSION = Gem::Version.new('3.0')

        register_as :action_pack, auto_patch: false

        def self.version
          Gem.loaded_specs['actionpack'] && Gem.loaded_specs['actionpack'].version
        end

        def self.loaded?
          !defined?(::ActionPack).nil?
        end

        def self.compatible?
          super && version >= MINIMUM_VERSION
        end

        # enabled by rails integration so should only auto instrument
        # if detected that it is being used without rails
        def auto_instrument?
          !Datadog::Contrib::Rails::Utils.railtie_supported?
        end

        def default_configuration
          Configuration::Settings.new
        end

        def patcher
          ActionPack::Patcher
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ddtrace-0.51.1 lib/ddtrace/contrib/action_pack/integration.rb
ddtrace-0.51.0 lib/ddtrace/contrib/action_pack/integration.rb
ddtrace-0.50.0 lib/ddtrace/contrib/action_pack/integration.rb
ddtrace-0.49.0 lib/ddtrace/contrib/action_pack/integration.rb
ddtrace-0.48.0 lib/ddtrace/contrib/action_pack/integration.rb
ddtrace-0.47.0 lib/ddtrace/contrib/action_pack/integration.rb
ddtrace-0.46.0 lib/ddtrace/contrib/action_pack/integration.rb
ddtrace-0.45.0 lib/ddtrace/contrib/action_pack/integration.rb