Skip to content

Commit

Permalink
Rename querier-level limit
Browse files Browse the repository at this point in the history
  • Loading branch information
salvacorts committed Mar 1, 2023
1 parent 0aea9e1 commit 4780298
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pkg/querier/queryrange/limits.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type Limits interface {
// frontend will process in parallel for TSDB queries.
TSDBMaxQueryParallelism(string) int
MaxQueryBytesRead(u string) int
MaxQuerierBytesRead(u string) int
MaxSubqueryBytesRead(u string) int
}

type limits struct {
Expand Down
4 changes: 2 additions & 2 deletions pkg/querier/queryrange/roundtrip.go
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ func NewMetricTripperware(
// Limit the bytes the sub-queries would fetch after splitting and sharding
queryRangeMiddleware = append(
queryRangeMiddleware,
NewQuerySizeLimiterMiddleware(limits.MaxQuerierBytesRead, limErrSubqueryTooManyBytesTmpl),
NewQuerySizeLimiterMiddleware(limits.MaxSubqueryBytesRead, limErrSubqueryTooManyBytesTmpl),
)

if cfg.MaxRetries > 0 {
Expand Down Expand Up @@ -651,7 +651,7 @@ func NewInstantMetricTripperware(
// Limit the bytes the sub-queries would fetch after sharding
queryRangeMiddleware = append(
queryRangeMiddleware,
NewQuerySizeLimiterMiddleware(limits.MaxQuerierBytesRead, limErrSubqueryTooManyBytesTmpl),
NewQuerySizeLimiterMiddleware(limits.MaxSubqueryBytesRead, limErrSubqueryTooManyBytesTmpl),
)

if cfg.MaxRetries > 0 {
Expand Down
18 changes: 9 additions & 9 deletions pkg/validation/limits.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ type Limits struct {
QueryTimeout model.Duration `yaml:"query_timeout" json:"query_timeout"`

// Query frontend enforced limits. The default is actually parameterized by the queryrange config.
QuerySplitDuration model.Duration `yaml:"split_queries_by_interval" json:"split_queries_by_interval"`
MinShardingLookback model.Duration `yaml:"min_sharding_lookback" json:"min_sharding_lookback"`
MaxQueryBytesRead flagext.ByteSize `yaml:"max_query_bytes_read" json:"max_query_bytes_read"`
MaxQuerierBytesRead flagext.ByteSize `yaml:"max_querier_bytes_read" json:"max_querier_bytes_read"`
QuerySplitDuration model.Duration `yaml:"split_queries_by_interval" json:"split_queries_by_interval"`
MinShardingLookback model.Duration `yaml:"min_sharding_lookback" json:"min_sharding_lookback"`
MaxQueryBytesRead flagext.ByteSize `yaml:"max_query_bytes_read" json:"max_query_bytes_read"`
MaxSubqueryBytesRead flagext.ByteSize `yaml:"max_subquery_bytes_read" json:"max_subquery_bytes_read"`

// Ruler defaults and limits.
RulerEvaluationDelay model.Duration `yaml:"ruler_evaluation_delay_duration" json:"ruler_evaluation_delay_duration"`
Expand Down Expand Up @@ -227,8 +227,8 @@ func (l *Limits) RegisterFlags(f *flag.FlagSet) {

_ = l.MaxQueryBytesRead.Set("0B")
f.Var(&l.MaxQueryBytesRead, "frontend.max-query-bytes-read", "TODO: Max number of bytes a query would fetch")
_ = l.MaxQuerierBytesRead.Set("0B")
f.Var(&l.MaxQuerierBytesRead, "frontend.max-querier-bytes-read", "TODO: Max number of bytes a sub query would fetch after splitting and sharding")
_ = l.MaxSubqueryBytesRead.Set("0B")
f.Var(&l.MaxSubqueryBytesRead, "frontend.max-subquery-bytes-read", "TODO: Max number of bytes a sub query would fetch after splitting and sharding")

_ = l.MaxCacheFreshness.Set("1m")
f.Var(&l.MaxCacheFreshness, "frontend.max-cache-freshness", "Most recent allowed cacheable result per-tenant, to prevent caching very recent results that might still be in flux.")
Expand Down Expand Up @@ -486,9 +486,9 @@ func (o *Overrides) MaxQueryBytesRead(userID string) int {
return o.getOverridesForUser(userID).MaxQueryBytesRead.Val()
}

// MaxQuerierBytesRead returns the maximum bytes a sub query can read after splitting and sharding.
func (o *Overrides) MaxQuerierBytesRead(userID string) int {
return o.getOverridesForUser(userID).MaxQuerierBytesRead.Val()
// MaxSubqueryBytesRead returns the maximum bytes a sub query can read after splitting and sharding.
func (o *Overrides) MaxSubqueryBytesRead(userID string) int {
return o.getOverridesForUser(userID).MaxSubqueryBytesRead.Val()
}

// MaxConcurrentTailRequests returns the limit to number of concurrent tail requests.
Expand Down

0 comments on commit 4780298

Please sign in to comment.