I like this as a general idea and as you note it would deal with a lot
of situations where one needs to use subqueries today. However, I think
there may be semantic issues with feeding filtered range vectors to
operations like rate() or delta(). For instance, if you do
delta(metric[1h] > 0), does delta() extrapolate using the timestamps of
the first and last time series in the original range vector or the
filtered one?
(You might say 'why are you filtering delta()?' and one plausible answer
is 'the metrics source sometimes glitches out and returns impossible
results, we want to filter them out to get the delta of the real
readings'.)
- cks
PS: speaking of timestamps, it would be nice if timestamp() worked on a
range vector and yielded its own range vector of the timestamps of every
element of the range vector, basically replacing the original values in
the range vector with the corresponding timestamps. But this is probably
outside PromQL's processing model.