Sha256: 69be336bc0e8167894aab0be702239ec9af161b19334ce54e5da46bd7363ec62
Contents?: true
Size: 1.24 KB
Versions: 27
Compression:
Stored size: 1.24 KB
Contents
module Datadog module Contrib module Dalli COMPATIBLE_WITH = Gem::Version.new('2.0.0') NAME = 'memcached.command'.freeze CMD_TAG = 'memcached.command'.freeze # Responsible for hooking the instrumentation into `dalli` module Patcher include Base register_as :dalli, auto_patch: true option :service_name, default: 'memcached' @patched = false class << self def patch return @patched if patched? || !compatible? require 'ddtrace/ext/app_types' require_relative 'instrumentation' add_pin! Instrumentation.patch! @patched = true rescue => e Tracer.log.error("Unable to apply Dalli integration: #{e}") @patched end def patched? @patched end private def compatible? return unless defined?(::Dalli::VERSION) Gem::Version.new(::Dalli::VERSION) > COMPATIBLE_WITH end def add_pin! Pin .new(get_option(:service_name), app: 'dalli', app_type: Ext::AppTypes::CACHE) .onto(::Dalli) end end end end end end
Version data entries
27 entries across 27 versions & 1 rubygems