Hello is there any idea for my question? <https://...
# support
a
c
Copy code
avg_over_time(kube_pod_container_status_restarts_total{job="kube-state-metrics"}[5m]) > 0
Can you try this query ? This will calculate the average number of restarts over the last 5 minutes and check if the average is greater than 0 for the kubernetes container restart metrics.
a
Hello, avg_over_time(k8s_container_restarts{k8s_namespace_name="abc"}[5m]) > 0 and ı got container total restart count.I constantly receive alerts because the number of restarts is greater than the alert threshold. How can I get the number of restarts for just 5 minutes?
c
Copy code
rate(k8s_container_restarts{k8s_namespace_name="abc"}[5m]) > 0
This will give you the number of restarts over just the last 5 minutes without averaging. Can you try this ?
a
I tried but query gives no data response.
c
Did you use proper namespace ? Any error you’re getting?
a
yes ı used proper namespace . and ı didnt get any error.only no data screen