Skip to content

Commit 31c0873

Browse files
committed
fix objstore_bucket_operation_duration_seconds metrics
fix histogram metrics for `get` and `getrange` operations. Signed-off-by: Siavash Safi <[email protected]>
1 parent 168679c commit 31c0873

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

objstore.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ func (b *metricBucket) Get(ctx context.Context, name string) (io.ReadCloser, err
573573
if !b.metrics.isOpFailureExpected(err) && ctx.Err() != context.Canceled {
574574
b.metrics.opsFailures.WithLabelValues(op).Inc()
575575
}
576-
b.metrics.opsDuration.WithLabelValues(op).Observe(float64(time.Since(start)))
576+
b.metrics.opsDuration.WithLabelValues(op).Observe(time.Since(start).Seconds())
577577
return nil, err
578578
}
579579
return newTimingReader(
@@ -600,7 +600,7 @@ func (b *metricBucket) GetRange(ctx context.Context, name string, off, length in
600600
if !b.metrics.isOpFailureExpected(err) && ctx.Err() != context.Canceled {
601601
b.metrics.opsFailures.WithLabelValues(op).Inc()
602602
}
603-
b.metrics.opsDuration.WithLabelValues(op).Observe(float64(time.Since(start)))
603+
b.metrics.opsDuration.WithLabelValues(op).Observe(time.Since(start).Seconds())
604604
return nil, err
605605
}
606606
return newTimingReader(

0 commit comments

Comments
 (0)