lib/opentelemetry/instrumentation/dalli/instrumentation.rb in opentelemetry-instrumentation-dalli-0.19.1 vs lib/opentelemetry/instrumentation/dalli/instrumentation.rb in opentelemetry-instrumentation-dalli-0.20.0

- old
+ new

@@ -18,20 +18,24 @@ present do defined?(::Dalli) end option :peer_service, default: nil, validate: :string - option :db_statement, default: :include, validate: ->(opt) { %I[omit include].include?(opt) } + option :db_statement, default: :include, validate: ->(opt) { %I[omit obfuscate include].include?(opt) } private def require_dependencies require_relative 'utils' require_relative 'patches/server' end def add_patches - ::Dalli::Server.prepend(Patches::Server) + if Gem::Version.new(::Dalli::VERSION) < Gem::Version.new('3.0.0') + ::Dalli::Server.prepend(Patches::Server) + else + ::Dalli::Protocol::Binary.prepend(Patches::Server) + end end end end end end