Sha256: 00d4d247df560f0019b11209baad1b0744708f6b301782b676ecf730f137c1ef

Contents?: true

Size: 1.08 KB

Versions: 5

Compression:

Stored size: 1.08 KB

Contents

# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.

require 'new_relic/agent/datastores'
require 'new_relic/agent/datastores/redis'

require_relative 'redis/instrumentation'
require_relative 'redis/chain'
require_relative 'redis/prepend'

DependencyDetection.defer do
  # Why not :redis? newrelic-redis used that name, so avoid conflicting
  named :redis_instrumentation
  configure_with :redis
  
  depends_on do
    defined?(::Redis) && defined?(::Redis::VERSION)
  end

  conflicts_with_prepend do
    defined?(::PrometheusExporter)
  end

  depends_on do
    NewRelic::Agent::Datastores::Redis.is_supported_version? &&
      NewRelic::Agent::Datastores::Redis.safe_from_third_party_gem?
  end

  executes do
    NewRelic::Agent.logger.info 'Installing Redis Instrumentation'
    if use_prepend?
      prepend_instrument ::Redis::Client, NewRelic::Agent::Instrumentation::Redis::Prepend
    else
      chain_instrument NewRelic::Agent::Instrumentation::Redis::Chain
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
newrelic_rpm-8.2.0 lib/new_relic/agent/instrumentation/redis.rb
newrelic_rpm-8.1.0 lib/new_relic/agent/instrumentation/redis.rb
newrelic_rpm-8.0.0 lib/new_relic/agent/instrumentation/redis.rb
newrelic_rpm-7.2.0 lib/new_relic/agent/instrumentation/redis.rb
newrelic_rpm-7.1.0 lib/new_relic/agent/instrumentation/redis.rb