Sha256: 28b9e303b03f70040674481cec5492debbe6ea423c6e29b9faf97a17e4f6445b

Contents?: true

Size: 757 Bytes

Versions: 4

Compression:

Stored size: 757 Bytes

Contents

# frozen_string_literal: true

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

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

        present do
          defined?(::Dalli)
        end

        private

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

        def add_patches
          ::Dalli::Server.prepend(Patches::Server)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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