log failure reason for healthcheck

develop
Felix Kronlage-Dammers 5 months ago
parent 42d152a2f4
commit 1ea5db9359

@ -484,9 +484,13 @@ func HealthRequest(w http.ResponseWriter, r *http.Request) {
timeout := time.Now().Add(-time.Minute * time.Duration(int64(interval)))
if last.Before(timeout) {
if authedRequest {
msg = fmt.Sprintf("Probe '%s' has not come back in time. Last message from '%s'", k.Name, k.LastData)
} else {
msg = fmt.Sprintf("Probe '%s' has not come back in time. Last message from '%s'", k.Name, k.LastData)
log.WithFields(logrus.Fields{
"msg": msg,
}).Error("Health-Check error")
if !authedRequest {
msg = ""
}

Loading…
Cancel
Save