How can I track Google Container Engine services from Stackdriver?

3/27/2018

I'm currently trying to set up Stackdriver so I can track availability of the various pods/services running in my cluster, but I can't find a way to do any tracking more granular in resource groups than instances. There's the ability to filter resources by "tag" but no documentation on what a tag is, or if the "name" tag corresponds to the pod name/service name/container image name/etc.

All I want is a resource group to track my service containers; how do I do this?

-- moberemk
google-cloud-stackdriver
google-kubernetes-engine
kubernetes
stackdriver

2 Answers

3/31/2018

Tags or labels can be assigned during the creation of the service, pod, etc. See here

Afterwards you will be able to "group by label" from the Stackdriver Dashboard, using your assigned labels.

Also yes, there is the possibility of more granular monitoring than instance or node. Go to Stackdriver "Metrics explorer" and select "GKE Container" as the "resource type". This lets you monitor a variety of metrics at pod level. Also, if you assigned label to your pods you can use those for filtering and grouping in a meaningful way for you.

I'm trying to avoid monitoring at pod level; I'm trying to monitor at cluster level

The set up will differ depending on what metric absence you want to alert, but it could go like this:

  • Log into the Stackdriver dashboard
  • Go to groups -> create group
  • You should see a suggestion to create a group formed by all your GKE nodes. If you don't create one using the common part of the node name as the criteria
  • Select "This is a cluster. I would like cases highlighted when any node's performance or configuration differs from others in the cluster."
  • Now you have a group representing your cluster. Click on "create alerting policy"
  • Create the policy you need. It will apply to the members of the group.

    If I understood you correctly this should be what you need.

-- Jordi Miralles
Source: StackOverflow

5/5/2018

Two days ago, in #KubeCon 2018 event, the Product manager of Stackdriver (JD Velasquez) announced the beta release of Kubernetes monitoring.

https://youtu.be/aa8cgmfHTAs (announcement + demo)

It is now out-of-the-box.

-- Abdennour TOUMI
Source: StackOverflow