Skip to content

Commit

Permalink
Merge pull request #153 from siavashs/fix_get_metrics
Browse files Browse the repository at this point in the history
fix objstore_bucket_operation_duration_seconds metrics
  • Loading branch information
MichaHoffmann authored Oct 28, 2024
2 parents 168679c + cf96e34 commit cfdd0e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re
- [#145](https://github.com/thanos-io/objstore/pull/145) Include content length in the response of Get and GetRange.

### Fixed
- [#153](https://github.com/thanos-io/objstore/pull/153) Metrics: Fix `objstore_bucket_operation_duration_seconds_*` for `get` and `get_range` operations.
- [#117](https://github.com/thanos-io/objstore/pull/117) Metrics: Fix `objstore_bucket_operation_failures_total` incorrectly incremented if context is cancelled while reading object contents.
- [#115](https://github.com/thanos-io/objstore/pull/115) GCS: Fix creation of bucket with GRPC connections. Also update storage client to `v1.40.0`.
- [#102](https://github.com/thanos-io/objstore/pull/102) Azure: bump azblob sdk to get concurrency fixes.
Expand Down
4 changes: 2 additions & 2 deletions objstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ func (b *metricBucket) Get(ctx context.Context, name string) (io.ReadCloser, err
if !b.metrics.isOpFailureExpected(err) && ctx.Err() != context.Canceled {
b.metrics.opsFailures.WithLabelValues(op).Inc()
}
b.metrics.opsDuration.WithLabelValues(op).Observe(float64(time.Since(start)))
b.metrics.opsDuration.WithLabelValues(op).Observe(time.Since(start).Seconds())
return nil, err
}
return newTimingReader(
Expand All @@ -600,7 +600,7 @@ func (b *metricBucket) GetRange(ctx context.Context, name string, off, length in
if !b.metrics.isOpFailureExpected(err) && ctx.Err() != context.Canceled {
b.metrics.opsFailures.WithLabelValues(op).Inc()
}
b.metrics.opsDuration.WithLabelValues(op).Observe(float64(time.Since(start)))
b.metrics.opsDuration.WithLabelValues(op).Observe(time.Since(start).Seconds())
return nil, err
}
return newTimingReader(
Expand Down

0 comments on commit cfdd0e5

Please sign in to comment.