Skip to content
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

Fix topics in loki.source.kafka #2351

Merged
merged 7 commits into from
Jan 8, 2025
Merged

Fix topics in loki.source.kafka #2351

merged 7 commits into from
Jan 8, 2025

Conversation

wildum
Copy link
Contributor

@wildum wildum commented Jan 8, 2025

PR Description

The code claims that it will use regex if the topic name starts with "^" but it actually always uses regex. As a result, if you have the topic "foo" and "foobar", you will match both by setting "foo" only.

The fix prevents this from happening by using exact match by default and documenting the possible use of regex.

This is technically a breaking change for users relying on the undocumented regex behavior.

To avoid the breaking change, we could document that an exact match can be achieved by having the name start with "^" and end with "$" but I would prefer fixing this to match the intended way. Because the use of regex was undocumented, it does not breach our backward compatibility statement.

  • CHANGELOG.md updated
  • Documentation added
  • Tests updated

@wildum wildum requested review from clayton-cornell and a team as code owners January 8, 2025 14:04
Copy link
Contributor

github-actions bot commented Jan 8, 2025

💻 Deploy preview deleted.

CHANGELOG.md Outdated Show resolved Hide resolved
docs/sources/release-notes.md Outdated Show resolved Hide resolved
docs/sources/release-notes.md Outdated Show resolved Hide resolved
docs/sources/release-notes.md Outdated Show resolved Hide resolved
@clayton-cornell clayton-cornell added the type/docs Docs Squad label across all Grafana Labs repos label Jan 8, 2025
@wildum wildum merged commit 0a3e6df into main Jan 8, 2025
20 checks passed
@wildum wildum deleted the fix-kafka-topics-match branch January 8, 2025 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/docs Docs Squad label across all Grafana Labs repos
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants