|
|
@ -471,7 +471,7 @@ func (sl *scrapeLoop) run(interval, timeout time.Duration, errc chan<- error) {
|
|
|
|
var (
|
|
|
|
var (
|
|
|
|
total, added int
|
|
|
|
total, added int
|
|
|
|
start = time.Now()
|
|
|
|
start = time.Now()
|
|
|
|
scrapeCtx, _ = context.WithTimeout(sl.ctx, timeout)
|
|
|
|
scrapeCtx, cancel = context.WithTimeout(sl.ctx, timeout)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// Only record after the first scrape.
|
|
|
|
// Only record after the first scrape.
|
|
|
@ -482,6 +482,7 @@ func (sl *scrapeLoop) run(interval, timeout time.Duration, errc chan<- error) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
err := sl.scraper.scrape(scrapeCtx, buf)
|
|
|
|
err := sl.scraper.scrape(scrapeCtx, buf)
|
|
|
|
|
|
|
|
cancel()
|
|
|
|
if err == nil {
|
|
|
|
if err == nil {
|
|
|
|
b := buf.Bytes()
|
|
|
|
b := buf.Bytes()
|
|
|
|
|
|
|
|
|
|
|
|