Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for rdkafka on load tests #2849

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading