Search code examples
kubernetesprometheusmetrics

Prometheus scrape node terminate time


I am trying to figure out how I can get prometheus to scrape the termination time, specifically the time a Node was terminated giving a UNIX timestamp, of a Node inside a kubernetes cluster. I am using kube state metrics for exporting node information however in the docs there isn't any mention of termination time, like there is with pods.

I am wondering if I need to scrape the kube_node_status_condition gauge metric, and just be aware when the status changes. However I'm not sure what status I would look for in that case.

Let me know if additional information is needed.


Solution

  • Kube State metrics now offers this as an option out of the box: https://github.com/kubernetes/kube-state-metrics/issues/1889