GoogleCloudPlatform / GoogleCloudPlatform/k8s-stackdriver
Horizontal Pod Autoscaling via custom-metrics-stackdriver-adapter fails for metrics “more than 63 characters”
- Dominant language
- Go
- Stars
- 409
- Forks
- 236
- Avg merge
- 2h 34m
- Merged PRs (30d)
- 9
Description
Potentially similar issue to https://github.com/GoogleCloudPlatform/k8s-stackdriver/issues/316 but I don't want to hijack that issue.
I've deployed `custom-metrics-stackdriver-adapter` and which to use the metric `pubsub.googleapis.com|subscription|num_undelivered_messages` to scale my pods via HPA.
As such I followed the [official tutorial](https://cloud.google.com/kubernetes-engine/docs/tutorials/external-metrics-autoscaling?hl=en_GB).
However, because my subscriptions name is over 63 characters in length when I run `kubectl describe hpa ` I get the following events.
```
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning FailedGetExternalMetric 12s (x2 over 27s) horizontal-pod-autoscaler invalid label value: "": must be no more than 63 characters
Warning FailedComputeMetricsReplicas 12s (x2 over 27s) horizontal-pod-autoscaler failed to get pubsub.googleapis.com|subscription|num_undelivered_messages external metric: invalid label value: "": must be no more than 63 characters
```
Does `custom-metrics-stackdriver-adapter` manage situations where subscription names are too long or is there a way to alias a metric for use in K8s? I really do not want to change the name of the subscription due to loss of clarity given the amount of subscriptions I already have.
Contributor guide
Assessment
This issue has not been assessed yet.