diff --git a/retrieval/scrape.go b/retrieval/scrape.go index 3e5e41db3..d04d07313 100644 --- a/retrieval/scrape.go +++ b/retrieval/scrape.go @@ -505,7 +505,7 @@ mainLoop: // The append failed, probably due to a parse error. // Call sl.append again with an empty scrape to trigger stale markers. if _, _, err = sl.append([]byte{}, start); err != nil { - log.With("err", err).Error("failure append failed") + log.With("err", err).Error("append failed") } } @@ -524,6 +524,10 @@ mainLoop: close(sl.stopped) + sl.endOfRunStaleness(last, ticker, interval) +} + +func (sl *scrapeLoop) endOfRunStaleness(last time.Time, ticker *time.Ticker, interval time.Duration) { // Scraping has stopped. We want to write stale markers but // the target may be recreated, so we wait just over 2 scrape intervals // before creating them.