diff --git a/main.go b/main.go index 199846fd7..e8f8ab7a7 100644 --- a/main.go +++ b/main.go @@ -218,11 +218,9 @@ func (p *prometheus) Serve() { }() for samples := range p.unwrittenSamples { - if len(samples) > 0 { - p.storage.AppendSamples(samples) - if p.remoteTSDBQueue != nil { - p.remoteTSDBQueue.Queue(samples) - } + p.storage.AppendSamples(samples) + if p.remoteTSDBQueue != nil { + p.remoteTSDBQueue.Queue(samples) } } diff --git a/storage/remote/queue_manager.go b/storage/remote/queue_manager.go index 526400911..71bae548e 100644 --- a/storage/remote/queue_manager.go +++ b/storage/remote/queue_manager.go @@ -115,6 +115,9 @@ func NewTSDBQueueManager(tsdb TSDBClient, queueCapacity int) *TSDBQueueManager { // Queue queues a sample batch to be sent to the TSDB. It drops the most // recently queued samples on the floor if the queue is full. func (t *TSDBQueueManager) Queue(s clientmodel.Samples) { + if len(s) == 0 { + return + } select { case t.queue <- s: default: