-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
feat(inputs.kafka_consumer): sarama debug logs #12304
Conversation
Thanks so much for the pull request! |
!signed-cla |
63fbc06
to
c9db6fa
Compare
c9db6fa
to
0a41b12
Compare
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.
Hey - thanks for the PR. This is identical to what exists in the kafka output today. Would you be willing to add the DebugLogger
to the common.kafka so we have this in one place?
@powersj Sounds like a good idea. Refactored accordingly. |
baf895b
to
9ca4131
Compare
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.
Thanks for moving this into a common section.
One thing I realized when playing with this is that sarama's logger is global, so whatever plugin gets initialized last will get used as part of the output. So if a user has a kafka_consumer + kafka output it will lead to some really confusion log output.
This was already an issue before, so nothing to do for this PR.
Yeah, it's not ideal. I imagine it might actually be better to log directly, just tagging as sarama much like the agent does. |
@trvrnrth and @powersj how about instantiating a new logger here (as @trvrnrth suggested) with a sarama prefix? I think all it needs is a call to |
As the sarama logger is global it doesn't make sense to output on a plugin log as this is confusing for the case that both the kafka_consumer input and kafka output plugins are used.
@srebhan @powersj That was straightforward enough so I've gone ahead. I instantiate the |
Download PR build artifacts for linux_amd64.tar.gz, darwin_amd64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
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.
Even better!
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.
Nice work @trvrnrth! Thanks for your effort!
Required for all PRs
Outputs sarama logs at debug level in the same manner as the kafka output plugin in order to aid troubleshooting.