I need to calculate the availability of a pod in kubernetes over a period of time in percentage using PromQL. Any suggestions are welcome.
I was able to achieve it with below query:
(sum_over_time((sum(kube_pod_status_ready{cluster="$cluster",condition="true", namespace="$namespace"}))[$availability_span:5m])) / (sum_over_time((sum(kube_pod_status_ready{cluster="$cluster",namespace="$namespace"}))[$availability_span:5m])) * 100