diff --git a/tsdb/exemplar.go b/tsdb/exemplar.go index e6e6cb4941..8eb34a4c6e 100644 --- a/tsdb/exemplar.go +++ b/tsdb/exemplar.go @@ -121,6 +121,9 @@ func (ce *CircularExemplarStorage) Select(start, end int64, matchers ...[]*label for _, idx := range ce.index { var se exemplar.QueryResult e := ce.exemplars[idx.oldest] + if e.exemplar.Ts > end || ce.exemplars[idx.newest].exemplar.Ts < start { + continue + } if !matchesSomeMatcherSet(e.seriesLabels, matchers) { continue }