From eca6134bd3a87757439d094b1d9e6845da5f1e7f Mon Sep 17 00:00:00 2001 From: DylanGuedes Date: Thu, 19 Sep 2024 11:18:05 -0300 Subject: [PATCH] Report PSRL error message. --- pkg/ingester/stream.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/ingester/stream.go b/pkg/ingester/stream.go index fe4a644c71109..8f20f45dca933 100644 --- a/pkg/ingester/stream.go +++ b/pkg/ingester/stream.go @@ -452,6 +452,10 @@ func (s *stream) validateEntries(ctx context.Context, entries []logproto.Entry, failedEntriesWithError = make([]entryWithError, 0, len(toStore)) for i := 0; i < len(toStore); i++ { failedEntriesWithError = append(failedEntriesWithError, entryWithError{&toStore[i], &validation.ErrStreamRateLimit{RateLimit: flagext.ByteSize(limit), Labels: s.labelsString, Bytes: flagext.ByteSize(len(toStore[i].Line))}}) + if i == 0 { + // only report PSRL write failure once. + s.writeFailures.Log(s.tenant, failedEntriesWithError[len(failedEntriesWithError)-1].e) + } rateLimitedBytes += len(toStore[i].Line) } }