I would like to calculate the percentage time that a given metric is non-zero in a time range. I know I can get the number of values in that time range using
count_over_time(my_metric[1m])
but what I would like is something like
count_over_time(my_metric[1m] != 0) / count_over_time(my_metric)
I can't do this because binary expression must contain only scalar and instant vector types.
Is there a way to do what I'm trying?