From 260fa5ea316707026fde1785988fd824b30a71b0 Mon Sep 17 00:00:00 2001 From: "rita.canavarro" Date: Fri, 21 Jul 2023 11:23:13 +0100 Subject: [PATCH] [FEAT] Clean code Signed-off-by: rita.canavarro --- pkg/shipper/shipper.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pkg/shipper/shipper.go b/pkg/shipper/shipper.go index e567678a1a3..36ecb208464 100644 --- a/pkg/shipper/shipper.go +++ b/pkg/shipper/shipper.go @@ -66,7 +66,7 @@ func newMetrics(reg prometheus.Registerer) *metrics { }) m.uploadedBytes = promauto.With(reg).NewCounter(prometheus.CounterOpts{ Name: "thanos_shipper_uploaded_bytes_total", - Help: "Total number of uploaded bytes.", + Help: "Total number of uploaded bytes from TSDB blocks.", }) return &m @@ -391,19 +391,17 @@ func (s *Shipper) upload(ctx context.Context, meta *metadata.Meta) error { } err := block.Upload(ctx, s.logger, s.bucket, updir, s.hashFunc) - if err != nil { return errors.Wrap(err, "while upploading the block") } - files, err := block.GatherFileStats(updir, s.hashFunc, s.logger) - + fileStats, err := block.GatherFileStats(updir, s.hashFunc, s.logger) if err != nil { - //The block upload should not stop due to issues gathering data for a metric + // The block upload should not stop due to issues gathering data for a metric. return nil } - for _, x := range files { + for _, x := range fileStats { s.metrics.uploadedBytes.Add(float64(x.SizeBytes)) }