lib/new_relic/agent/instrumentation/redis.rb in newrelic_rpm-8.12.0 vs lib/new_relic/agent/instrumentation/redis.rb in newrelic_rpm-8.13.0
- old
+ new
@@ -5,11 +5,13 @@
require 'new_relic/agent/datastores'
require 'new_relic/agent/datastores/redis'
require_relative 'redis/instrumentation'
require_relative 'redis/chain'
+require_relative 'redis/constants'
require_relative 'redis/prepend'
+require_relative 'redis/middleware'
DependencyDetection.defer do
# Why not :redis? newrelic-redis used that name, so avoid conflicting
named :redis_instrumentation
configure_with :redis
@@ -27,9 +29,13 @@
NewRelic::Agent::Datastores::Redis.safe_from_third_party_gem?
end
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)
+ end
+
if use_prepend?
prepend_instrument ::Redis::Client, NewRelic::Agent::Instrumentation::Redis::Prepend
else
chain_instrument NewRelic::Agent::Instrumentation::Redis::Chain
end