fix: remove unnecessary logs for client conn errors (#16261)

This commit is contained in:
Harshavardhana
2022-12-15 08:25:05 -08:00
committed by GitHub
parent 5d7e8f79ed
commit 2433698372
6 changed files with 19 additions and 21 deletions

View File

@@ -590,7 +590,8 @@ func metricsHandler() http.Handler {
enc := expfmt.NewEncoder(w, contentType)
for _, mf := range mfs {
if err := enc.Encode(mf); err != nil {
logger.LogIf(r.Context(), err)
// client may disconnect for any reasons
// we do not have to log this.
return
}
}