what is the best way to get alert when a Kubernetes pod/container get restarted?
We are not able to get the alert after turning on the container restart anomaly detection for workload.
Creating a Metric event on a query (like the example below) , and using that to Alert based on an appropriate threshold helped in my case.
builtin:kubernetes.container.restarts:filter(and(or(in(“dt.entity.cloud_application_namespace”,entitySelector(“type(cloud_application_namespace),entityName.equals(~“eventservice~”)”))))):splitBy(“dt.entity.cloud_application”,“dt.entity.cloud_application_instance”):sort(value(auto,descending)):limit(20)
Please validate the query in Data explorer. Screenshot attached
