# Kubernetes Pod Phase Monitoring

**URL:** <https://community.dynatrace.com/t/kubernetes-pod-phase-monitoring/35847>\
**Category:** Container platforms\
**Tags:** data-explorer, kubernetes\
**Created:** [July 13, 2022, 9:08pm UTC](https://community.dynatrace.com/t/kubernetes-pod-phase-monitoring/35847 "2022-07-13T21:08:24Z")\
**Posts on this page:** 5\
**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:** [July 13, 2022, 9:08pm UTC](https://community.dynatrace.com/t/kubernetes-pod-phase-monitoring/35847/1 "2022-07-13T21:08:24Z")

</div>

Using the Kubernetes: Pod counts metric (metric key&nbsp;builtin:cloud.kubernetes.workload.pod) you can filter by the pod phase which shows Running, Succeeded, Pending, or Failed. There are other states that a pod could be in such as&nbsp;**Deleted (Terminated)**, see below.&nbsp;Am I missing something here?&nbsp;I specifically need to monitor for that state as well but can’t seem to find a way.

 ![travis_anderson_0-1657746311904.png](https://global.discourse-cdn.com/dynatrace/original/3X/7/f/7f3fdc9af558474ce6bda331348a64a7ba06f8ed.png)

---

<div class="post-metadata">

**Author:** ![abhi](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/abhi/32/30657_2.png) [@abhi](https://community.dynatrace.com/u/abhi)\
**Post date:** [July 14, 2022, 11:49pm UTC](https://community.dynatrace.com/t/kubernetes-pod-phase-monitoring/35847/2 "2022-07-14T23:49:25Z")

</div>

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

Please post this request in our RFE forum as this should be an enchantment request.

Product Ideas posted here are reviewed by our Product Management, who will provide feedback on the suggestion and indicate if the RFE is accepted, planned, already implemented, not planned, etc.

[https://community.dynatrace.com/t5/Dynatrace-product-ideas/idb-p/DynatraceProductIdeas](https://community.dynatrace.com/category/DynatraceProductIdeas)

---

<div class="post-metadata">

**Author:** ![florian\_g](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/florian_g/32/12081_2.png) [@florian\_g](https://community.dynatrace.com/u/florian_g)\
**Post date:** [July 18, 2022, 2:25pm UTC](https://community.dynatrace.com/t/kubernetes-pod-phase-monitoring/35847/3 "2022-07-18T14:25:36Z")

</div>

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

please help me understand why you would like to count terminated pods? This sounds like a forever-increasing metric. What’s the value of knowing how many pods were terminated (in the past)? Usually, if a pod is terminated, it’s not there anymore. It’s also no [official pod phase in k8s](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase). We just introduced this phase, as Dynatrace also shows you pods that are already gone/terminated.

best

florian

---

<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:** [July 29, 2022, 3:09pm UTC](https://community.dynatrace.com/t/kubernetes-pod-phase-monitoring/35847/4 "2022-07-29T15:09:54Z")

</div>

Hi Florian,

This particular app team has a cron job running in a pod and wanted to know when it has been terminated. I don’t know too much about kubernetes but we ended up going with this metric instead (later found this after digging more) and so far that is what they want. Maybe it doesn’t make sense to have that monitored, i don’t know being I’m not proficient with kubernetes but do know that seems to be what they want.

[Deprecated] Kubernetes: Containers per workload

---

<div class="post-metadata">

**Author:** ![florian\_g](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/florian_g/32/12081_2.png) [@florian\_g](https://community.dynatrace.com/u/florian_g)\
**Post date:** [August 1, 2022, 6:04am UTC](https://community.dynatrace.com/t/kubernetes-pod-phase-monitoring/35847/5 "2022-08-01T06:04:56Z")

</div>

Hi&nbsp;[@sivart\_89](https://community.dynatrace.com/user/17361),  
thanks for the clarification. I guess your team wants to track successful vs. failed executions of their jobs. In Kubernetes, they can find this as part of the&nbsp;[pod phase](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase). In Dynatrace, this information is available in the “builtin:kubernetes.pods” (Kubernetes: Pod count) metric. Please note, that Kubernetes keeps a history of successful and failed pods from being deleted depending on what is defined in the cronjob (see&nbsp; **successfulJobsHistoryLimit** &nbsp;and&nbsp; **failedJobsHistoryLimit** &nbsp;[here](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/cron-job-v1/#CronJobSpec))

 ![florian_g_0-1659333380002.png](https://global.discourse-cdn.com/dynatrace/original/3X/a/4/a4e818fe8af8285aa9e4913fa419277c1c6cfe07.png)

Best,  
Florian
