Browse Source

Fix scrape failure logs

Before this change, logs would show like:

```
{...,"target":"http://localhost:8080/metrics","!BADKEY":"Get ..."}
```

After this change

```
{...,"msg":"Get ...","job_name":...,"target":...}
```

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
pull/12826/head
Simon Pasquier 2 weeks ago committed by Ayoub Mrini
parent
commit
37f3f3f2db
  1. 2
      scrape/scrape.go

2
scrape/scrape.go

@ -1421,7 +1421,7 @@ func (sl *scrapeLoop) scrapeAndReport(last, appendTime time.Time, errc chan<- er
sl.l.Debug("Scrape failed", "err", scrapeErr) sl.l.Debug("Scrape failed", "err", scrapeErr)
sl.scrapeFailureLoggerMtx.RLock() sl.scrapeFailureLoggerMtx.RLock()
if sl.scrapeFailureLogger != nil { if sl.scrapeFailureLogger != nil {
sl.scrapeFailureLogger.Error("err", scrapeErr) sl.scrapeFailureLogger.Error(scrapeErr.Error())
} }
sl.scrapeFailureLoggerMtx.RUnlock() sl.scrapeFailureLoggerMtx.RUnlock()
if errc != nil { if errc != nil {

Loading…
Cancel
Save