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
PromQL: Multiplication by 1 creates additional floating point errors (but should be a no-op) #14052
Comments
compare (prometheus_http_request_duration_seconds_bucket) |
It's not so much the grouping or the join that creates these artifacts, but the multiplication. At least I can create the same "noisy" heatmap by multiplying with a I'm confused why this is happening, as multiplication by 1 should be a no-op (and with the query linked above, it should be guaranteed that an actual |
Fundamentally, I would say there must be a different code path in the PromQL engine for "sum the result of a function call" and "sum the result of a bin-op", but from the top of my head, I cannot imagine how that would happen. |
One possible workaround is to use something like compare: |
We discussed on the chat-system-that-shall-not-be-named. I guess the most likely reason for this is what @bboreham said there: "At a high level, it’s likely that each new expression changes the order of evaluation, which will give different results since addition is non-commutative." |
Just wanted to highlight #14074, which I think could improve the optics, at some CPU cost. |
What did you do?
grafana PromQL:
What did you expect to see?
The same PromQL response as
What did you see instead? Under which circumstances?
with the group_left join in place tiny non zeros are sprinkled throughout the buckets at random differing with each repeated request of the same query
System information
No response
Prometheus version
Prometheus configuration file
No response
Alertmanager version
No response
Alertmanager configuration file
No response
Logs
No response
The text was updated successfully, but these errors were encountered: