0

In google cloud I created a custom log-based metric to use for my instance group autoscaler. I can view the metric in the metrics explorer. The metrics explorer clearly shows that google added the requred "instance-id" and "zone" labels for me (yay). I can also so that the "Logs Ingestion" status for GCE Autoscaler is "All ingested". Unfortunately I am still seeing the following error in my instance group for the autoscaler:

"The custom metric that was specified does not exist or does not have the necessary labels. Check the metric."

This error appears in the top of the instance group summary when the instance group is launched. The result is that the metric in the "monitoring" section of the instance group is flat (0) instead of how it looks in the metrics explorer and the instance group is not autoscaled.

Any help would be appreciated.

Thanks!

Grzenio
  • 35,875
  • 47
  • 158
  • 240
  • Welcome to SO. Please format your question. For example the error part can be formatted with the existing SO input tool. – Karthick Ramesh Dec 04 '19 at 02:15
  • I would need more information in order to help out, your error message can be applied to many things, for example, a custom metric can be applied to a kubernetes cluster for autoscaling purposes. If the necessary labels aren’t there it will produce the exact same error. Can you give me a specific example of when this error comes, and how it affects your instance group. – hachemon Dec 04 '19 at 04:56
  • Thanks Karthick! hachemon, I updated the question with my response – John Pandich Dec 04 '19 at 13:39
  • To be sure, do you need autoscaling on or off? If you are using Kubernetes to manage autosclaing it would be normal that the autoscaling in your instance group is off, as kubernetes is the one managing your cluster autoscaling. Because of this, if you are trying to monitor scaling within the cloud console, it will not work. Have you allowed API access? And finally are you sure the metric you see in stack driver is the same metric you are not seeing in the console? – hachemon Dec 04 '19 at 23:47
  • We are not using Kubernetes yet so we do need autoscaling on. APIs are enabled, including the Compute Engine and Stack Driver APIs though I am not sure if that is a requirement. I can tell you that I am referencing the same "logging.googleapis.com/user/"... URI – John Pandich Dec 05 '19 at 13:04
  • It seems that this would require a deeper investigation of your project. I would recommend you open a case with Google Support. – dany L Dec 06 '19 at 02:41

1 Answers1

0

Think you might have specified incorrect Metrics identifier. You need to specify the name as custom.googleapis.com/appdemo_queue_depth_01.

enter image description here

If you haven't come across this page, please take a look at this page which includes detailed instructions on how to setup custom metrics.

Parth Mehta
  • 1,869
  • 5
  • 15