Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add support for compression options in Kafka exporter #63
Add support for compression options in Kafka exporter #63
Changes from 2 commits
7243ee5
648c741
7d1d6ec
4a8ae60
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
What does the
compression_level
value mean? Is there a scale? Is it the same for all supported compression methods? Does a lower value indicate more compression, or a higher value? What is the range of this scale?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.
Yes, it is a scale. It measures the compression degree to the files.
No, each compression method has different range. For example, the valid range for gzip is 1 - 9.
Higher value indicates more compression.
The valid range for each method is as below:
gzip: 1 - 9
snappy: do not support
lz4: 1 - 17
zstd: 1 - 22
I would put all these info into README. Thanks!
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.
Does this need to be exported? If so, it needs godoc describing its use. It probably doesn't, though, and thus should be unexported.
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.
I also don't see why this would be exported, but I saw that
ConfigureAuthentication
is also an exported method. Not sure why that would be, and if the same reasons would apply toConfigureCompression
?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.
Yeah I agree it doesn't need to - will do!
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.
ConfigureAuthentication is exported because it is called by the Kafka receiver. I think configureCompression doesn't need to at this point.
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.
Maybe it would be good to try some non-default values for these in the testdata config?
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!
The Kafka exporter basically uses sarama as the producer to produce messages to Kafka. So I think it would be the best to follow the sarama's specification about the compression options.
Yes, I should add more tests.
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.
Are these needed in this test? I couldn't find where it would change anything being tested here?
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.
Yes, this test will fail if not.