filebeat kafka input: add group_instance_id for static group membership#51772
Conversation
🤖 GitHub commentsJust comment with:
|
|
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
🔍 Preview links for changed docs |
✅ Elastic Docs Style Checker (Vale)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. |
This comment has been minimized.
This comment has been minimized.
51da21c to
734c1bd
Compare
The Kafka input now has a `group_instance_id` option wiring it to Consumer.Group.InstanceId (KIP-345): a member that rejoins within `session_timeout` keeps its partitions instead of rebalancing. Static membership needs Kafka `version` >= 2.3.0, so the input fails fast with a clear error when it is set on the default 2.1.0. Unset by default; existing configs are unaffected. Assisted-By: Claude Code
734c1bd to
e824cfc
Compare
There was a problem hiding this comment.
Pull request overview
Adds support for Kafka static group membership (KIP-345) to the Filebeat Kafka input by exposing a new group_instance_id setting and wiring it through to Sarama, including a version gate to fail fast when used with Kafka protocol versions older than 2.3.0.
Changes:
- Add
group_instance_idto the Kafka input configuration and propagate it tosarama.Config.Consumer.Group.InstanceId. - Enforce a minimum Kafka protocol
versionof>= 2.3.0whengroup_instance_idis set, returning a clear error otherwise. - Update reference configs, documentation, tests, and add a changelog fragment for the new option.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| x-pack/filebeat/filebeat.reference.yml | Documents the new group_instance_id option in the x-pack Filebeat reference config. |
| filebeat/input/kafka/config.go | Adds GroupInstanceID config wiring and an early version gate for static membership support. |
| filebeat/input/kafka/config_test.go | Adds unit tests for default behavior, successful propagation, version gating, and invalid IDs. |
| filebeat/filebeat.reference.yml | Documents the new group_instance_id option in the OSS Filebeat reference config. |
| filebeat/_meta/config/filebeat.inputs.reference.yml.tmpl | Updates the reference config template so generated configs include group_instance_id docs. |
| docs/reference/filebeat/filebeat-input-kafka.md | Adds a new docs section describing group_instance_id, requirements, and usage. |
| changelog/fragments/1783416326-filebeat-kafka-group-instance-id.yaml | Adds a changelog fragment announcing the new Kafka input option. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
|
@orestisfl, @khushijain21, when you have some time, please review this PR. |
|
@orestisfl, @khushijain21 when you have some time, could you review this? thanks! |
This comment has been minimized.
This comment has been minimized.
khushijain21
left a comment
There was a problem hiding this comment.
Looks straightforward to me!
TL;DRBuild 49267 has two Filebeat Python integration failures, and neither is attributable to this PR. The Kafka module case timed out waiting for its Elasticsearch index with no Beat output captured; the system-auth case processed a different SSH journal event than the checked-in golden file. Retry the affected jobs first. Remediation
Investigation detailsRoot Cause
The PR diff changes only Evidence
Verification
What is this? | From workflow: PR Buildkite Detective Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |
|
@Mergifyio backport 9.5 9.4 9.3 |
❌ No backport have been createdDetails
Git reported the following error:
|
…ip (#51772) (#51887) * filebeat kafka input: add group_instance_id for static group membership The Kafka input now has a `group_instance_id` option wiring it to Consumer.Group.InstanceId (KIP-345): a member that rejoins within `session_timeout` keeps its partitions instead of rebalancing. Static membership needs Kafka `version` >= 2.3.0, so the input fails fast with a clear error when it is set on the default 2.1.0. Unset by default; existing configs are unaffected. Assisted-By: Claude Code (cherry picked from commit 6811ebc) Co-authored-by: Anderson Queiroz <anderson.queiroz@elastic.co>
…ip (#51772) (#51886) * filebeat kafka input: add group_instance_id for static group membership The Kafka input now has a `group_instance_id` option wiring it to Consumer.Group.InstanceId (KIP-345): a member that rejoins within `session_timeout` keeps its partitions instead of rebalancing. Static membership needs Kafka `version` >= 2.3.0, so the input fails fast with a clear error when it is set on the default 2.1.0. Unset by default; existing configs are unaffected. Assisted-By: Claude Code (cherry picked from commit 6811ebc) Co-authored-by: Anderson Queiroz <anderson.queiroz@elastic.co>
…ip (#51772) (#51885) * filebeat kafka input: add group_instance_id for static group membership The Kafka input now has a `group_instance_id` option wiring it to Consumer.Group.InstanceId (KIP-345): a member that rejoins within `session_timeout` keeps its partitions instead of rebalancing. Static membership needs Kafka `version` >= 2.3.0, so the input fails fast with a clear error when it is set on the default 2.1.0. Unset by default; existing configs are unaffected. Assisted-By: Claude Code (cherry picked from commit 6811ebc) Co-authored-by: Anderson Queiroz <anderson.queiroz@elastic.co>
Proposed commit message
Checklist
./changelog/fragmentsusing the changelog tool.Disruptive User Impact
None by default — the option is opt-in and unset out of the box; existing
configurations are unchanged. When enabled, operators should be aware:
versionmust be >= 2.3.0; otherwise the input fails fast with a clearerror.
group_idmust use a uniquegroup_instance_id.reassigned until
session_timeoutexpires — that is the intended trade-off;tune
session_timeoutaccordingly.How to test this PR locally
Unit tests:
Friendly version gate (no broker needed) — configure the input with
group_instance_idset butversionleft at the default and confirm startupfails with
group_instance_id requires 'version' >= 2.3.0 ....End-to-end (optional, needs a broker >= 2.3.0): run two Filebeat instances that
share a
group_id, each with a distinctgroup_instance_idandversion: "2.3.0";restart one instance and confirm the group does not rebalance within
session_timeout(no partition reassignment in the broker logs).Related issues
group_instance_id, KIP-345) #51768Use cases
Multi-replica, containerized Filebeat consuming a high-throughput Kafka topic.
Setting a stable per-instance
group_instance_idlets rolling restarts completewithout cascading rebalances, keeping consumption steady.