[processor/cumulativetodelta] Deciding whether to keep the first point based on linear point speculation #35487
Labels
enhancement
New feature or request
priority:p2
Medium
processor/cumulativetodelta
Cumulative To Delta processor
Component(s)
processor/cumulativetodelta
Is your feature request related to a problem? Please describe.
When there is no accurate time information for the first point, the first two points can be used to determine whether to keep the first point or not, based on the change in value to infer if the first point is growing from 0.
Describe the solution you'd like
VictoriaMetrics' implementation of the increase function may be good for us: https://github.com/VictoriaMetrics/VictoriaMetrics/blob/3d01bc3fbe3d8f4ff4909408fe45ffc1c1acdcf7/app/vmselect/promql/rollup.go#L1828
It does this by taking the first two points (denoted$v0$ and $v1$ ), and considering that there is a 0 before the first one if and only if $v0 < 10 * (v1 - v0 + 1)$ .a 0. (As we require the input to be monotonic, the
Abs
could be ignored`)We can use the same rules to decide whether to output the first point directly as a delta metric point.
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: