title: Monitoring and alerting on pod status or restart with Google Container Engine (GKE) and Stackdriver
body: <p>Is there a way to monitor the pod status and restart count of pods running in a GKE cluster with Stackdriver?</p>
  
  <p>While I can see CPU, memory and disk usage metrics for all pods in Stackdriver there seems to be no way of getting metrics about crashing pods or pods in a replica set being restarted due to crashes.</p>
  
  <p>I'm using a Kubernetes replica set to manage the pods, hence they are respawned and created with a new name when they crash. As far as I can tell the metrics in Stackdriver appear by pod-name (which is unique for the lifetime of the pod) which doesn't sound really sensible.</p>
  
  <p>Alerting upon pod failures sounds like such a natural thing that it sounds hard to believe that this is not supported at the moment. The monitoring and alerting capabilities that I get from Stackdriver for Google Container Engine as they stand seem to be rather useless as they are all bound to pods whose lifetime can be very short.</p>
  
  <p>So if this doesn't work out of the box are there known workarounds or best practices on how to monitor for continuously crashing pods?</p>