How to get the number of nodes in a GKE node pool as a stackdriver metric?

8/7/2019

I'm making a dashboard in GCP stackdriver. We have a autoscaling node pool which the pods I'm interested in monitoring run in. What I'm wondering is how do I monitor the amount of nodes the are currently running in the pool?

I've had a look at log based metrics, but I can't find anywhere in the logs where it actually says how many nodes are currently running.

-- Andy
google-cloud-platform
google-cloud-stackdriver
google-kubernetes-engine

2 Answers

8/7/2019

In stack driver if you are using the new stack driver it will show the all the running node in an infrastructure part inside kubernetes engine menu.

If you will click on the node it will show all the containing namespaces of further you will click it will show all the running pods also.

for more deatils, you can check this out : https://medium.com/google-cloud/new-stackdriver-monitoring-for-kubernetes-part-1-a296fa164694

-- Harsh Manvar
Source: StackOverflow

8/13/2019

There's no metric for number of nodes per se. We can get something similar though with the sum of Total cores grouped by cluster_name:

stackdriver resource selection

-- Aleksi
Source: StackOverflow