Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@ modifier is not properly handled by the query-frontend #4463

Closed
2 tasks done
cyriltovena opened this issue Sep 6, 2021 · 0 comments · Fixed by #4464
Closed
2 tasks done

@ modifier is not properly handled by the query-frontend #4463

cyriltovena opened this issue Sep 6, 2021 · 0 comments · Fixed by #4464

Comments

@cyriltovena
Copy link
Contributor

Describe the bug

The query-frontend component currently can split query_ranges by time. (1d)
This allows to parallelize and runs queries faster, however with the recent addition of the @ modifier, splitting queries by times can create incorrect queries specially with the uses of the start() and end(), each sub queries will evaluate it's own start and end modifier.

To Reproduce

Steps to reproduce the behavior:
Run a queries that uses the @ modifier with the start/end() syntax.

http_requests_total @ start()
rate(http_requests_total[5m] @ end())

The result is incorrect compare to Prometheus.

Expected behavior

The frontend should spot those queries before splitting by time and rewrite them using constant value of @ modifier timestamp. @codesome Suggested this solution.

Storage Engine

  • Blocks
  • Chunks
cyriltovena added a commit to cyriltovena/cortex that referenced this issue Sep 6, 2021
This will replace `start` and `end` at (`@`) modifier with the actual constant values based on the original queries.
Meaning subqueries will not wrongly use their own query start and end time.

Fixes cortexproject#4463

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
cyriltovena added a commit to grafana/mimir that referenced this issue Sep 6, 2021
This will replace `start` and `end` at (`@`) modifier with the actual constant values based on the original queries.
Meaning subqueries will not wrongly use their own query start and end time.

see  cortexproject/cortex#4463

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
pstibrany pushed a commit that referenced this issue Sep 7, 2021
* Fixes @ modifier when splitting queries by time.

This will replace `start` and `end` at (`@`) modifier with the actual constant values based on the original queries.
Meaning subqueries will not wrongly use their own query start and end time.

Fixes #4463

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>

* Update changelog.

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
bboreham pushed a commit to grafana/mimir that referenced this issue Sep 8, 2021
* Fixes @ modifier when splitting queries by time.

This will replace `start` and `end` at (`@`) modifier with the actual constant values based on the original queries.
Meaning subqueries will not wrongly use their own query start and end time.

see  cortexproject/cortex#4463

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
alvinlin123 pushed a commit to ac1214/cortex that referenced this issue Jan 14, 2022
* Fixes @ modifier when splitting queries by time.

This will replace `start` and `end` at (`@`) modifier with the actual constant values based on the original queries.
Meaning subqueries will not wrongly use their own query start and end time.

Fixes cortexproject#4463

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>

* Update changelog.

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
Signed-off-by: Alvin Lin <alvinlin@amazon.com>
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 a pull request may close this issue.

1 participant