How to set agent metrics for managed group

8/22/2017

I would like to set auto-scaling for my GCE instances. I read the documentations and I understood that I can set a custom metric as the factor to allow google autoscaler to resize my cluster. Now, I would like to set the memory/percent_used as the metric and I did it but what I see is a wrong value because I receive always 100 as the value. Seeing in stackdriver I can see the metric and I also can see the right value. But In StackDriver I see the metric settled like this memory/percent_used:gce_instance(used, 124567892364, europe-west1-d, project-123456). I tried to set the same in the GCE auto-scale options but I receive an error metric does not exist. Is there someone that can help me and tell me how I can set the right metric or give me some links for reading about this?

-- Giorgio Cerruti
google-compute-engine
google-kubernetes-engine
stackdriver

1 Answer

9/1/2017

For now, seems to be impossible to use the metric for achieving that goal. I have opened a thread in google groups at this link where you can follow the evolving of the discussion.

TL;DR

The windows agent sends metrics using some labels and the google cloud autoscale for managed group can't filter that labels at the moment. So, the 100% value that you see is the sum of free memory and used memory. They are working to implement the labels filtering into the option of the managed group, Google team wrote.

UPDATE

I wrote a small client for achieving this goal. I used JS (node.js) for doing that. You could find the application at this github link. Hope this can help someone.

-- Giorgio Cerruti
Source: StackOverflow