From 4b2198d7ec47d50989b7c2df66b7b207c32f7f6e Mon Sep 17 00:00:00 2001 From: Ganesh Vernekar <15064823+codesome@users.noreply.github.com> Date: Fri, 22 Jul 2022 13:47:51 +0530 Subject: [PATCH] Do not double count in OOO histogram (#300) Signed-off-by: Ganesh Vernekar --- tsdb/head_append.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tsdb/head_append.go b/tsdb/head_append.go index 6aa62083d..047701bf5 100644 --- a/tsdb/head_append.go +++ b/tsdb/head_append.go @@ -552,7 +552,7 @@ func (a *headAppender) Commit() (err error) { series = a.sampleSeries[i] series.Lock() - oooSample, delta, err := series.appendable(s.T, s.V, a.headMaxt, a.minValidTime, oooTimeWindow) + oooSample, _, err := series.appendable(s.T, s.V, a.headMaxt, a.minValidTime, oooTimeWindow) switch err { case storage.ErrOutOfOrderSample: samplesAppended-- @@ -615,7 +615,7 @@ func (a *headAppender) Commit() (err error) { // - the sample.t is beyond any previously ingested timestamp // - the sample is an exact duplicate of the 'head sample' - delta, ok, chunkCreated = series.append(s.T, s.V, a.appendID, a.head.chunkDiskMapper) + _, ok, chunkCreated = series.append(s.T, s.V, a.appendID, a.head.chunkDiskMapper) // TODO: handle overwrite. // this would be storage.ErrDuplicateSampleForTimestamp, it has no attached counter @@ -634,9 +634,6 @@ func (a *headAppender) Commit() (err error) { } } - if delta > 0 { - a.head.metrics.oooHistogram.Observe(float64(delta) / 1000) - } if chunkCreated { a.head.metrics.chunks.Inc() a.head.metrics.chunksCreated.Inc()