-
Notifications
You must be signed in to change notification settings - Fork 40
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
Keep cumulative metrics monotonic across collection restarts #1624
Comments
A couple of thoughts on implementation. I would recommend we keep the exact original data as reported by the producer. We can add one or more other columns that represent the shifted value. For example, keep a column that is the last value from the preceding time window, and another which includes the reported measurements added to that. The latter is what most people would probably want to see. Another point is that we should be pretty careful about how we do that for floating point types -- we need to avoid catastrophic cancellation. |
If we decide to move forward with #5273, restarts in cumulative data is handled by always converting them into deltas when we first retrieve data from a timeseries. We can close this if we integrate that PR. |
Closing now, since OxQL automatically handles restarts. |
Was getting some clarification from @bnaecker about metrics types and he mentioned this issue with cumulative metrics:
From an end-user point of view, a cumulative metric that resets in this way is wrong, or at least misleading: it looks like a sawtooth when it should be a monotonically increasing line. One can imagine various ways of fixing this:
The latter two options are not fully general because in order to get the correct offset for data after restart
N
, you need to know the last data point before restarts1..N
so you can add them all up. That means that if you're looking at data in a certain window of time, you also need to pull data from outside that window to do the correction. For these reason, the database solution is likely best. It would avoid post-hoc corrections — fetching data in a given window would simply give you the right data for that window.The only downsides I can think of to the DB approach are:
The text was updated successfully, but these errors were encountered: