<p>I have a system in which a container is created every hour and I want to get an alert when a container is not created for a certain period of time from Prometheus or Grafana. Is there anyway to get a count of containers created in last let say X-hr and send an alert if the count of containers are less? 
The containers have a name template like : 2019-month-date-hour<br>
Eg: 2019-5-11-23</p>

<p>I tried to use this query to get the count of containers created in a month <code>count(count(container_last_seen{container_name=~"2019-5.*", namespace=$namespace}) by (container_name))</code> but not able to set grafana alert on this query for a period of time. </p>

Aman Kr Singh
<p>This is what you should do</p>

<ol>
<li>use event exporter to capture the events generated in kubernetes cluster</li>
<li>get those events in promethues</li>
<li>create prometheus rule to check for container/pod creation event</li>
<li>get prometheus invoke alert via alert manager using the rule</li>
</ol>
