Can I use Google Cloud Monitoring to monitor a failing Container / Pod?

4/16/2020

Trying out Google Cloud Monitoring - I am struggling to create an alert using out-of-the-box metrics for when a Container or Pod has errors, is unschedulable, and so on. Really basic stuff to monitor if my application(s) are healthy. Something that is really easy to configure using Prometheus.

There is a resource type called "GKE Container" but it mostly contains basic stuff like CPU and memory usage. There is also a resource type called "Kubernetes Pod" but that one only contains stuff tagged with kubernetes.io/anthos and all the metrics / time series are empty.

Is this a conscious omission on Google's part - i.e. I need to deploy something myself? My hopes for Google Cloud Monitoring was that I didn't need to deploy & configure as much stuff as I did with Prometheus - it's a paid service after all.

-- Erik Zivkovic
google-cloud-monitoring
google-kubernetes-engine

1 Answer

4/16/2020

Currently, GKE does not export this data by default. You can use Kube-state-metric to export data in Prometheus format. https://github.com/kubernetes/kube-state-metrics has way to provide a lot of such metrics. You can ingest this data info Stackdriver using Prometheus-to-stackdriver exporter. You can follow this link: https://cloud.google.com/monitoring/kubernetes-engine/prometheus.

-- Shubham Singh
Source: StackOverflow