From 153cb0cbe3c3c5ed16ed72207463bd66e7d21b4d Mon Sep 17 00:00:00 2001 From: Krasi Georgiev Date: Tue, 5 Sep 2017 13:55:14 +0300 Subject: [PATCH] scraping errors will show in the log when debug mode is enabled (#3135) Signed-off-by: Krasi Georgiev --- retrieval/scrape.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/retrieval/scrape.go b/retrieval/scrape.go index 16ca5ecf7..044d62e0c 100644 --- a/retrieval/scrape.go +++ b/retrieval/scrape.go @@ -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,