lib/promscrape: code cleanup: send stale markers immediately after generating automatic metrics

This cleanup has been extracted from https://github.com/VictoriaMetrics/VictoriaMetrics/pull/5557/files#diff-6b205cf6637d7b65a5c45d9417d08822d4efad94227268cb196f61aa2a0fc0f7
This commit is contained in:
Aliaksandr Valialkin 2024-01-21 05:18:08 +02:00
parent e15f07d989
commit be5faef552
No known key found for this signature in database
GPG key ID: 52C003EE2BCDB9EB

View file

@ -832,9 +832,9 @@ func (sw *scrapeWork) sendStaleSeries(lastScrape, currScrape string, timestamp i
if addAutoSeries {
am := &autoMetrics{}
sw.addAutoMetrics(am, wc, timestamp)
setStaleMarkersForRows(wc.writeRequest.Timeseries)
sw.pushData(sw.Config.AuthToken, &wc.writeRequest)
}
setStaleMarkersForRows(wc.writeRequest.Timeseries)
sw.pushData(sw.Config.AuthToken, &wc.writeRequest)
}
func setStaleMarkersForRows(series []prompbmarshal.TimeSeries) {