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
Handle more arithmetic operators for native histograms #12262
Conversation
390be44
to
e9e2fa2
Compare
41272a6
to
b06909c
Compare
bc40d62
to
97ac586
Compare
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
97ac586
to
47404c4
Compare
…oats Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
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.
Looks great. Just some not-so-substantial comments.
Special thanks for the testing. This should be much easier once #11170 is done.
Two other things to do:
- Amend the documentation to explain what works now.
- I think we can/should also fix other aggregation operators (stddev etc.). Some of them can be made work with histograms, others should ignore them cleanly (currently, we count them, which might throw some results off).
I think (1) needs to be included in this PR, but (2) can be done in a separate PR.
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
b6d895d
to
e5ebdb8
Compare
Besides what you mentioned, noticed a few more issues:
Updated std var/dev to ignore histograms for now so it won't throw the results off for floats. |
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
e5ebdb8
to
31353ed
Compare
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
Good catch with the I'll get to the other points ASAP. |
Signed-off-by: Jeanette Tan <jeanette.tan@grafana.com>
87ac94a
to
012b2e7
Compare
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.
Thank you very much. That's a huge chunk of work done.
I hope it's OK if I squash the 14 commits into one.
All other operators (and unmentioned cases for the above operators) do not | ||
behave in a meaningful way. They either treat the histogram sample as if it | ||
were a float sample of value 0, or (in case of arithmetic operations between a | ||
scalar and a vector) they leave the histogram sample unchanged. This behavior | ||
will change to a meaningful one before native histograms are a stable feature. |
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 think this isn't quite true anymore (due to my earlier giant PR). The intention is that native histograms are just ignored, but it needs some research to verify if that's actually the case. Mostly saying this as a mental note to myself. We don't need to fix this paragraph in this PR.
Addresses #12250
Works in unit tests and when manually testing on the UI with scalars and float metrics. This fixes the issue we observed with query sharding histograms with instant query splitting, however the float imprecision accumulates and the final result is very different in unit tests (tolerance was originally 1e-12 for floats but the histogram ones only passed with 1e-2).
Also added avg for native histograms as in #11973, to be discussed there.