diff --git a/CHANGELOG.md b/CHANGELOG.md index 9764d13d1e..0c2e3b5cb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re - [#5773](https://github.com/thanos-io/thanos/pull/5773) Store: Support disable cache index header file. - [#5653](https://github.com/thanos-io/thanos/pull/5653) Receive: Allow setting hashing algorithm per tenant in hashrings config - [#6074](https://github.com/thanos-io/thanos/pull/6074) *: Add histogram metrics `thanos_store_server_series_requested` and `thanos_store_server_chunks_requested` to all Stores. -- [#6074](https://github.com/thanos-io/thanos/pull/6074) *: Allow configuring series and chunk rate limits per `Series` request for all Stores. +- [#6074](https://github.com/thanos-io/thanos/pull/6074) *: Allow configuring series and sample limits per `Series` request for all Stores. ### Changed diff --git a/docs/components/query.md b/docs/components/query.md index 2fdd88ab02..b21ee5192a 100644 --- a/docs/components/query.md +++ b/docs/components/query.md @@ -429,10 +429,13 @@ Flags: that are always used, even if the health check fails. Useful if you have a caching layer on top. - --store.grpc.chunks-limit=0 - The maximum chunks allowed for a single Series - request, The Series call fails if this limit is - exceeded. 0 means no limit. + --store.grpc.samples-limit=0 + The maximum samples allowed for a single + Series request, The Series call fails if + this limit is exceeded. 0 means no limit. + NOTE: For efficiency the limit is internally + implemented as 'chunks limit' considering each + chunk contains a maximum of 120 samples. --store.grpc.series-limit=0 The maximum series allowed for a single Series request. The Series call fails if this limit is diff --git a/docs/components/receive.md b/docs/components/receive.md index afdc3dde2e..bd61d0e36b 100644 --- a/docs/components/receive.md +++ b/docs/components/receive.md @@ -334,10 +334,13 @@ Flags: Path to YAML file with request logging configuration. See format details: https://thanos.io/tip/thanos/logging.md/#configuration - --store.grpc.chunks-limit=0 - The maximum chunks allowed for a single Series - request, The Series call fails if this limit is - exceeded. 0 means no limit. + --store.grpc.samples-limit=0 + The maximum samples allowed for a single + Series request, The Series call fails if + this limit is exceeded. 0 means no limit. + NOTE: For efficiency the limit is internally + implemented as 'chunks limit' considering each + chunk contains a maximum of 120 samples. --store.grpc.series-limit=0 The maximum series allowed for a single Series request. The Series call fails if this limit is diff --git a/docs/components/rule.md b/docs/components/rule.md index 7eb8622804..5bc6fe48c5 100644 --- a/docs/components/rule.md +++ b/docs/components/rule.md @@ -453,10 +453,13 @@ Flags: Works only if compaction is disabled on Prometheus. Do it once and then disable the flag when done. - --store.grpc.chunks-limit=0 - The maximum chunks allowed for a single Series - request, The Series call fails if this limit is - exceeded. 0 means no limit. + --store.grpc.samples-limit=0 + The maximum samples allowed for a single + Series request, The Series call fails if + this limit is exceeded. 0 means no limit. + NOTE: For efficiency the limit is internally + implemented as 'chunks limit' considering each + chunk contains a maximum of 120 samples. --store.grpc.series-limit=0 The maximum series allowed for a single Series request. The Series call fails if this limit is diff --git a/docs/components/sidecar.md b/docs/components/sidecar.md index 1a7540bf5f..80fec0df10 100644 --- a/docs/components/sidecar.md +++ b/docs/components/sidecar.md @@ -174,10 +174,13 @@ Flags: Works only if compaction is disabled on Prometheus. Do it once and then disable the flag when done. - --store.grpc.chunks-limit=0 - The maximum chunks allowed for a single Series - request, The Series call fails if this limit is - exceeded. 0 means no limit. + --store.grpc.samples-limit=0 + The maximum samples allowed for a single + Series request, The Series call fails if + this limit is exceeded. 0 means no limit. + NOTE: For efficiency the limit is internally + implemented as 'chunks limit' considering each + chunk contains a maximum of 120 samples. --store.grpc.series-limit=0 The maximum series allowed for a single Series request. The Series call fails if this limit is diff --git a/docs/components/store.md b/docs/components/store.md index 0a21d96f7c..fd1f6f4aa1 100644 --- a/docs/components/store.md +++ b/docs/components/store.md @@ -169,16 +169,19 @@ Flags: If true, Store Gateway will lazy memory map index-header only once the block is required by a query. - --store.grpc.chunks-limit=0 - The maximum chunks allowed for a single Series - request, The Series call fails if this limit is - exceeded. 0 means no limit. --store.grpc.downloaded-bytes-limit=0 Maximum amount of downloaded (either fetched or touched) bytes in a single Series/LabelNames/LabelValues call. The Series call fails if this limit is exceeded. 0 means no limit. + --store.grpc.samples-limit=0 + The maximum samples allowed for a single + Series request, The Series call fails if + this limit is exceeded. 0 means no limit. + NOTE: For efficiency the limit is internally + implemented as 'chunks limit' considering each + chunk contains a maximum of 120 samples. --store.grpc.series-limit=0 The maximum series allowed for a single Series request. The Series call fails if this limit is @@ -186,19 +189,9 @@ Flags: --store.grpc.series-max-concurrency=20 Maximum number of concurrent Series calls. --store.grpc.series-sample-limit=0 - Maximum amount of samples returned via a - single Series call. The Series call fails - if this limit is exceeded. 0 means no limit. - NOTE: For efficiency the limit is internally - implemented as 'chunks limit' considering - each chunk contains 120 samples (it's the max - number of samples each chunk can contain), - so the actual number of samples might be lower, - even though the maximum could be hit. + DEPRECATED: use store.grpc.chunks-limit. --store.grpc.touched-series-limit=0 - Maximum amount of touched series returned via - a single Series call. The Series call fails if - this limit is exceeded. 0 means no limit. + DEPRECATED: use store.grpc.series-limit. --sync-block-duration=3m Repeat interval for syncing the blocks between local and remote view. --tracing.config= diff --git a/pkg/store/limiter.go b/pkg/store/limiter.go index 04bc64a0fc..eab0779767 100644 --- a/pkg/store/limiter.go +++ b/pkg/store/limiter.go @@ -86,14 +86,14 @@ func NewChunksLimiterFactory(limit uint64) ChunksLimiterFactory { } } -// NewSeriesLimiterFactory makes a new NewSeriesLimiterFactory with a static limit. +// NewSeriesLimiterFactory makes a new SeriesLimiterFactory with a static limit. func NewSeriesLimiterFactory(limit uint64) SeriesLimiterFactory { return func(failedCounter prometheus.Counter) SeriesLimiter { return NewLimiter(limit, failedCounter) } } -// NewBytesLimiterFactory makes a new NewSeriesLimiterFactory with a static limit. +// NewBytesLimiterFactory makes a new BytesLimiterFactory with a static limit. func NewBytesLimiterFactory(limit units.Base2Bytes) BytesLimiterFactory { return func(failedCounter prometheus.Counter) BytesLimiter { return NewLimiter(uint64(limit), failedCounter)