diff --git a/pkg/ingester/stream.go b/pkg/ingester/stream.go index fe4a644c71109..d1577b1d2fffe 100644 --- a/pkg/ingester/stream.go +++ b/pkg/ingester/stream.go @@ -454,6 +454,9 @@ func (s *stream) validateEntries(ctx context.Context, entries []logproto.Entry, failedEntriesWithError = append(failedEntriesWithError, entryWithError{&toStore[i], &validation.ErrStreamRateLimit{RateLimit: flagext.ByteSize(limit), Labels: s.labelsString, Bytes: flagext.ByteSize(len(toStore[i].Line))}}) rateLimitedBytes += len(toStore[i].Line) } + + // Log the only last error to the write failures manager. + s.writeFailures.Log(s.tenant, failedEntriesWithError[len(failedEntriesWithError)-1].e) } s.streamRateCalculator.Record(s.tenant, s.labelHash, s.labelHashNoShard, totalBytes)