fix: Correctly handle the deprecated topic field in otelcol.receiver.kafka configuration#5726
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes otelcol.receiver.kafka conversion logic to correctly handle the deprecated per-signal topic attribute by migrating it into the new topics field, aligning with upstream Kafka receiver behavior.
Changes:
- Add migration logic during conversion so
topic(singular, deprecated) becomestopics(slice) in the generatedkafkareceiver.Config. - Emit a warning log when the deprecated
topicattribute is used. - Add a unit test to ensure deprecated
topicis migrated and cleared in the converted config.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/component/otelcol/receiver/kafka/kafka.go | Migrates deprecated topic into topics, logs deprecation usage, and validates the resulting upstream config. |
| internal/component/otelcol/receiver/kafka/kafka_test.go | Adds coverage verifying topic → topics migration for logs/metrics/traces. |
kalleep
approved these changes
Mar 9, 2026
grafana-alloybot Bot
pushed a commit
that referenced
this pull request
Mar 9, 2026
…kafka configuration (#5726) <!-- CONTRIBUTORS GUIDE: https://github.com/grafana/alloy/blob/main/docs/developer/contributing.md If this is your first PR or you have not contributed in a while, we recommend taking the time to review the guide. **NOTE** Your PR title must adhere to Conventional Commit style. For details on this, check out the Contributors Guide linked above. --> ### Brief description of Pull Request Fixes otelcol.receiver.kafka conversion logic to correctly handle the deprecated per-signal topic attribute by migrating it into the new topics field, aligning with upstream Kafka receiver behavior. <!-- Add a human-readable description of the PR that may be used as the commit body (i.e. "Extended description") when it gets merged. --> ### Pull Request Details The documentation was already correct and doesn't require updates. <!-- Add a more detailed descripion of the Pull Request here, if needed. --> ### Issue(s) fixed by this Pull Request <!-- Uncomment the following line and fill in an issue number if you want a GitHub issue to be closed automatically when this PR gets merged. --> <!-- Fixes #issue_id --> ### Notes to the Reviewer <!-- Add any relevant notes for the reviewers and testers of this PR. --> ### PR Checklist <!-- Remove items that do not apply. For completed items, change [ ] to [x]. --> - [x] Documentation added - [x] Tests updated - [ ] Config converters updated (cherry picked from commit 538ac75)
3 tasks
thampiotr
added a commit
that referenced
this pull request
Mar 9, 2026
…kafka configuration [backport] (#5730) ## Backport of #5726 This PR backports #5726 to release/v1.14. ### Original PR Author @thampiotr ### Description <!-- CONTRIBUTORS GUIDE: https://github.com/grafana/alloy/blob/main/docs/developer/contributing.md If this is your first PR or you have not contributed in a while, we recommend taking the time to review the guide. **NOTE** Your PR title must adhere to Conventional Commit style. For details on this, check out the Contributors Guide linked above. --> ### Brief description of Pull Request Fixes otelcol.receiver.kafka conversion logic to correctly handle the deprecated per-signal topic attribute by migrating it into the new topics field, aligning with upstream Kafka receiver behavior. <!-- Add a human-readable description of the PR that may be used as the commit body (i.e. "Extended description") when it gets merged. --> ### Pull Request Details The documentation was already correct and doesn't require updates. <!-- Add a more detailed descripion of the Pull Request here, if needed. --> ### Issue(s) fixed by this Pull Request <!-- Uncomment the following line and fill in an issue number if you want a GitHub issue to be closed automatically when this PR gets merged. --> <!-- Fixes #issue_id --> ### Notes to the Reviewer <!-- Add any relevant notes for the reviewers and testers of this PR. --> ### PR Checklist <!-- Remove items that do not apply. For completed items, change [ ] to [x]. --> - [x] Documentation added - [x] Tests updated - [ ] Config converters updated --- *This backport was created automatically.* Co-authored-by: Piotr <17101802+thampiotr@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Brief description of Pull Request
Fixes otelcol.receiver.kafka conversion logic to correctly handle the deprecated per-signal topic attribute by migrating it into the new topics field, aligning with upstream Kafka receiver behavior.
Pull Request Details
The documentation was already correct and doesn't require updates.
Issue(s) fixed by this Pull Request
Notes to the Reviewer
PR Checklist