Skip to content

Commit

Permalink
Merge pull request #2849 from newrelic/fix_load_tests
Browse files Browse the repository at this point in the history
fix for rdkafka on load tests
  • Loading branch information
fallwith authored Sep 11, 2024
2 parents d121224 + 978b3c6 commit b3f45e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/new_relic/agent/instrumentation/rdkafka/chain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
# frozen_string_literal: true

require_relative 'instrumentation'

module NewRelic::Agent::Instrumentation
module Rdkafka::Chain
def self.instrument!
Expand Down
4 changes: 3 additions & 1 deletion lib/new_relic/agent/instrumentation/rdkafka/prepend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
# frozen_string_literal: true

require_relative 'instrumentation'

module NewRelic::Agent::Instrumentation
module RdkafkaProducer
module Prepend
Expand Down Expand Up @@ -34,7 +36,7 @@ module RdkafkaConfig
module Prepend
include NewRelic::Agent::Instrumentation::RdkafkaConfig

if Gem::Version.new(::Rdkafka::VERSION) >= Gem::Version.new('0.16.0')
if defined?(::Rdkafka) && Gem::Version.new(::Rdkafka::VERSION) >= Gem::Version.new('0.16.0')
def producer(**kwargs)
super.tap do |producer|
set_nr_config(producer)
Expand Down

0 comments on commit b3f45e4

Please sign in to comment.