Closed jaredhancock31 closed 2 years ago
Initially got same problems with the metric not able to fetch with error something like:
invalid metrics (1 invalid out of 1), first error is: failed to get pods metric: unable to get custom metric
.
Was able to get it working by using the following spec:
metrics:
- type: Pods
pods:
metric:
name: numSessions
target:
type: AverageValue
value: 75
The cause of Nil pointer issue in the original question seem to be value
field not defined.
Thanks for raising this, and thanks for pointing out a workaround! So this is in fact still a bug, for the Pod metrics it should be looking at the averageValue
field, rather than the value
field. I'm just going to open this in the underlying repository this project relies on and get this fixed, so as a heads up in the next release it will use the correct averageValue
rather than the value
field.
Issue tracked here: jthomperoo/horizontal-pod-autoscaler#26
Thanks!
Describe the bug
I'm exporting custom metrics using prometheu under
type: Pod
and am getting panics from nil pointers.It's unclear if such metrics are supported here or if I'm just misconfiguring the spec. My HPA (
autoscaling/v2beta1
) is able to track this metric without issue on EKSTo Reproduce
I also tried using a different spec, since I know K8s has tweaked it a lot over the last few releases. Something like:
observed logs:
Expected behavior No nil pointers
Kubernetes Details (
kubectl version
):Additional context Add any other context about the problem here.