Skip to content

Commit

Permalink
* Fixes #14906 - Kafka output dropping messages due to size, but does…
Browse files Browse the repository at this point in the history
…n’t increment the “failed” counter. (#14930) (#14973)
  • Loading branch information
imriz authored and faec committed Dec 9, 2019
1 parent df4a03d commit 3a6c77b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libbeat/outputs/kafka/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,13 @@ func (r *msgRef) fail(msg *message, err error) {
switch err {
case sarama.ErrInvalidMessage:
logp.Err("Kafka (topic=%v): dropping invalid message", msg.topic)
r.client.observer.Dropped(1)

case sarama.ErrMessageSizeTooLarge, sarama.ErrInvalidMessageSize:
logp.Err("Kafka (topic=%v): dropping too large message of size %v.",
msg.topic,
len(msg.key)+len(msg.value))
r.client.observer.Dropped(1)

default:
r.failed = append(r.failed, msg.data)
Expand Down

0 comments on commit 3a6c77b

Please sign in to comment.