# Alerting when pod count equals 0

**URL:** <https://community.dynatrace.com/t/alerting-when-pod-count-equals-0/45620>\
**Category:** Alerting\
**Tags:** dynatrace-managed, anomaly-detection, kubernetes\
**Created:** [May 16, 2024, 12:25pm UTC](https://community.dynatrace.com/t/alerting-when-pod-count-equals-0/45620 "2024-05-16T12:25:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sivart\_89](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@sivart\_89](https://community.dynatrace.com/u/sivart_89)\
**Post date:** [May 16, 2024, 12:25pm UTC](https://community.dynatrace.com/t/alerting-when-pod-count-equals-0/45620/1 "2024-05-16T12:25:05Z")

</div>

What is the best way to alert when a specific pod does not exist (was running but now is not). A few metrics that I have looked at are&nbsp; **builtin:kubernetes.workload.pods\_desired** and&nbsp; **builtin:kubernetes.pods:filter** but something I don’t like about these is that when the pod is running then there is simply no data shown. Instead of having a value of 0 there is just no data.

I don’t like to use something like&nbsp;default(0, always) OR ‘alert on missing data’ because to me this could be misleading. If the kubernetes integration is severed and we are no longer collecting these metrics then we will have a false positive, an alert will be created even if the pod is actually still running.

Is there really no metric that will simply show me a value of 0 if the pod is not running, and without having to manipulate the metric expression with something like&nbsp;default(0, always)?

---

<div class="post-metadata">

**Author:** ![Esam\_Eid](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/esam_eid/32/167_2.png) [@Esam\_Eid](https://community.dynatrace.com/u/Esam_Eid)\
**Post date:** [May 16, 2024, 12:36pm UTC](https://community.dynatrace.com/t/alerting-when-pod-count-equals-0/45620/2 "2024-05-16T12:36:56Z")

</div>

Hi&nbsp;[@sivart\_89](https://community.dynatrace.com/user/17361)&nbsp;,

pod = process. You need to go to the process group setting and do the following

 ![Esam_Eid_0-1715862945071.png](https://global.discourse-cdn.com/dynatrace/original/2X/7/745438da1bd29688897fc814d632a2c877457076.png)

if the count is less than 1, you will receive alert as below

![Esam_Eid_1-1715862992894.png](https://global.discourse-cdn.com/dynatrace/original/3X/4/5/457bf12dfccd2e1464ec0ac4663494240b86821c.png)

Regards,

Esam

---

<div class="post-metadata">

**Author:** ![sivart\_89](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@sivart\_89](https://community.dynatrace.com/u/sivart_89)\
**Post date:** [May 16, 2024, 5:05pm UTC](https://community.dynatrace.com/t/alerting-when-pod-count-equals-0/45620/3 "2024-05-16T17:05:14Z")

</div>

Ahh alright that makes sense. I was looking for a metric supplied from the K8s integration but I suppose this will work.

---

<div class="post-metadata">

**Author:** ![dannemca](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dannemca/32/7215_2.png) [@dannemca](https://community.dynatrace.com/u/dannemca)\
**Post date:** [May 16, 2024, 6:48pm UTC](https://community.dynatrace.com/t/alerting-when-pod-count-equals-0/45620/4 "2024-05-16T18:48:33Z")

</div>

Check this topic here, it may give you some hints on K8S monitoring best practices:

[https://community.dynatrace.com/t5/Feedback-channel/Introducing-easy-alerting-on-common-Kubernetes-platform-issues/m-p/197824](https://community.dynatrace.com/post/197824)

Similar question that you may also check:

[https://community.dynatrace.com/t5/Container-platforms/Need-some-guidence-related-to-Kubernetes-monitoring/m-p/238161](https://community.dynatrace.com/post/238161)
