diff --git a/cmd/thanos/store.go b/cmd/thanos/store.go index 396c560f948..98f9016cb31 100644 --- a/cmd/thanos/store.go +++ b/cmd/thanos/store.go @@ -69,7 +69,7 @@ func registerStore(app *extkingpin.App) { Default("0").Uint() maxSampleSize := cmd.Flag("store.grpc.series-sample-size-limit", - "Maximum size of samples returned via a single Series call. The Series call fails if this limit is exceeded. 0 means no limit."). + "Maximum size of samples returned (in bytes) via a single Series call. The Series call fails if this limit is exceeded. 0 means no limit."). Default("0").Uint() maxConcurrent := cmd.Flag("store.grpc.series-max-concurrency", "Maximum number of concurrent Series calls.").Default("20").Int() @@ -297,7 +297,7 @@ func runStore( store.WithChunksSizeLimit(store.NewChunksLimiterFactory(maxSampleSize)), } - bs, err := store.New( + bs, err := store.NewBucketStoreWithOptions( logger, reg, bkt, diff --git a/pkg/store/bucket.go b/pkg/store/bucket.go index ab765570c3c..067a97060aa 100644 --- a/pkg/store/bucket.go +++ b/pkg/store/bucket.go @@ -326,6 +326,7 @@ var defaultBucketStoreOptions = bucketStoreOptions{ chunksSizeLimitFactory: NewChunksLimiterFactory(noChunksSizeLimit), } +// Deprecated. Use NewBucketStoreWithOptions instead. // NewBucketStore creates a new bucket backed store that implements the store API against // an object store bucket. It is optimized to work against high latency backends. func NewBucketStore( @@ -350,7 +351,7 @@ func NewBucketStore( WithChunksLimit(chunksLimiterFactory), WithChunksSizeLimit(NewChunksLimiterFactory(noChunksSizeLimit)), } - return New(logger, + return NewBucketStoreWithOptions(logger, reg, bkt, fetcher, @@ -369,9 +370,9 @@ func NewBucketStore( ) } -// New creates a new bucket backed store that implements the store API against +// NewBucketStoreWithOptions creates a new bucket backed store that implements the store API against // an object store bucket. It is optimized to work against high latency backends. -func New( +func NewBucketStoreWithOptions( logger log.Logger, reg prometheus.Registerer, bkt objstore.InstrumentedBucketReader, diff --git a/pkg/store/bucket_e2e_test.go b/pkg/store/bucket_e2e_test.go index 4a26227bee1..598df937f2b 100644 --- a/pkg/store/bucket_e2e_test.go +++ b/pkg/store/bucket_e2e_test.go @@ -156,7 +156,7 @@ func prepareStoreWithTestBlocks(t testing.TB, dir string, bkt objstore.Bucket, m }, nil) testutil.Ok(t, err) - store, err := New( + store, err := NewBucketStoreWithOptions( s.logger, nil, objstore.WithNoopInstr(bkt), diff --git a/pkg/store/bucket_test.go b/pkg/store/bucket_test.go index 2f40488350d..60532012039 100644 --- a/pkg/store/bucket_test.go +++ b/pkg/store/bucket_test.go @@ -564,7 +564,7 @@ func TestBucketStore_Info(t *testing.T) { defer testutil.Ok(t, os.RemoveAll(dir)) - bucketStore, err := New( + bucketStore, err := NewBucketStoreWithOptions( nil, nil, nil, @@ -599,7 +599,7 @@ func TestSeries_ErrorInvalidLimiter(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() dir := t.TempDir() - store, err := New( + store, err := NewBucketStoreWithOptions( nil, nil, nil, @@ -856,7 +856,7 @@ func testSharding(t *testing.T, reuseDisk string, bkt objstore.Bucket, all ...ul }, nil) testutil.Ok(t, err) - bucketStore, err := New( + bucketStore, err := NewBucketStoreWithOptions( logger, nil, objstore.WithNoopInstr(rec), @@ -1611,7 +1611,7 @@ func TestSeries_RequestAndResponseHints(t *testing.T) { indexCache, err := storecache.NewInMemoryIndexCacheWithConfig(logger, nil, storecache.InMemoryIndexCacheConfig{}) testutil.Ok(tb, err) - store, err := New( + store, err := NewBucketStoreWithOptions( logger, nil, instrBkt, @@ -1720,7 +1720,7 @@ func TestSeries_ErrorUnmarshallingRequestHints(t *testing.T) { indexCache, err := storecache.NewInMemoryIndexCacheWithConfig(logger, nil, storecache.InMemoryIndexCacheConfig{}) testutil.Ok(tb, err) - store, err := New( + store, err := NewBucketStoreWithOptions( logger, nil, instrBkt, @@ -1823,7 +1823,7 @@ func TestBlockWithLargeChunks(t *testing.T) { indexCache, err := storecache.NewInMemoryIndexCacheWithConfig(logger, nil, storecache.InMemoryIndexCacheConfig{}) testutil.Ok(t, err) - store, err := New( + store, err := NewBucketStoreWithOptions( logger, nil, instrBkt,