You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
filebeat kafka input: add group_instance_id for static group membership (#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>
Copy file name to clipboardExpand all lines: docs/reference/filebeat/filebeat-input-kafka.md
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,6 +128,25 @@ stack: ga 9.3.8+, ga 9.4.4+, ga 9.5
128
128
How often the consumer sends heartbeats to the broker. This must be lower than `session_timeout`, and is typically set to no more than a third of that value. Default is 3s.
129
129
130
130
131
+
### `group_instance_id` [_group_instance_id]
132
+
```{applies_to}
133
+
stack: ga 9.3+
134
+
```
135
+
136
+
A stable identifier that enables Kafka static group membership ([KIP-345](https://cwiki.apache.org/confluence/display/KAFKA/KIP-345%3A+Introduce+static+membership+protocol+to+reduce+consumer+rebalances)). When set, a consumer that restarts and rejoins the group within [`session_timeout`](#_session_timeout) is recognized as the same member and keeps its partition assignment, avoiding the rebalances that a rolling restart of multiple instances would otherwise trigger. Requires `version` to be at least `2.3.0`.
137
+
138
+
Each consumer instance sharing a `group_id` must use a **unique** `group_instance_id`. Two live members with the same value cause the broker to fence one of them. Set `group_instance_id` to a value that is unique to each consumer instance and stable across restarts. The option is unset by default, in which case the consumer uses dynamic membership.
139
+
140
+
```yaml
141
+
- type: kafka
142
+
hosts: ["kafka-broker:9092"]
143
+
topics: ["my-topic"]
144
+
group_id: "filebeat"
145
+
version: "2.3.0"
146
+
group_instance_id: "<unique-instance-id>"
147
+
```
148
+
149
+
131
150
### `max_wait_time` [_max_wait_time]
132
151
133
152
How long to wait for the minimum number of input bytes while reading. Default is 250ms.
0 commit comments