Return tsdb.ErrOutOfBounds as storage.ErrOutOfBounds

Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
This commit is contained in:
Goutham Veeramachaneni 2017-07-06 14:18:31 +02:00
parent 24e9deac71
commit 243419c007
2 changed files with 5 additions and 1 deletions

View File

@ -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 {

View File

@ -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
}