tsdb: Add staleness handling for FloatHistogram

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
This commit is contained in:
Ganesh Vernekar 2022-12-28 14:48:39 +05:30
parent e555469ba1
commit 2820e327db
No known key found for this signature in database
GPG Key ID: F056451B52F1DC34
1 changed files with 6 additions and 3 deletions

View File

@ -350,9 +350,12 @@ func (a *headAppender) Append(ref storage.SeriesRef, lset labels.Labels, t int64
} }
} }
if value.IsStaleNaN(v) && s.lastHistogramValue != nil { if value.IsStaleNaN(v) {
// TODO(marctc): do we have do to the same for float histograms? if s.lastHistogramValue != nil {
return a.AppendHistogram(ref, lset, t, &histogram.Histogram{Sum: v}, nil) return a.AppendHistogram(ref, lset, t, &histogram.Histogram{Sum: v}, nil)
} else if s.lastFloatHistogramValue != nil {
return a.AppendHistogram(ref, lset, t, nil, &histogram.FloatHistogram{Sum: v})
}
} }
s.Lock() s.Lock()