Currently metric name is hard coded to a specific value (see the example on Kafka scaler), this applies to most of the scalers. Metric name is essential for Metric server and HPA as it is used to distiguish the correct metrics used for scaling.
If we define two or more scalers of the same kind in one ScaledObject, scaling won't be correct as all the scalers will share the same metric name, eg. for Kafka it would be lagThreshold. This could be even problem when using specific combination fo different scalers, as they are using same metric name, eg. Kafka and Stan and probably some others as well.
Using multiple scalers of different kind (or same kind but with different metrics) in one ScaledObject is working: https://github.com/kedacore/keda/issues/702
If we want to support multiple scalers, we will need to do modification in every scaler. Each scaler would have to use unique metric name, it's up for discussion what approach would be the best, some of the possibilities are:
ScaledObject (to keep the same metric name for the scalers that we have in v1)ScaledObjectThere could be multiple scalers of the same kind in ScaledObject
metric name?//EDIT added note about Kafka + Stan scalers
Let's enforce this as of v2.0; think this is a good point of improvement!
add unique preffix/suffix to the metric name
I would go for this as it's consistent across scalers & scenario which we can use in our logging as well
I think having an optional parameter to provide a unique name . if it's not found then we can generate the unique name based on the parameters for the scalar.
That's a good suggestion imo!
Yeah, but we should bear in mind that the generator must be idempotent, provide the same "unique" value for the same trigger.
yes. i think we can generate it based on the parameters provided. for example : kafka-scalar-> "kafka-topic-group"
@AmithGanesh are you volunteering to implement this? 馃槃
yes. i would like to take this up
@AmithGanesh what is the status of this please?
Almost done. will submit a Pull Request by the end of the week.
@AmithGanesh that's great! You might want to share your progress on a meeting this Thursday :)
@AmithGanesh any update on this?
opened a PR for this. https://github.com/kedacore/keda/pull/866
@samuelmacko agreed to finish this
Solved in #966
Most helpful comment
Yeah, but we should bear in mind that the generator must be idempotent, provide the same "unique" value for the same trigger.