filter range vector without knowing scrape interval

15 Views Asked by At

I'm trying to figure out how to filter range vector correctly and then use it to select other metric values and do some aggregation over it, ie. something like

count_over_time((metric_a and (metric_b > 95)[30m])

The issue I do not understand is if I do not put scrape interval after lookbehind windows into square brackets, I do not get all values of metric_a, just - as it seems - the first and the last one.

As I learnt in other related question, and after some experimentation, I ended up with this

count_over_time((metric_a and (metric_b > 95))[30m])[30m:10s])

and then I (seem to) get all values I want. The scrape interval I specify should match the real, but I may not know it. How can I just get all values from a range vector and filter them without knowing/specifying scrape interval?

0

There are 0 best solutions below