From 243419c0074972b144e4b1cf9ac035f9a2772eac Mon Sep 17 00:00:00 2001 From: Goutham Veeramachaneni Date: Thu, 6 Jul 2017 14:18:31 +0200 Subject: [PATCH] Return tsdb.ErrOutOfBounds as storage.ErrOutOfBounds Signed-off-by: Goutham Veeramachaneni --- retrieval/scrape.go | 2 +- storage/tsdb/tsdb.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/retrieval/scrape.go b/retrieval/scrape.go index f6850d2ee..73873e98c 100644 --- a/retrieval/scrape.go +++ b/retrieval/scrape.go @@ -852,7 +852,7 @@ loop: sl.l.With("numDropped", numDuplicates).Warn("Error on ingesting samples with different value but same timestamp") } if numOutOfBounds > 0 { - sl.l.With("numOutOfBounds", numOutOfBounds).Warn("Error on ingesting samples that are too old") + sl.l.With("numOutOfBounds", numOutOfBounds).Warn("Error on ingesting samples that are too old or are too far into the future") } if err == nil { sl.cache.forEachStale(func(lset labels.Labels) bool { diff --git a/storage/tsdb/tsdb.go b/storage/tsdb/tsdb.go index 19dbe38ff..23d950382 100644 --- a/storage/tsdb/tsdb.go +++ b/storage/tsdb/tsdb.go @@ -125,6 +125,8 @@ func (a appender) Add(lset labels.Labels, t int64, v float64) (string, error) { return "", storage.ErrOutOfOrderSample case tsdb.ErrAmendSample: return "", storage.ErrDuplicateSampleForTimestamp + case tsdb.ErrOutOfBounds: + return "", storage.ErrOutOfBounds } return ref, err } @@ -139,6 +141,8 @@ func (a appender) AddFast(ref string, t int64, v float64) error { return storage.ErrOutOfOrderSample case tsdb.ErrAmendSample: return storage.ErrDuplicateSampleForTimestamp + case tsdb.ErrOutOfBounds: + return storage.ErrOutOfBounds } return err }