Currently I am using the following query
sum(rate(kube_pod_container_status_restarts_total{namespace="default"}[5m]))
to get alerted when 1 or more container get restarted in default namespace.
This gives me the number of containers that restarted but not their names. Is there a way to get the name of containers that restarted?
Thanks you.
Try the below query
sum (changes (kube_pod_container_status_restarts_total[1m])) by (container,container_name,endpoint,instance,job,name,namespace, pod, pod_name,service)