Sha256: 34c3de31cab45a355cc7f4298c52519f8172077bcf66cfebe0ce1e02256c7c67

Contents?: true

Size: 910 Bytes

Versions: 1

Compression:

Stored size: 910 Bytes

Contents

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

DependencyDetection.defer do
  named :rdkafka

  depends_on do
    defined?(Rdkafka)
  end

  executes do
    NewRelic::Agent.logger.info('Installing rdkafka instrumentation')

    require_relative 'rdkafka/instrumentation'
    require_relative 'rdkafka/chain'
    require_relative 'rdkafka/prepend'

    if use_prepend?
      prepend_instrument Rdkafka::Config, NewRelic::Agent::Instrumentation::RdkafkaConfig::Prepend
      prepend_instrument Rdkafka::Producer, NewRelic::Agent::Instrumentation::RdkafkaProducer::Prepend
      prepend_instrument Rdkafka::Consumer, NewRelic::Agent::Instrumentation::RdkafkaConsumer::Prepend
    else
      chain_instrument NewRelic::Agent::Instrumentation::Rdkafka::Chain
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
newrelic_rpm-9.14.0 lib/new_relic/agent/instrumentation/rdkafka.rb