Commit 8fc9bfcf authored by Matthias Käppler's avatar Matthias Käppler Committed by Alessio Caiazza

Don't log "success" when failing over to original image

parent 9b8d7b7e
---
title: Don't log image scaler fail-overs as successes
merge_request: 636
author:
type: fixed
...@@ -174,11 +174,15 @@ func (r *Resizer) Inject(w http.ResponseWriter, req *http.Request, paramsData st ...@@ -174,11 +174,15 @@ func (r *Resizer) Inject(w http.ResponseWriter, req *http.Request, paramsData st
return return
} }
if resizeCmd != nil { if resizeCmd == nil {
widthLabelVal := strconv.Itoa(int(params.Width)) // This means we served the original image because rescaling failed
imageResizeDurations.WithLabelValues(params.ContentType, widthLabelVal).Observe(time.Since(start).Seconds()) logger.WithFields(*logFields(bytesWritten)).Printf("ImageResizer: Served original")
return
} }
widthLabelVal := strconv.Itoa(int(params.Width))
imageResizeDurations.WithLabelValues(params.ContentType, widthLabelVal).Observe(time.Since(start).Seconds())
logger.WithFields(*logFields(bytesWritten)).Printf("ImageResizer: Success") logger.WithFields(*logFields(bytesWritten)).Printf("ImageResizer: Success")
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment