Sha256: d30c4a3a05c93f1d808aba7457fd89a2b616b9e96aa70233d9be86a6efdd2850

Contents?: true

Size: 915 Bytes

Versions: 1

Compression:

Stored size: 915 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

require_relative 'ruby_kafka/instrumentation'
require_relative 'ruby_kafka/chain'
require_relative 'ruby_kafka/prepend'

DependencyDetection.defer do
  named :'ruby_kafka'

  depends_on do
    defined?(Kafka)
  end

  executes do
    NewRelic::Agent.logger.info('Installing ruby-kafka instrumentation')

    if use_prepend?
      prepend_instrument Kafka::Producer, NewRelic::Agent::Instrumentation::RubyKafkaProducer::Prepend
      prepend_instrument Kafka::Consumer, NewRelic::Agent::Instrumentation::RubyKafkaConsumer::Prepend
      prepend_instrument Kafka::Client, NewRelic::Agent::Instrumentation::RubyKafkaClient::Prepend
    else
      chain_instrument NewRelic::Agent::Instrumentation::RubyKafka::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/ruby_kafka.rb