Gateway: Log file size (#9465)

**What this PR does / why we need it**:
Modifies gateway log message to report the file size.

**Which issue(s) this PR fixes**:
N/A
pull/9473/head^2
Dylan Guedes 3 years ago committed by GitHub
parent 01f0ded7fc
commit 8e8dcdf7d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      pkg/storage/stores/indexshipper/storage/util.go

@ -82,7 +82,16 @@ func DownloadFileFromStorage(destination string, decompressFile bool, sync bool,
return err
}
fStat, err := f.Stat()
if err != nil {
level.Error(logger).Log("msg", "failed to get stat for downloaded file", "err", err)
}
if err == nil {
logger = log.With(logger, "size", fStat.Size())
}
level.Info(logger).Log("msg", "downloaded file", "total_time", time.Since(start))
if sync {
return f.Sync()
}

Loading…
Cancel
Save