How to use last_over_time?

Hi,
AFAIK the last_over_time function will shift the last point before no data (as long as the last point is in the range). It will return time series where each point will represent the last visible point (I’ll share some prepared screenshots, sorry for lack of queries but I’m using some custom metric and data privacy :man_shrugging:)
Regular data returned by expression metric:

The data returned with expression last_over_time(metric[$__range]) (notice I’m using $__range and not $__interval):

The last point was shifted to “now”.

What I think you need is to use last_over_time with $__range (or e.g. 1h) lookbehind window (not $__interval since it might be too small range for your case) and use instant query. Notice that if the metric wasn’t updated (returns no data) for more than the range in lookbehind window, it will still return no data - you can’t just ask for the last point and expect it to forever be (your metric could have changed for example and it’s not even there).