DE-3247 | updated logging for failing requests
This commit is contained in:
@@ -70,7 +70,12 @@ func eventsHandlerJson(workerPool *lib.WorkerPool) http.HandlerFunc {
|
||||
|
||||
body, err := ioutil.ReadAll(reader) // todo Limit to 1MB
|
||||
if err != nil {
|
||||
logger.Error("Error reading request body", zap.Error(err))
|
||||
logger.Error("Error reading request body",
|
||||
zap.Error(err),
|
||||
zap.String("remote_addr", r.RemoteAddr),
|
||||
zap.String("user_agent", r.UserAgent()),
|
||||
zap.Int64("content_length", r.ContentLength),
|
||||
)
|
||||
http.Error(w, "Request body invalid", http.StatusBadRequest)
|
||||
metrics.EventHandlerTimeHist.WithLabelValues(JSON, ERROR).Observe(float64(utils.NanosToMillis(time.Now().UnixNano()) - eventHandlerStartTime))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user