diff --git a/pkg/promtail/client.go b/pkg/promtail/client.go index 69e10ec45f20..4379ede2ccc5 100644 --- a/pkg/promtail/client.go +++ b/pkg/promtail/client.go @@ -109,9 +109,11 @@ func (c *Client) run() { if err := c.send(batch); err != nil { level.Error(c.logger).Log("msg", "error sending batch", "error", err) } + batchSize = 0 batch = map[model.Fingerprint]*logproto.Stream{} } + batchSize += len(e.Line) fp := e.labels.FastFingerprint() stream, ok := batch[fp] if !ok { @@ -126,6 +128,7 @@ func (c *Client) run() { if err := c.send(batch); err != nil { level.Error(c.logger).Log("msg", "error sending batch", "error", err) } + batchSize = 0 batch = map[model.Fingerprint]*logproto.Stream{} } }