diff --git a/storage/remote/queue_manager.go b/storage/remote/queue_manager.go index 40a74fe58..e36a6c987 100644 --- a/storage/remote/queue_manager.go +++ b/storage/remote/queue_manager.go @@ -680,9 +680,9 @@ func (s *shards) runShard(ctx context.Context, i int, queue chan prompb.TimeSeri } case <-timer.C: - if len(pendingSamples) > 0 { - level.Debug(s.qm.logger).Log("msg", "runShard timer ticked, sending samples", "samples", len(pendingSamples), "shard", shardNum) - n := len(pendingSamples) + n := len(pendingSamples) + if n > 0 { + level.Debug(s.qm.logger).Log("msg", "runShard timer ticked, sending samples", "samples", n, "shard", shardNum) s.sendSamples(ctx, pendingSamples, &buf) pendingSamples = pendingSamples[:0] s.qm.pendingSamplesMetric.Sub(float64(n))