diff --git a/lib/promscrape/config.go b/lib/promscrape/config.go index 28e5959c6..dc32daf2a 100644 --- a/lib/promscrape/config.go +++ b/lib/promscrape/config.go @@ -737,7 +737,7 @@ func (swc *scrapeWorkConfig) getScrapeWork(target string, extraLabels, metaLabel return sw, nil } sw, err := swc.getScrapeWorkReal(target, extraLabels, metaLabels) - if err != nil { + if err == nil { swc.cache.Set(string(bb.B), sw) } return sw, err