mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Check storage.ErrNotFound in labelValuesFromSeries
I'm not very comfortable with using an equality check on errors, but I'm
copying the same code from Prometheus:
f711d71aa8/tsdb/querier.go (L532-L533)
Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
This commit is contained in:
parent
002ae0aa1d
commit
88ad42fb38
|
@ -434,6 +434,10 @@ func labelValuesFromSeries(r IndexReader, labelName string, refs []storage.Serie
|
|||
var builder labels.ScratchBuilder
|
||||
for _, ref := range refs {
|
||||
err := r.Series(ref, &builder, nil)
|
||||
// Postings may be stale. Skip if no underlying series exists.
|
||||
if errors.Cause(err) == storage.ErrNotFound {
|
||||
continue
|
||||
}
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "label values for label %s", labelName)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue