title: Prometheus cAdvisor docker monitoring
body: <p>I've setup a docker monitoring stack using Prometheus, Grafana and cAdvisor. While using this query to get running containers:</p>
  
  <pre><code>count_scalar(container_last_seen{name=~container1|container2})
  </code></pre>
  
  <p>It picks up the containers allright, as soon as i launch a new container it is picked up right away. The problem is when a container is stopped or removed it does not pick it up, it still shows it as a running container.</p>
  
  <p>From the cAdvisor/metrics endpoint it is removed as soon as the container stops.</p>
  
  <p>Is there something wrong with the query?</p>
  
  <p>(this is what i used for the stack: <a href="https://github.com/vegasbrianc/prometheus" rel="noreferrer">https://github.com/vegasbrianc/prometheus</a>)</p>