Skip to content

Commit

Permalink
fix: remove limit middleware for detected_labels (#13643)
Browse files Browse the repository at this point in the history
  • Loading branch information
svennergr authored Jul 24, 2024
1 parent 3a99b69 commit 2642718
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions pkg/querier/queryrange/roundtrip.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,10 @@ func NewMiddleware(

detectedLabelsTripperware, err := NewDetectedLabelsTripperware(
cfg,
engineOpts,
log,
limits,
schema,
metrics,
indexStatsTripperware,
metricsNamespace,
codec, limits, iqo)
if err != nil {
Expand All @@ -282,25 +280,17 @@ func NewMiddleware(
}), StopperWrapper{resultsCache, statsCache, volumeCache}, nil
}

func NewDetectedLabelsTripperware(cfg Config, opts logql.EngineOpts, logger log.Logger, l Limits, schema config.SchemaConfig, metrics *Metrics, mw base.Middleware, namespace string, merger base.Merger, limits Limits, iqo util.IngesterQueryOptions) (base.Middleware, error) {
func NewDetectedLabelsTripperware(cfg Config, logger log.Logger, l Limits, schema config.SchemaConfig, metrics *Metrics, namespace string, merger base.Merger, limits Limits, iqo util.IngesterQueryOptions) (base.Middleware, error) {
return base.MiddlewareFunc(func(next base.Handler) base.Handler {
statsHandler := mw.Wrap(next)
splitter := newDefaultSplitter(limits, iqo)

queryRangeMiddleware := []base.Middleware{
StatsCollectorMiddleware(),
NewLimitsMiddleware(l),
NewQuerySizeLimiterMiddleware(schema.Configs, opts, logger, l, statsHandler),
base.InstrumentMiddleware("split_by_interval", metrics.InstrumentMiddlewareMetrics),
SplitByIntervalMiddleware(schema.Configs, limits, merger, splitter, metrics.SplitByMetrics),
}

// The sharding middleware takes care of enforcing this limit for both shardable and non-shardable queries.
// If we are not using sharding, we enforce the limit by adding this middleware after time splitting.
queryRangeMiddleware = append(queryRangeMiddleware,
NewQuerierSizeLimiterMiddleware(schema.Configs, opts, logger, l, statsHandler),
)

if cfg.MaxRetries > 0 {
queryRangeMiddleware = append(
queryRangeMiddleware, base.InstrumentMiddleware("retry", metrics.InstrumentMiddlewareMetrics),
Expand Down

0 comments on commit 2642718

Please sign in to comment.