31 votesZach Bjornson commented
This is sort of available now (https://cloudplatform.googleblog.com/2018/03/queue-based-scaling-made-easy-with-new-stackdriver-per-group-metrics.html), but seems to have the fatal flaw that instances can be terminated before they are done processing a message:
> Note that [num_undelivered_messages] exports the total number of messages in the queue, including messages that are currently being processed but that are not yet acknowledged. Using a metric that does not include the messages being processed is not recommended because such a metric can drop down to 0 when there is still work being done, which prompts autoscaling to scale down and possibly interrupt the actual work.
Thanks, we will look into this.
Interesting idea, we’ll consider it – thanks!
This is something we are planning to improve, hopefully later in the year.Zach Bjornson commented
A similar case of handling mutability in GCP is how you can change the template for an instance group. If you change the template, then any newly created machines will be updated, but existing machines will be unchanged. It seems like that same type of thing could be applied to instance templates.
Note that because instance templates can refer to an image family, you can essentially mutate an instance template by publishing a newer image to the family. Thus there is currently no guarantee that template instances are identical.
As mentioned, exporting the billing data is one way you can obtain whatever sorts/filters you want, but we’re considering your suggestion. Thx!