-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
interpolate() should incorporate samples immediately before or after the query range, when available #6437
Comments
@hagen1778, do you have a sense whether this is actionable? It's currently causing embarrassingly incomplete/incorrect charts in our customer-facing web application, so I'd like to understand whether a fix might be forthcoming or if I need to hunt for workarounds. 😅 I've noticed that |
Hello @mactyr! In the current implementation, all transform functions have no knowledge about datapoints outside the interval. I don't know yet if this is actionable - I need feedback from @valyala who originally added this function. |
Hey @mactyr! It is unlikely we're going to change transform functions to capture data before and/or after the requested interval, in the same fashion as rollup functions do. This could be a severe change. |
Thanks for offering that change, @hagen1778, but extrapolating from the samples within the interval definitely isn't safe with our real data, where the rate of change varies quite a bit over time. My first impulse is to ask if there could be a version of interpolate that is a rollup (like So my next question is whether you all could take another look at #3079 and see whether that might be actionable? What I'm really trying to do here is just get the |
Describe the bug
The current implementation of
interpolate()
gives inconsistent results depending on the query time range. For instance, suppose I have a time/value series like this (leaving blank lines to emphasize gaps):If I run
interpolate()
on a query from 1:00-1:07 with a step of1m
, I'll get a value of 2 at 1:02 and 5 at 1:05, as expected. But if I run a range query from 1:02-1:05, I will see no value for 1:02 or 1:05, even though the information is available outside the range to interpolate what the values at the ends of the range should be.I expected
interpolate()
to use samples before or after the query window to complete the interpolation similar torate()
, but it appears it doesn't do so.To Reproduce
Zoom into an interpolated query_range so that there are gaps in the source data at the start and/or end of the range, and observe that the interpolated series had a values at the edges of the zoomed-in region when zoomed out, but not when zoomed in. E.g., in this screenshot, the interpolated series (blue) has a value at 2024-01-20 12:00 and 2024-01-23 00:30 (where the cursor is):
But if I zoom in so those times are at the edges of the time range, the interpolated series has no values at those times (step is 30m in both screenshots):
In this example, the gaps at the edges are only one step long, but they can be longer if the gap in the underlying samples is longer.
Version
Logs
No response
Screenshots
No response
Used command-line flags
Additional information
Note that this is not a request to revert #3816. If there is no sample available before or after the query range, then it is appropriate for the interpolated series to have no values at that end of the query window. This request only concerns when there is a sample before and/or after the query window that can be used to interpolate the values at the beginning or end of the time range.
The text was updated successfully, but these errors were encountered: