Skip to content

[receiver/kafka] Evaluate if we should allow empty values in exclude_topic(s) #44920

@paulojmdias

Description

@paulojmdias

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:

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions