<p>I have an use case where I need to collect the <strong>downtime of each deployment</strong> (if all the replicas(pods) are down at the same point of time).</p>

<p><strong>My goal is to maintain the total down time for each deployment since it was created.</strong></p>

<p>I tried getting it from <strong>deployment status</strong>, but the problem is that I need to make frequent calls to get the deployment and check for any down time.</p>

<p>Also the <strong>deployment status</strong> stores only the latest change. So, I will end up missing out the changes that occurred in between each call if there is more than one change(i.e., <strong>down time</strong>). Also I will end up making multiple calls for multiple deployments frequently which will consume more compute resource.</p>

<p>Is there any reliable method to collect the <strong>down time data of an deployment</strong>?</p>

<p>Thanks in advance.</p>

Sujai Sivasamy
<p>A monitoring tool like prometheus would be a better solution to handle this. 
As an example, below is a graph from one of our deployments for last 2 days </p>

<p><a href="https://i.stack.imgur.com/99gPA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/99gPA.png" alt="Deployment Availablity"></a></p>

<p>If you look at the blue line for unavailable replicas, we had one replica unavailable from about 17:00 to 10:30 (ideally unavailable count should be zero)</p>

<p>This seems pretty close to what you are looking for. </p>
