-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Description
Component(s)
receiver/kafka
Describe the issue you're reporting
As discovered in the following issue, the exclude_topics configuration field (and deprecated exclude_topic) accepts empty strings without validation. While there is runtime filtering in franz_client.go that prevents empty strings from reaching the Kafka client, there's no config validation to warn users about this dangerous configuration. An empty string "" is a valid regex pattern that matches all strings, meaning if a user accidentally configures:
exclude_topic: ""or
exclude_topics:
- ""
- "^logs-test$"The receiver would exclude all topics and would consume nothing.
Related tests that validate this behaviour, and it could be added either:
- [receiver/kafka] Add support for exclude topics when using regex #43782 (comment)
- [receiver/kafka] Add support for exclude topics when using regex #43782 (comment)
This issue is for discussion on whether we should only document this behavior for clarity or add the necessary validation/tests to ensure that empty strings are removed or rejected.
I will assign it to myself, as I have already completed some code for it.
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.