Sha256: 400a5e4b3419ab4cbd5c6712c7ac4b7136fb1137c3f6d13806dc919b8ae135e8

Contents?: true

Size: 759 Bytes

Versions: 4

Compression:

Stored size: 759 Bytes

Contents

# frozen_string_literal: true

# Copyright The OpenTelemetry Authors
#
# SPDX-License-Identifier: Apache-2.0

module OpenTelemetry
  module Instrumentation
    module Redis
      # The Instrumentation class contains logic to detect and install the Redis
      # instrumentation
      class Instrumentation < OpenTelemetry::Instrumentation::Base
        install do |_config|
          require_dependencies
          patch_client
        end

        present do
          defined?(::Redis)
        end

        private

        def require_dependencies
          require_relative 'utils'
          require_relative 'patches/client'
        end

        def patch_client
          ::Redis::Client.prepend(Patches::Client)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
opentelemetry-instrumentation-redis-0.14.0 lib/opentelemetry/instrumentation/redis/instrumentation.rb
opentelemetry-instrumentation-redis-0.13.0 lib/opentelemetry/instrumentation/redis/instrumentation.rb
opentelemetry-instrumentation-redis-0.12.0 lib/opentelemetry/instrumentation/redis/instrumentation.rb
opentelemetry-instrumentation-redis-0.11.0 lib/opentelemetry/instrumentation/redis/instrumentation.rb