Skip to content

Commit

Permalink
Merge pull request #120 from chattarajoy/fixErrorlog
Browse files Browse the repository at this point in the history
Fix error log to include scrape_id
  • Loading branch information
SuperQ committed Feb 12, 2022
2 parents e57027a + ffc9de7 commit ed5e271
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/proxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,11 @@ func (h *httpHandler) handlePush(w http.ResponseWriter, r *http.Request) {
http.Error(w, fmt.Sprintf("Error pushing: %s", err.Error()), 500)
return
}
level.Info(h.logger).Log("msg", "Got /push", "scrape_id", scrapeResult.Header.Get("Id"))
scrapeId := scrapeResult.Header.Get("Id")
level.Info(h.logger).Log("msg", "Got /push", "scrape_id", scrapeId)
err = h.coordinator.ScrapeResult(scrapeResult)
if err != nil {
level.Error(h.logger).Log("msg", "Error pushing:", "err", err, "scrape_id", scrapeResult.Header.Get("Id"))
level.Error(h.logger).Log("msg", "Error pushing:", "err", err, "scrape_id", scrapeId)
http.Error(w, fmt.Sprintf("Error pushing: %s", err.Error()), 500)
}
}
Expand Down

0 comments on commit ed5e271

Please sign in to comment.