Sha256: abceda0ffd2e765bf024f500d82b85349b9dab11b43494902e6ebe78218c46fe

Contents?: true

Size: 919 Bytes

Versions: 2

Compression:

Stored size: 919 Bytes

Contents

# typed: false

require 'datadog/tracing/contrib/patcher'
require 'datadog/tracing/contrib/redis/ext'
require 'datadog/tracing/contrib/redis/configuration/resolver'

module Datadog
  module Tracing
    module Contrib
      module Redis
        # Patcher enables patching of 'redis' module.
        module Patcher
          include Contrib::Patcher

          module_function

          def target_version
            Integration.version
          end

          # patch applies our patch if needed
          def patch
            # do not require these by default, but only when actually patching
            require 'redis'
            require 'datadog/tracing/contrib/redis/tags'
            require 'datadog/tracing/contrib/redis/quantize'
            require 'datadog/tracing/contrib/redis/instrumentation'

            ::Redis::Client.include(Instrumentation)
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ddtrace-1.2.0 lib/datadog/tracing/contrib/redis/patcher.rb
ddtrace-1.1.0 lib/datadog/tracing/contrib/redis/patcher.rb