-
Notifications
You must be signed in to change notification settings - Fork 996
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
aws-cloudwatch scaler only works with expressions that return a value greater than activationTargetMetricValue
#3614
Comments
I answered you in slack but let's talk about this here to track the conversation. I have seen that selecting the symbol used for the activation could be enough to you. AFAIK AWS CloudWatch supports arithmetic operations, just multiply you value for |
Not to worry. AWS does not explicitly spell this out anywhere that I can find. It's implied from all of the examples though. You can also confirm this experimentally as i'll show below. Cloudwatch does not support nested queries in the form of
Same with math operations. You get a single expression per query versus I hope that clarifies things |
mmm, in that case, seems that ATM your request is not supported by KEDA, sorry. |
one thing that you could do is create your own RestAPI/gRCP service which queries cloudwatch and applies the formulas that you need, and use Metrics API Scaler or External Scaler to query your service from KEDA |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
This issue has been automatically closed due to inactivity. |
Proposal
I would like greater control over the logic in the
IsActive()
function for theaws-cloudwatch
scaler.For my needs (outlined below) there are a few different ways this could be implemented:
just a simple way to indicate that the
IsActive()
logic should be negated. This could be a simpletargetMetricComparisonOperator
field which defaults to the current>
but would also support<
:support for multiple expressions submitted to the cloudwatch API + a way to indicate which query should be used in the
IsActive()
calculation:Implement something else entirely using a combination of Issue #2440 and Issue #3330
TL;DR: Cloudwatch explicitly supports multiple queries, the keda scaler should too.
Use-Case
I have a sacred cow / legacy application that - from time to time - stop running properly.
For reasons that are not important here, this application is off limits.
Fortunately, I have some cloud watch metrics that allow me to see the number times this legacy application has been run per unit time. If the number drops below 1, I need to fire off a simple reboot script which - while blunt - does work reliably.
I have tried to implement this basic "if the count drops to less than 1, run the action" pattern with this:
However, after some conversation with @JorTurFer on slack, this may not be supported directly.
In short, the
expression
will always return1
when things are nominal. Only when there is no data or the number of invocations per unit time is 0 will theexpression
return 0.A quick 'hack' was suggested: Invert the logic; return
0
when things are nominal and1
when things are not.This is only possible when using logical operators in your cloudwatch query. However this requires submititng multiple queries to cloudwatch... which the current
aws-cloudwatch
scaler does not support.To achieve the 'negate the expression result' workaround from above, you must submit an API query with a payload similar to:
However, the current implementation does not permit this; there is only ever one query expression sent to AWS:
keda/pkg/scalers/aws_cloudwatch_scaler.go
Line 349 in 96e5bd2
Anything else?
No response
The text was updated successfully, but these errors were encountered: