Sha256: dc3858d10e0b68aada5b919ed6a85a9ffec2fff4bd04488e8e33248b49de2347

Contents?: true

Size: 1.21 KB

Versions: 5

Compression:

Stored size: 1.21 KB

Contents

# typed: false
require 'ddtrace/contrib/integration'
require 'ddtrace/contrib/active_support/configuration/settings'
require 'ddtrace/contrib/active_support/patcher'
require 'ddtrace/contrib/active_support/cache/redis'
require 'ddtrace/contrib/rails/utils'

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

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

        register_as :active_support, auto_patch: false

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

        def self.loaded?
          !defined?(::ActiveSupport).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
          ActiveSupport::Patcher
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ddtrace-0.54.2 lib/ddtrace/contrib/active_support/integration.rb
ddtrace-0.54.1 lib/ddtrace/contrib/active_support/integration.rb
ddtrace-0.54.0 lib/ddtrace/contrib/active_support/integration.rb
ddtrace-0.53.0 lib/ddtrace/contrib/active_support/integration.rb
ddtrace-0.52.0 lib/ddtrace/contrib/active_support/integration.rb