-
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
Deprecate explicitly setting metricName
for all scalers
#4235
Conversation
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.
This is a good idea, but sadly we cannot do it at this level because there are some scalers where metricName
is a valid value used in the scaler (like aws cloudwatch). We need to do it one by one
If aws cloudwatch is the only one, then we can probably add the exception to the code added in this PR. Or is there any other scaler where metricName is valid? |
I'm not 100% sure, I haven't had time to check it in depth yet |
@yardenshoham could you please check the source code of scalers that uses For example: keda/pkg/scalers/prometheus_scaler.go Line 48 in 72defc2
vs keda/pkg/scalers/aws_cloudwatch_scaler.go Line 36 in 72defc2
|
Will do, tonight |
Also remember that this doesn't solve all the cases. I mean, this adds the warning notification to all at once (which is nice), but scalers like prometheus requires metricName, they need to be updated to make it optional too |
Yes, I didn't claim this would resolve the issue |
Yeah, I know it, I said just to share the point. Maybe we can fix them as part of this PR if there are only a few. I mean, if only 1-3 scalers require changes, we could do it in one shoot |
I think it's a good idea. For prometheus, how about I normalize the query and set that as |
I think it's not necessary, adding a fixed value like 'prometheus' is more than enough as this is an internal value. Something like And please, add a comment in scalers where the metricName should be removed or write them somewhere to have them tracked for removing them 🙏 |
So |
No, it isn't required since we introduced a dynamic prefix. Each metric has |
Two scalers stand out:
How should I handle them? |
Deprecate explicitly setting `metricName` field from `ScaledObject.triggers[*].metadata` In v2.12 this setting will be internalized and should not be set by users A log message was added, as well as code comments Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
metricName
for all scalers is deprecatedmetricName
for all scalers
As they are just 2, maybe we can add them in the if to ignore them for the warning. WDYT? |
Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
Sounds good, done |
/run-e2e |
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.
LGTM! Thanks for the improvement ❤️
Could you update docs as well?
PTAL @zroubalik |
Sure, I'll get started as soon as this PR lands |
Should I keep updating this PR? |
/run-e2e |
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.
LGTM, great job!
@yardenshoham could you please open a docs PR. We require to have approved docs PR before merging code PR. Thanks a lot
It is fine as it now, thanks! :) |
Great! Docs PR will be ready |
Docs PR kedacore/keda-docs#1074 |
metricName
for all scalersmetricName
for all scalers
awesome, could you please track tasks in the issue #4220 ? In the issue describtion there's TODO list |
Apart from creating the discussion, what are the other action items? Not sure what needs to be done in "update documentation to specify deprecation notice" |
exactly this PR you did: kedacore/keda-docs#1074 :) Just link it in the tasks in the issue and mark this item as done :) |
Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
I commented #4220 (comment) |
I mean the todo list, but I've just realized you probably can't modify that, right? |
Correct |
Is there any more work to get this PR merged? It has 2 approvals |
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.
Thanks a lot for the contribution @yardenshoham !
In v2.12 this setting will be internalized and should not be set by users
A log message was added
Checklist
Docs PR kedacore/keda-docs#1074
Relates to #4220