We have many use-cases when we want to calculate success rate but there were not tasks that succeeded, we would expect that the success rate will be 0, but it's none.
lets take these metrics as an example:
http_requests_total{state="failure"} = 10
http_requests_total{state="succes"} - never happened so there is no value at all
I would like to calculate the success rate (which is 0 in this case). Performing division of:
http_requests_total{state="success} / sum(http_requests_total) ignoring (state)
return no data points.
Any suggestion? Am I doing it wrong?
Tried to perform:
(http_requests_total{state="success} or 0)/ sum(http_requests_total) ignoring (state)
but or operator doesn't work
I expect the output will be 0, but it's "No data points"