Skip to content

[filebeat] Add sticky partition rebalance strategy to Kafka input#50900

Open
lucabelluccini wants to merge 5 commits into
elastic:mainfrom
lucabelluccini:filebeat/kafka-input-sticky-partitions
Open

[filebeat] Add sticky partition rebalance strategy to Kafka input#50900
lucabelluccini wants to merge 5 commits into
elastic:mainfrom
lucabelluccini:filebeat/kafka-input-sticky-partitions

Conversation

@lucabelluccini
Copy link
Copy Markdown
Contributor

@lucabelluccini lucabelluccini commented May 25, 2026

Summary

  • Adds support for the sticky partition rebalance strategy to the Filebeat Kafka input.
  • Allows users to configure sticky as the rebalance.strategy option, which minimises partition movement across rebalances for improved consumer stability.

Test plan

  • Unit tests pass (go test ./filebeat/input/kafka/...)
  • Manually verify Kafka input with rebalance.strategy: sticky connects and consumes messages correctly
  • Verify existing rebalance strategies (range, roundrobin) are unaffected

🤖 Generated with Claude Code

Adds support for the `sticky` rebalance strategy (KIP-54) in the
Filebeat Kafka input, complementing the existing `range` and
`roundrobin` options. Sticky assignment minimizes partition movement
across consumer group rebalances, reducing reprocessing and improving
throughput stability in dynamic environments.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lucabelluccini lucabelluccini requested review from a team as code owners May 25, 2026 11:20
@botelastic botelastic Bot added the needs_team Indicates that the issue/PR needs a Team:* label label May 25, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)
  • /test : Run the Buildkite pipeline.

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 25, 2026

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @lucabelluccini? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 25, 2026

🔍 Preview links for changed docs

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 25, 2026

✅ Vale Linting Results

No issues found on modified lines!


The Vale linter checks documentation changes against the Elastic Docs style guide.

To use Vale locally or report issues, refer to Elastic style guide for Vale.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 25, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 44c5b3c5-7c3d-4588-8d99-d13a888075fc

📥 Commits

Reviewing files that changed from the base of the PR and between 371e789 and 13a0db0.

📒 Files selected for processing (1)
  • filebeat/input/kafka/kafka_integration_test.go

📝 Walkthrough

Walkthrough

This PR adds support for the sticky Kafka consumer group rebalance strategy to Filebeat's Kafka input. The implementation adds a new rebalanceStrategySticky enum constant, registers "sticky" in the configuration mapping, and maps the enum value to Sarama's sticky rebalance implementation. Documentation is updated to reflect the new strategy option alongside the existing "range" (default) and "roundrobin" strategies.

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • 🛠️ Update Documentation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cmacknz cmacknz requested a review from khushijain21 May 26, 2026 19:30
@cmacknz cmacknz added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label May 26, 2026
@infra-vault-gh-plugin-prod
Copy link
Copy Markdown

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@botelastic botelastic Bot removed the needs_team Indicates that the issue/PR needs a Team:* label label May 26, 2026
@cmacknz
Copy link
Copy Markdown
Member

cmacknz commented May 26, 2026

@khushijain21 how much work is it to support this in the kafkaexporter too? Looks like it is supported in franz-go.

We can introduce this as long as we can support it for beats receivers going forward as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants