Skip to content
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

Please add Expression field to AWS CloudWatch scaler #1619

Closed
jeffjen opened this issue Feb 17, 2021 · 9 comments
Closed

Please add Expression field to AWS CloudWatch scaler #1619

jeffjen opened this issue Feb 17, 2021 · 9 comments
Labels
feature All issues for new features that have been committed to scaler-aws-cloudwatch

Comments

@jeffjen
Copy link

jeffjen commented Feb 17, 2021

Proposal

We'd like to add simple math aggregation to our metric data.

As it stands, we need to write a Lambda Function to poll and compute new metric data from a set of metrics, and then publish them back to cloudwatch.

Would be nice to be able to perform this kind of operation without need to provision Lambda

Use-Case

According to https://forums.aws.amazon.com/thread.jspa?threadID=309159

We can get a rough estimate on how many active connections are there by performing math expression.

@jeffjen jeffjen added feature-request All issues for new features that have not been committed to needs-discussion labels Feb 17, 2021
@tomkerkhove tomkerkhove changed the title Please add Expression field to AWS GetMetricData API Please add Expression field to AWS CloudWatch scaler Feb 17, 2021
@tomkerkhove
Copy link
Member

Interesting request as this could be interesting for multiple scalers. What would the expression look like?

@coderanger
Copy link
Contributor

I would imagine they mean a CloudWatch expression. We hardwire things to MetricStat here https://github.com/kedacore/keda/blob/main/pkg/scalers/aws_cloudwatch_scaler.go#L278 but CloudWatch allows asking for either a single metric or an expression https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDataQuery.html

@tomkerkhove
Copy link
Member

Makes sense to have this as a field indeed! Are you willing to contribute this @jeffjen ?

@tomkerkhove tomkerkhove added feature All issues for new features that have been committed to scaler-aws-cloudwatch and removed feature-request All issues for new features that have not been committed to needs-discussion labels Feb 17, 2021
@jeffjen
Copy link
Author

jeffjen commented Feb 18, 2021

Makes sense to have this as a field indeed! Are you willing to contribute this @jeffjen ?

I can work on this

My proposed change will be to not mess with multiple metrics in a query since it will change the struct to include an array of dimensions / namespace

The first step will be to just provide a way to add Math Expression for a single metric on designated dimension and namespace.

@tomkerkhove
Copy link
Member

Thanks!

I don't know how the SDK works but I'd just add a new optional expression field which just passes through to AWS CloudWatch and let it handle everything?

@stale
Copy link

stale bot commented Oct 13, 2021

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.

@stale stale bot added the stale All issues that are marked as stale due to inactivity label Oct 13, 2021
@tomkerkhove
Copy link
Member

/keep-alive

@stale stale bot removed the stale All issues that are marked as stale due to inactivity label Oct 14, 2021
@dekelev
Copy link
Contributor

dekelev commented Apr 15, 2022

I've opened this PR to add alternative expression field and also changed the scaler to use int64 instead of float64.

@JorTurFer
Copy link
Member

I'd say that this is done by kedacore/keda-docs#755. Feel free to reopen the issue if it's not done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature All issues for new features that have been committed to scaler-aws-cloudwatch
Projects
Archived in project
Development

No branches or pull requests

5 participants