Skip to content

Commit

Permalink
chore: [k212] fix: remove retries on the stats handlers because they …
Browse files Browse the repository at this point in the history
…already retry (#13610)

Co-authored-by: Ed Welch <[email protected]>
  • Loading branch information
grafanabot and slim-bean authored Jul 22, 2024
1 parent d3e1edb commit b8e16b6
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions pkg/querier/queryrange/roundtrip.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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)
}

Expand Down Expand Up @@ -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)
}

Expand Down Expand Up @@ -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)
}

Expand Down Expand Up @@ -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)
}

Expand Down

0 comments on commit b8e16b6

Please sign in to comment.