lib/new_relic/agent/instrumentation/redis.rb in newrelic_rpm-9.11.0 vs lib/new_relic/agent/instrumentation/redis.rb in newrelic_rpm-9.12.0

- old
+ new

@@ -8,10 +8,11 @@ require_relative 'redis/instrumentation' require_relative 'redis/chain' require_relative 'redis/constants' require_relative 'redis/prepend' require_relative 'redis/middleware' +require_relative 'redis/cluster_middleware' DependencyDetection.defer do # Why not :redis? newrelic-redis used that name, so avoid conflicting @name = :redis_instrumentation configure_with :redis @@ -31,9 +32,13 @@ executes do NewRelic::Agent.logger.info('Installing Redis Instrumentation') if NewRelic::Agent::Instrumentation::Redis::Constants::HAS_REDIS_CLIENT RedisClient.register(NewRelic::Agent::Instrumentation::RedisClient::Middleware) + + if defined?(Redis::Cluster::Client) + return RedisClient.register(NewRelic::Agent::Instrumentation::RedisClient::ClusterMiddleware) + end end if use_prepend? prepend_instrument Redis::Client, NewRelic::Agent::Instrumentation::Redis::Prepend else