From b8e16b663980ae859dcb6c82b27c59e04f153c1a Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Mon, 22 Jul 2024 14:28:26 +0200 Subject: [PATCH] chore: [k212] fix: remove retries on the stats handlers because they already retry (#13610) Co-authored-by: Ed Welch --- pkg/querier/queryrange/roundtrip.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/pkg/querier/queryrange/roundtrip.go b/pkg/querier/queryrange/roundtrip.go index 8ed3b26951131..5eab6a7d74bdd 100644 --- a/pkg/querier/queryrange/roundtrip.go +++ b/pkg/querier/queryrange/roundtrip.go @@ -285,11 +285,6 @@ func NewMiddleware( 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) { return base.MiddlewareFunc(func(next base.Handler) base.Handler { statsHandler := mw.Wrap(next) - if cfg.MaxRetries > 0 { - tr := base.InstrumentMiddleware("retry", metrics.InstrumentMiddlewareMetrics) - rm := base.NewRetryMiddleware(logger, cfg.MaxRetries, metrics.RetryMiddlewareMetrics, namespace) - statsHandler = queryrangebase.MergeMiddlewares(tr, rm).Wrap(statsHandler) - } splitter := newDefaultSplitter(limits, iqo) queryRangeMiddleware := []base.Middleware{ @@ -562,7 +557,6 @@ func NewLogFilterTripperware(cfg Config, engineOpts logql.EngineOpts, log log.Lo if cfg.MaxRetries > 0 { tr := base.InstrumentMiddleware("retry", metrics.InstrumentMiddlewareMetrics) rm := base.NewRetryMiddleware(log, cfg.MaxRetries, metrics.RetryMiddlewareMetrics, metricsNamespace) - statsHandler = queryrangebase.MergeMiddlewares(tr, rm).Wrap(statsHandler) retryNextHandler = queryrangebase.MergeMiddlewares(tr, rm).Wrap(next) } @@ -635,7 +629,6 @@ func NewLimitedTripperware(cfg Config, engineOpts logql.EngineOpts, log log.Logg if cfg.MaxRetries > 0 { tr := base.InstrumentMiddleware("retry", metrics.InstrumentMiddlewareMetrics) rm := base.NewRetryMiddleware(log, cfg.MaxRetries, metrics.RetryMiddlewareMetrics, metricsNamespace) - statsHandler = queryrangebase.MergeMiddlewares(tr, rm).Wrap(statsHandler) retryNextHandler = queryrangebase.MergeMiddlewares(tr, rm).Wrap(next) } @@ -879,7 +872,6 @@ func NewMetricTripperware(cfg Config, engineOpts logql.EngineOpts, log log.Logge if cfg.MaxRetries > 0 { tr := base.InstrumentMiddleware("retry", metrics.InstrumentMiddlewareMetrics) rm := base.NewRetryMiddleware(log, cfg.MaxRetries, metrics.RetryMiddlewareMetrics, metricsNamespace) - statsHandler = queryrangebase.MergeMiddlewares(tr, rm).Wrap(statsHandler) retryNextHandler = queryrangebase.MergeMiddlewares(tr, rm).Wrap(next) } @@ -1009,7 +1001,6 @@ func NewInstantMetricTripperware( if cfg.MaxRetries > 0 { tr := base.InstrumentMiddleware("retry", metrics.InstrumentMiddlewareMetrics) rm := base.NewRetryMiddleware(log, cfg.MaxRetries, metrics.RetryMiddlewareMetrics, metricsNamespace) - statsHandler = queryrangebase.MergeMiddlewares(tr, rm).Wrap(statsHandler) retryNextHandler = queryrangebase.MergeMiddlewares(tr, rm).Wrap(next) }