Sha256: f06aa59f384bbbb64967369e31d149c60e7fa0a9268d2188b2910dd0c694311a

Contents?: true

Size: 760 Bytes

Versions: 7

Compression:

Stored size: 760 Bytes

Contents

# frozen_string_literal: true

# Copyright 2020 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

7 entries across 7 versions & 1 rubygems

Version Path
opentelemetry-instrumentation-redis-0.10.1 lib/opentelemetry/instrumentation/redis/instrumentation.rb
opentelemetry-instrumentation-redis-0.10.0 lib/opentelemetry/instrumentation/redis/instrumentation.rb
opentelemetry-instrumentation-redis-0.9.0 lib/opentelemetry/instrumentation/redis/instrumentation.rb
opentelemetry-instrumentation-redis-0.8.0 lib/opentelemetry/instrumentation/redis/instrumentation.rb
opentelemetry-instrumentation-redis-0.7.0 lib/opentelemetry/instrumentation/redis/instrumentation.rb
opentelemetry-instrumentation-redis-0.6.0 lib/opentelemetry/instrumentation/redis/instrumentation.rb
opentelemetry-instrumentation-redis-0.5.0 lib/opentelemetry/instrumentation/redis/instrumentation.rb