Skip to content

Set the default interval for promql to eval subqueries.#1327

Merged
gouthamve merged 1 commit intocortexproject:masterfrom
gouthamve:default-eval-interval
Apr 15, 2019
Merged

Set the default interval for promql to eval subqueries.#1327
gouthamve merged 1 commit intocortexproject:masterfrom
gouthamve:default-eval-interval

Conversation

@gouthamve
Copy link
Contributor

When you have a subquery of the form [1h:], the second parameter is substituted to be the default evaluation interval by Prometheus. We don't set that in Cortex.

This is a little contentious, because if users change the default in their prometheus, their graphs in local vs cloud would be different.

Fixes #1265

Fixes cortexproject#1265

Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
f.BoolVar(&cfg.IngesterStreaming, "querier.ingester-streaming", false, "Use streaming RPCs to query ingester.")
f.IntVar(&cfg.MaxSamples, "querier.max-samples", 50e6, "Maximum number of samples a single query can load into memory.")
f.DurationVar(&cfg.IngesterMaxQueryLookback, "querier.query-ingesters-within", 0, "Maximum lookback beyond which queries are not sent to ingester. 0 means all queries are sent to ingester.")
f.DurationVar(&cfg.DefaultEvaluationInterval, "querier.default-evaluation-interval", time.Minute, "The default evaluation interval or step size for subqueries.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would slightly prefer this defaults to 15 seconds, but not going to make a big thing of it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default for it in prometheus is 1m hence I made it 1m here too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sticking with Prometheus defaults seems the right thing to do.

@tomwilkie
Copy link
Contributor

QQ: should this be overridable per user? Or should we cross that bridge when we get there?

@gouthamve
Copy link
Contributor Author

Well making it per user would make things much more complicated as that would mean changes upstream. Currently the eval interval is a global variable.

@gouthamve
Copy link
Contributor Author

Merging this as-is as I think we should cross the bridge when we get there :)

@gouthamve gouthamve merged commit 0054129 into cortexproject:master Apr 15, 2019
@gouthamve gouthamve deleted the default-eval-interval branch April 15, 2019 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"unexpected error: runtime error: integer divide by zero" doing subquery

3 participants