Hello team, I'm attempting to set up an alert for...
# support
r
Hello team, I'm attempting to set up an alert for container restarts in Kubernetes. I'd like to average the restarts by deployment name, but the deployment name isn't appearing in the "avg by" clause list. Do you know why it's missing or how I can add it? Please refer to the attached screenshot for more details.
v
Can you check if that is present in label?
r
in labels, I do not have deployment name, but I do have a label called, "app" which is also not shown here
@Vishal Sharma, What is the right way to setup an alert if a pod restarts? because right now, I am always getting the restart value as 2 as per the above one and the alert keeps on firing,
Hey @Vishal Sharma, it would be great if you can share some info on this?
@Srikanth Chekuri Can I get some insights on this?
s
What is the right way to setup an alert if a pod restarts? because right now, I am always getting the restart value as 2 as per the above one and the alert keeps on firing
Add a running difference function. It is available in the functions list. If container didn't restart again in the current period running diff would give zero.
r
Thanks @Srikanth Chekuri