Sha256: 23e52d59ee96d32f41cc9ff54a073b00206d2817f8f68fa89a235b3ce78b5244

Contents?: true

Size: 849 Bytes

Versions: 7

Compression:

Stored size: 849 Bytes

Contents

# frozen_string_literal: true

require_relative '../../patcher'
require_relative 'instrumentation'

module Datadog
  module Tracing
    module Contrib
      module ActionPack
        module ActionDispatch
          # Patcher for ActionController components
          module Patcher
            include Contrib::Patcher

            module_function

            def target_version
              Integration.version
            end

            def patch
              if ::ActionPack.gem_version >= Gem::Version.new('7.1')
                ::ActionDispatch::Journey::Router.prepend(ActionDispatch::Instrumentation::Journey::LazyRouter)
              else
                ::ActionDispatch::Journey::Router.prepend(ActionDispatch::Instrumentation::Journey::Router)
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
datadog-2.9.0 lib/datadog/tracing/contrib/action_pack/action_dispatch/patcher.rb
datadog-2.8.0 lib/datadog/tracing/contrib/action_pack/action_dispatch/patcher.rb
datadog-2.7.1 lib/datadog/tracing/contrib/action_pack/action_dispatch/patcher.rb
datadog-2.7.0 lib/datadog/tracing/contrib/action_pack/action_dispatch/patcher.rb
datadog-2.6.0 lib/datadog/tracing/contrib/action_pack/action_dispatch/patcher.rb
datadog-2.5.0 lib/datadog/tracing/contrib/action_pack/action_dispatch/patcher.rb
datadog-2.4.0 lib/datadog/tracing/contrib/action_pack/action_dispatch/patcher.rb