Hi I need to know how to query in prometheus the pods that have been running in the k8s cluster in the last 3 months. I have tried with kube_pod_start_time * 1000
but I only obtain the time the pod started
Thanks!!
Hi I need to know how to query in prometheus the pods that have been running in the k8s cluster in the last 3 months. I have tried with kube_pod_start_time * 1000
but I only obtain the time the pod started
Thanks!!
This query expression will return the name of the pods with their corresponding age, that are running more than 90 days.
floor(sum by (pod) (time() - kube_pod_created) / 86400 > 90)
and this one will return the name of the pods that have been run in the last 90 days. Note there can be exited pods also, that doesn't exist now.
sum by (pod) (min_over_time(kube_pod_start_time[90d]))