How can I alert for container restarted?
I used the following Prometheus alert rule for finding container restarts in an hour(can be modified to max time), It may be helpful for you. Prometheus Alert Rule Sample ALERT ContainerRestart/PodRestart IF rate(kube_pod_container_status_restarts[1h]) * 3600 > 1 FOR 5s LABELS {action_required = “true”, severity=”critical/warning/info”} ANNOTATIONS {DESCRIPTION=”Pod {{$labels.namespace}}/{{$labels.pod}} restarting more than once during last one hours.”, … Read more