KEDA metric name issue #2635
Replies: 4 comments 16 replies
-
@zroubalik @JorTurFer This feels similar to #2632, right?
This was introduced a few versions back to ensure metric names are unique when using multiple triggers. In theory this should not break you but, afaik, you can always override the name with your own (but make sure it's unique) |
Beta Was this translation helpful? Give feedback.
-
I'm reviewing and probably we have made a mistake in external scaler. I can see that on GetMetrics we are passing the received metric name to the external scaler (with sX- prefix) and but probably we should pass the metadata metricName (the name given by user). the prefix usage is something internal from KEDA that we are making external in this call. Other option could be in this specific scaler, remove the prefix (which is known inside the scaler) and add it again after the external query. Thoughts @zroubalik ? |
Beta Was this translation helpful? Give feedback.
-
Just putting some of my findings here, trying to understand the behavior. Let's say I have an external scaler, and KEDA calls KEDA passes these on to the HPA as Executing {
"kind":"APIResourceList", "apiVersion":"v1", "groupVersion":"external.metrics.k8s.io/v1beta1",
"resources":
[
{"name":"s0-metricSpec1","singularName":"","namespaced":true,"kind":"ExternalMetricValueList","verbs":["get"]},
{"name":"s0-metricSpec2","singularName":"","namespaced":true,"kind":"ExternalMetricValueList","verbs":["get"]}
]
} At some point the I can see both these values when executing {
"kind":"ExternalMetricValueList","apiVersion":"external.metrics.k8s.io/v1beta1","metadata":{},
"items":
[
{"metricName":"metric1","metricLabels":null,"timestamp":"2022-04-07T08:16:21Z","value":"<value1>"},
{"metricName":"metric2","metricLabels":null,"timestamp":"2022-04-07T08:16:21Z","value":"<value2>"}
]
} My question here is, what are the individual metric names used for? Aren't these both just values for the metric |
Beta Was this translation helpful? Give feedback.
-
As for why our external scaler in Arc doesn't work is we internally use a map to store the list of metrics corresponding to metric names. So, when KEDA tries to call So the only case this really causes an error is when the external scaler has a condition on the metric name which might cause it to not return any values. If the external scaler is agnostic of the metric name passed to it in |
Beta Was this translation helpful? Give feedback.
-
Hi,
I am testing HTTP-triggered Azure Functions on Azure Arc with Keda version 2.5 and 2.6.1. We have created our external HTTP scaler on Keda for autoscaling.
I am getting the error below in the metrics API server
E0207 02:55:09.412436 1 status.go:71] apiserver received an error that is not an metav1.Status: &errors.errorString{s:"No matching metrics found for s0-upstream_rq_total"}: No matching metrics found for s0-upstream_rq_total
.The hpa shows a similar error:
invalid metrics (4 invalid out of 4), first error is: failed to get s0-upstream_rq_active external metric: unable to get external metric k8se-apps/s0-upstream_rq_active/&LabelSelector{MatchLabels:map[string]string{scaledobject.keda.sh/name: myapp,},MatchExpressions:[]LabelSelectorRequirement{},}: unable to fetch metrics from external metrics API: no matching metrics found for s0-upstream_rq_active
I see that from Keda v2.5 and later, the external metric names are prefixed with "sX-". Is this a new addition?
We have created our external HTTP scaler. Do we need to update our external HTTP scaler with these new metric names?
Any help would be appreciated. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions