Skip to content

Commit

Permalink
[FEAT] Remove written bytes histogram
Browse files Browse the repository at this point in the history
Signed-off-by: rita.canavarro <[email protected]>
  • Loading branch information
rita.canavarro committed Aug 1, 2023
1 parent 293fec9 commit ad6113e
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions objstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,13 +442,6 @@ func WrapWithMetrics(b Bucket, reg prometheus.Registerer, name string) *metricBu
Name: "objstore_bucket_last_successful_upload_time",
Help: "Second timestamp of the last successful upload to the bucket.",
}, []string{"bucket"}),

opsWrittenBytes: promauto.With(reg).NewHistogramVec(prometheus.HistogramOpts{
Name: "objstore_bucket_operation_written_bytes",
Help: "Number of bytes uploaded from TSDB block, per operation.",
ConstLabels: prometheus.Labels{"bucket": name},
Buckets: prometheus.ExponentialBuckets(50<<100, 2, 10),
}, []string{"operation"}),
}
for _, op := range []string{
OpIter,
Expand All @@ -463,7 +456,6 @@ func WrapWithMetrics(b Bucket, reg prometheus.Registerer, name string) *metricBu
bkt.opsFailures.WithLabelValues(op)
bkt.opsDuration.WithLabelValues(op)
bkt.opsFetchedBytes.WithLabelValues(op)
bkt.opsWrittenBytes.WithLabelValues(op)
}
// fetched bytes only relevant for get and getrange
for _, op := range []string{
Expand Down Expand Up @@ -610,16 +602,6 @@ func (b *metricBucket) Upload(ctx context.Context, name string, r io.Reader) err
}
return err
}

rc := &nopCloserWithObjectSize{
Reader: r,
}

rc.Close()
if writtenBytes, err := rc.ObjectSize(); err != nil {
b.opsWrittenBytes.WithLabelValues(op).Observe(float64(writtenBytes))
}

b.lastSuccessfulUploadTime.WithLabelValues(b.bkt.Name()).SetToCurrentTime()
b.opsDuration.WithLabelValues(op).Observe(time.Since(start).Seconds())
return nil
Expand Down

0 comments on commit ad6113e

Please sign in to comment.