-
Notifications
You must be signed in to change notification settings - Fork 3.1k
[receiver/kafka] Add support for exclude topics when using regex #44118
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Paulo Dias <[email protected]>
Signed-off-by: Paulo Dias <[email protected]>
Signed-off-by: Paulo Dias <[email protected]>
…lector-contrib into feat/43782 Signed-off-by: Paulo Dias <[email protected]>
| config *Config, | ||
| set receiver.Settings, | ||
| topics []string, | ||
| excludeTopics []string, |
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.
why accept an array 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.
Built this way to keep the same input type as the topic field, which is defined in config as a string but is set here as an array. I'm open to supporting this as an array (maybe renamed to exclude_topics), but for parity, IMO we should fill an issue to evaluate transforming the topic field into a native list of strings too.
I would like to have inputs here from the other codeowners @axw, @MovieStoreGuy, and @pavolloffay 🙏
| }, nil | ||
| } | ||
| return newReceiver(config, set, []string{config.Logs.Topic}, newConsumeMessageFunc) | ||
| return newReceiver(config, set, []string{config.Logs.Topic}, []string{config.Logs.ExcludeTopic}, newConsumeMessageFunc) |
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.
did you mean to make this an array of string in the config?
Signed-off-by: Paulo Dias <[email protected]>
Description
Add a new
exclude_topicoption to allow users to exclude topics when using the Kafka receiver with a regex on the topic consuming definition.Link to tracking issue
Fixes #43782
Testing
Added tests to validate this functionality and the configuration itself.
Documentation
Updated documentation with the option and with an explicit example.