[tsdb] Add CounterResetHint: CounterReset to synthetic zero sample (#17011)

Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com>
This commit is contained in:
Minh Nguyen 2025-08-22 00:26:01 +03:00 committed by GitHub
parent 954cad35b2
commit c8deefb038
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -781,7 +781,10 @@ func (a *headAppender) AppendHistogramCTZeroSample(ref storage.SeriesRef, lset l
switch {
case h != nil:
zeroHistogram := &histogram.Histogram{}
zeroHistogram := &histogram.Histogram{
// The CTZeroSample represents a counter reset by definition.
CounterResetHint: histogram.CounterReset,
}
s.Lock()
// TODO(krajorama): reorganize Commit() to handle samples in append order
@ -819,7 +822,10 @@ func (a *headAppender) AppendHistogramCTZeroSample(ref storage.SeriesRef, lset l
})
a.histogramSeries = append(a.histogramSeries, s)
case fh != nil:
zeroFloatHistogram := &histogram.FloatHistogram{}
zeroFloatHistogram := &histogram.FloatHistogram{
// The CTZeroSample represents a counter reset by definition.
CounterResetHint: histogram.CounterReset,
}
s.Lock()
// TODO(krajorama): reorganize Commit() to handle samples in append order