-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
d (day) and w (week) argument doesn't work with offset modifier #5199
Comments
@chinmaygupta28 thank you for reporting this. This is indeed a bug. We state explicitly that we support time durations the same way Prometheus does, so this is an inconsistency. |
I'll look into this and prepare a Pull Request. |
Went through the docs and realized, year (y) doesn't work either, only minutes (m), hours (h) and milliseconds (ms) work. I will update the issue description. Updated the main issue |
Progress Update: I've found the issue, but I'm still preparing the Pull Request. |
Progress Update: I've implemented a naive solution, but its not optimal. I'd like to explore an alternative, less complex, solution before submitting a PR. After an examination tomorrow afternoon, I'll continue work on this issue. |
Progress Update: A draft PR is available |
Describe the bug
Only hour (h), minute (m), milliseconds (ms) and second (s) duration format works with the offset modifier but day (d), week (w) and year (y) throws this error =
parse error at line 1, col 47: syntax error: unexpected NUMBER, expecting DURATION
To Reproduce
Make the 1d and 1w query visible to reproduce the error.
play.grafana.com link
Expected behavior
I expect them to work as they work in promql.
Environment:
Any
Screenshots, Promtail config, or terminal output
The text was updated successfully, but these errors were encountered: