mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-26 05:01:23 -08:00
Put end of run staleness handler in seperate function.
Improve log message.
This commit is contained in:
parent
d532272520
commit
8b9d3e7547
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue