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)) }