-
Notifications
You must be signed in to change notification settings - Fork 817
Fixed query start/end timestamp rounding #2990
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
Fixed query start/end timestamp rounding #2990
Conversation
👍 |
input: "1543578564.705", | ||
result: time.Unix(1543578564, 705*1e6), | ||
}, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about `input: "2015-06-03T13:21:58.56789Z" ... should that be rounded on milliseconds precision?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied the exact implementation and tests of Prometheus. Should we keep it 1-1 with Prometheus or change it? I'm open to discuss it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No strong opinion on milliseconds rounding... We can keep it as-is to be consistent with Prometheus, and think about it when (if) someone hits that. Then we can clarify at both places (depending on what Prometheus decides)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a test. I believe we should just use the Prometheus implementation as reference implementation (we want to be 100% compatible with Prometheus) and thus I've written the expected value with the current Prometheus rounding.
Signed-off-by: Marco Pracucci <[email protected]>
Signed-off-by: Marco Pracucci <[email protected]>
Signed-off-by: Marco Pracucci <[email protected]>
Signed-off-by: Marco Pracucci <[email protected]>
Signed-off-by: Marco Pracucci <[email protected]>
ffe6e4c
to
572b261
Compare
What this PR does:
The good @juliusv reported we're not rounding query start/end timestamps like Prometheus. This PR fixes it, specifically introduces the change done in Prometheus almost 3y ago prometheus/prometheus#4941.
Which issue(s) this PR fixes:
Fixes #2932
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]