-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use metricName value to set metric name #3182
Conversation
Signed-off-by: vivekjainx86 <vivekjainx86@gmail.com>
Signed-off-by: vivekjainx86 <vivekjainx86@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good,
Only small nit inline
Could you open a PR in keda-docs repo explaining this new parameter?
pkg/scalers/predictkube_scaler.go
Outdated
} else { | ||
return nil, fmt.Errorf("no metricName given") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd not do this mandatory. I understand the reason to set it, but there are cases where this is not needed and we should use the default value (the current value).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, will do that. Also, changes in keda-docs, you mean in this file? if not, can you please point me out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you help me understand why do we need to introduce this parameter please? We are traing to get rid of it in general and rely on generating, as it is internal stuff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a scenario where PredictKube scaler is used in multiple ScaledObjects, there metric will be same, i.e. s0-predictkube-predictkube_metric
.
The need of that parameter was to use user provided metricName
value to uniquely identify the metric, similar to as used in Prometheus scaler. The current code doesn't do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK and are you talking about uniqueness from KEDA side or from PredictKube? Becase on KEDA side the uniqueness is assured by the combination of metricName
and label on ScaledObject
. So having the same metric name for multiple SOs is not a problem, we are distingush them by labels.
Do you face any specific issue in your setup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am talking about uniqueness from PredictKube.
Currently, we have multiple ScaledObjects
with multiple triggers (PredictKube
scaler along with Prometheus
scalers).
But in future, we might have multiple PredictKube
scalers in single ScaledObject
, then it will be difficult to identify the metric by using its index, and it will not be readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And for what exactly do you need to read that? That's pure internal thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And it's just a name it is not a metric (value) itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand it. The thing is we are plotting the metrics graph to analyse the triggers and it's related scaling pattern. For Prometheus scalers, we can see given metricName
, but for PredictKube, we cannot. You can refer to attached screenshot.
Even if you say that it's internal thing, but it is visible in Keda metric, and can be used to plot graphs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you just add ScaledObject to the graph? So you can distinguish the values?
Signed-off-by: vivekjainx86 <vivekjainx86@gmail.com>
Signed-off-by: vivekjainx86 <vivekjainx86@gmail.com>
Signed-off-by: Vivek Jain <38214848+vivekjainx86@users.noreply.github.com>
Hello @JorTurFer , can you please re-review the PR? I have made suggested changes, also created PR in keda-docs. Please let me know if anything missing. |
let's try till this is solved. TBH, I don't like so match giving this option because we changed it to make it internal and avoid user configs here |
We are talking about single scale object having multiple metrics. how to distinguish between them in graph & metrics? |
Each metric in ScaledObject has different name, so you can distinguish between them? |
Please let us know which metric is distinguishable & more importantly readable/informative? Giving random metric name in Metrics without fix
Metrics with fix
|
Signed-off-by: Vivek Jain <38214848+vivekjainx86@users.noreply.github.com>
implemented in other way |
@zroubalik can you please share PR link or commit link of new implementation for reference? |
Signed-off-by: vivekjainx86 vivekjainx86@gmail.com
It fixes the issue #3180
Checklist
Fixes #3180
Relates to #