I have following yaml-configuration for my horizontal pod autoscaler in GCP.
//...
metrics:
- type: Pods
pods:
metric:
name: "my-custom-metric"
target:
type: AverageValue
averageValue: 60
//..
I have added the metric as a custom metric in metric explorer in Cloud Monitoring. It is a log based metric. I have even added it to a dashboard and it looks fine.
For HPA the metric is not found. I get "Unable to read all metrics".
I'm not sure why? Do I need to add specific permissions in my serviceaccount? Or do I need to use a Custom Metrics Adapter? Does the HPA not have access without a adapter?
I have even tried to add the full name path for the metric name, but I get an error that "/" is not allowed in the name.
I would appreciate any help!