fix: Properly put OM text p.CreatedTimestamp behind feature flag (#14809) (#14815)

Mitigates https://github.com/prometheus/prometheus/issues/14808

Signed-off-by: Manik Rana <manikrana54@gmail.com>
Co-authored-by: Manik Rana <Manikrana54@gmail.com>
This commit is contained in:
Bartlomiej Plotka 2024-09-03 08:33:44 +02:00 committed by GitHub
parent 442f24e099
commit f1d3c3f464
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1655,7 +1655,8 @@ loop:
if seriesAlreadyScraped && parsedTimestamp == nil { if seriesAlreadyScraped && parsedTimestamp == nil {
err = storage.ErrDuplicateSampleForTimestamp err = storage.ErrDuplicateSampleForTimestamp
} else { } else {
if ctMs := p.CreatedTimestamp(); sl.enableCTZeroIngestion && ctMs != nil { if sl.enableCTZeroIngestion {
if ctMs := p.CreatedTimestamp(); ctMs != nil {
ref, err = app.AppendCTZeroSample(ref, lset, t, *ctMs) ref, err = app.AppendCTZeroSample(ref, lset, t, *ctMs)
if err != nil && !errors.Is(err, storage.ErrOutOfOrderCT) { // OOO is a common case, ignoring completely for now. if err != nil && !errors.Is(err, storage.ErrOutOfOrderCT) { // OOO is a common case, ignoring completely for now.
// CT is an experimental feature. For now, we don't need to fail the // CT is an experimental feature. For now, we don't need to fail the
@ -1663,6 +1664,7 @@ loop:
level.Debug(sl.l).Log("msg", "Error when appending CT in scrape loop", "series", string(met), "ct", *ctMs, "t", t, "err", err) level.Debug(sl.l).Log("msg", "Error when appending CT in scrape loop", "series", string(met), "ct", *ctMs, "t", t, "err", err)
} }
} }
}
if isHistogram && sl.enableNativeHistogramIngestion { if isHistogram && sl.enableNativeHistogramIngestion {
if h != nil { if h != nil {