How to measure containers start-up and end time from some API?

7/1/2017

I am running a kubernetes cluster with heapster and prometheus service. I want to measure each container and pods start and end time but i could not find such statistics in prometheus.

I want to get these statistics through some api.

Does anyone know how can I get it ?

-- Anshul Jindal
docker
heapster
kubernetes
prometheus

2 Answers

8/4/2017

Actually I was able to measure up the container start time using the heapster events for a pod. For each container, inside the pod heapster captures the events, from this I was able to at least get containerCreated and ContainerStart timestamp.

-- Anshul Jindal
Source: StackOverflow

7/1/2017

The kube-state-metrics job exports various Kubernetes API relates stats for Prometheus, including in kube_pod_info the Pod start time:

https://github.com/kubernetes/kube-state-metrics/blob/master/Documentation/pod-metrics.md

-- tom.wilkie
Source: StackOverflow