-
Notifications
You must be signed in to change notification settings - Fork 599
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
Karafka rdkafka bugfix #2880
Karafka rdkafka bugfix #2880
Changes from all commits
c7ebec7
6bddd91
17afe8b
8f77323
e890bd0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -36,7 +36,8 @@ module RdkafkaConfig | |||||||||||||||||||||||||||||
module Prepend | ||||||||||||||||||||||||||||||
include NewRelic::Agent::Instrumentation::RdkafkaConfig | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
if defined?(::Rdkafka) && 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')) || | ||||||||||||||||||||||||||||||
(Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7.0')) | ||||||||||||||||||||||||||||||
Comment on lines
+39
to
+40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tannalynn Should the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah skipping the defined is cool for the ruby version check, the reason it's needed where it is currently, is because we use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to check if Rdkafka is defined? I thought this file would only load if it's already defined because of the dependency detection check:
If we need to check it, should the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When the agent is running normally it's not a problem, this is something I did in order to fix a test that was failing related to loading instrumentation. #2849 Also, It's not needed in chain because in the chain file, that code is in a method that gets called later, so it works differently than prepend. |
||||||||||||||||||||||||||||||
def producer(**kwargs) | ||||||||||||||||||||||||||||||
super.tap do |producer| | ||||||||||||||||||||||||||||||
set_nr_config(producer) | ||||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This checks the ruby version because on 2.7+, if kwargs is just empty it will also work with it if 0 params are defined, so now the kwargs version will always be used if it's on 2.7+