diff --git a/retrieval/target.go b/retrieval/target.go index 3e2a22f67..7c4ba49f0 100644 --- a/retrieval/target.go +++ b/retrieval/target.go @@ -277,6 +277,13 @@ func (t *target) RunScraper(ingester extraction.Ingester, interval time.Duration // actual scrape interval increase as long as a scrape takes // longer than the interval we are aiming for. time.Sleep(took - interval) + // After the sleep, we should check again if we have been stopped. + select { + case <-t.scraperStopping: + return + default: + // Do nothing. + } t.scrape(ingester) } }