Thanks for your observations.
I tried the approach you suggested but I am not getting the expected result which is an incremental counter. I see the results incrementing when is less than 98 but I also see decreasing result sometimes when is not less than 98. It does not make any sense to me.
So I tried a work around with a recording rule to register the times when the result is less than 98. The recording rule comes from this query:
record: service:http_service:availability:1m
expr:
sum by(method) (100*sum by (method)
(rate(demo_api_request_duration_seconds_count{status="200"}[1m])) / sum
by (method) (rate(demo_api_request_duration_seconds_count[1m])) <
bool 98
It works fine. Then , I just do:
sum_over_time(service:agent_dispatcher_api:availability:1m[1d:1m])
I solved my problem from this perspective. But I am still not able to figure out why I am getting decreasing results from the query in question.
Thanks
Lp