**What this PR does / why we need it**:
Improve the experience of migrating to our new timeouts behavior, which
is the unifying of the engine:timeout and querier:query_timeout into a
new configuration named limits_config:query_timeout.
This PR makes sure users won't be surprised by their timeouts being
shorter, but at the same time, it makes it easier to migrate to the new
configuration.
Co-authored-by: Owen Diehl <ow.diehl@gmail.com>
// TODO: remove this configuration after next release.
f.DurationVar(&opts.Timeout,prefix+".engine.timeout",5*time.Minute,"Timeout for query execution. Instead, rely only on querier.query-timeout. (deprecated)")
f.DurationVar(&opts.Timeout,prefix+".engine.timeout",DefaultEngineTimeout,"Timeout for query execution. Instead, rely only on querier.query-timeout. (deprecated)")
f.DurationVar(&opts.MaxLookBackPeriod,prefix+".engine.max-lookback-period",30*time.Second,"The maximum amount of time to look back for log lines. Used only for instant log queries.")
returnfmt.Errorf("couldn't set per-tenant query_timeout as the engine timeout value: %w",err)
}
level.Warn(util_log.Logger).Log("msg",
fmt.Sprintf(
"per-tenant timeout not configured, using default engine timeout (%q). This behavior will change in the next major to always use the default per-tenant timeout (%q).",
"using configured per-tenant timeout (%q) as the default (can be overridden per-tenant in the limits_config). Configured engine timeout (%q) is deprecated and will be ignored.",
returnfmt.Errorf("couldn't set per-tenant query_timeout as the engine timeout value: %w",err)
}
level.Warn(util_log.Logger).Log("msg",
fmt.Sprintf(
"using configured engine timeout (%q) as the default (can be overridden per-tenant in the limits_config). Be aware that engine timeout (%q) is deprecated and will be removed in the next major version.",
f.Var(&l.MaxQueryLength,"store.max-query-length","Limit to length of chunk store queries, 0 to disable.")
f.IntVar(&l.MaxQuerySeries,"querier.max-query-series",500,"Limit the maximum of unique series returned by a metric query. When the limit is reached an error is returned.")
f.Var(&l.QueryTimeout,"querier.query-timeout","Timeout when querying backends (ingesters or storage) during the execution of a query request. If a specific per-tenant timeout is used, this timeout is ignored.")