scraping errors will show in the log when debug mode is enabled (#3135)

Signed-off-by: Krasi Georgiev <krasi.root@gmail.com>
This commit is contained in:
Krasi Georgiev 2017-09-05 13:55:14 +03:00 committed by Brian Brazil
parent c70379e1c7
commit 153cb0cbe3

View file

@ -637,8 +637,11 @@ mainLoop:
var b []byte
if scrapeErr == nil {
b = buf.Bytes()
} else if errc != nil {
errc <- scrapeErr
} else {
sl.l.With("err", scrapeErr.Error()).Debug("scrape failed")
if errc != nil {
errc <- scrapeErr
}
}
// A failed scrape is the same as an empty scrape,