Add support for CloudWatch extended statistics (percentiles, trimmed mean, etc.) in the CloudWatch scaler to enable more advanced metric queries#7109
Conversation
|
Thank you for your contribution! 🙏 Please understand that we will do our best to review your PR and give you feedback as soon as possible, but please bear with us if it takes a little longer as expected. While you are waiting, make sure to:
Once the initial tests are successful, a KEDA member will ensure that the e2e tests are run. Once the e2e tests have been successfully completed, the PR may be merged at a later date. Please be patient. Learn more about our contribution guide. |
9377002 to
a3a70e6
Compare
dttung2905
left a comment
There was a problem hiding this comment.
sorry for a stupid question: Is there anyway we can integrate the script https://gist.github.com/adis-io/62f6eacda900a2472a6dcc4fdf552aeb into our e2e test suite? It should be put under https://github.com/kedacore/keda/tree/main/tests
Hey, it's a good idea. |
tests/scalers/aws/aws_cloudwatch_metric_stat/aws_cloudwatch_metric_stat_test.go
Show resolved
Hide resolved
|
hey @dttung2905, I've created a new test based on tests/scalers/aws/aws_cloudwatch/aws_cloudwatch_test.go Please let me know if I need to do anything else |
|
/run-e2e aws |
|
There is also a merge conflict for this PR |
I guess there were no need to add constraint as CW supports all these metric stats in the first place hence no breaking change
Rebased |
|
/run-e2e aws |
Could you retry e2e tests please? I've accidentally pushed different version of test file, now should be resolved (locally I was testing with short lived credentials to push metrics and pod identity to fetch them) |
|
/run-e2e aws |
|
@rickbrouwer hey sorry for bothering, any chance you can restart the build? Seems like it's either stuck or flaky test |
|
/run-e2e aws |
dttung2905
left a comment
There was a problem hiding this comment.
LGTM! Thanks for the contribution 🙇
|
Looking nice! 🙇 only one comment here inline and another in docs. |
The CloudWatch API will automatically recognize whether it's a standard or extended statistic based on the value This enables using metrics like: - Percentiles: p99, p95, p50, p99.9 - Trimmed Mean: TM(10:90), tm99 - Trimmed Count/Sum: TC(0:100), TS(0:100) - Winsorized Mean: WM(0:100) - Percentile Rank: PR(value) - And any future extended statistics supported by CloudWatch Signed-off-by: Adis Osmonov <adis.osmonov@gmail.com>
Signed-off-by: Adis Osmonov <adis.osmonov@gmail.com>
Signed-off-by: Adis Osmonov <adis.osmonov@gmail.com>
Signed-off-by: Adis Osmonov <adis.osmonov@gmail.com>
Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es> Signed-off-by: Adis Osmonov <adis.osmonov@gmail.com>
|
thanks a lot for the contribution! |
|
/run-e2e aws |
…mean, etc.) in the CloudWatch scaler to enable more advanced metric queries (kedacore#7109) * Remove checkMetricStat validation and let CloudWatch validate it The CloudWatch API will automatically recognize whether it's a standard or extended statistic based on the value This enables using metrics like: - Percentiles: p99, p95, p50, p99.9 - Trimmed Mean: TM(10:90), tm99 - Trimmed Count/Sum: TC(0:100), TS(0:100) - Winsorized Mean: WM(0:100) - Percentile Rank: PR(value) - And any future extended statistics supported by CloudWatch Signed-off-by: Adis Osmonov <adis.osmonov@gmail.com> * Update CHANGELOG.md Signed-off-by: Adis Osmonov <adis.osmonov@gmail.com> * Add E2E test for using non default MetricStat Signed-off-by: Adis Osmonov <adis.osmonov@gmail.com> * Fix e2e test Signed-off-by: Adis Osmonov <adis.osmonov@gmail.com> * Update CHANGELOG.md Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es> Signed-off-by: Adis Osmonov <adis.osmonov@gmail.com> --------- Signed-off-by: Adis Osmonov <adis.osmonov@gmail.com> Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es> Signed-off-by: Dmitriy Altuhov <altuhovd@gmail.com>
…mean, etc.) in the CloudWatch scaler to enable more advanced metric queries (kedacore#7109) * Remove checkMetricStat validation and let CloudWatch validate it The CloudWatch API will automatically recognize whether it's a standard or extended statistic based on the value This enables using metrics like: - Percentiles: p99, p95, p50, p99.9 - Trimmed Mean: TM(10:90), tm99 - Trimmed Count/Sum: TC(0:100), TS(0:100) - Winsorized Mean: WM(0:100) - Percentile Rank: PR(value) - And any future extended statistics supported by CloudWatch Signed-off-by: Adis Osmonov <adis.osmonov@gmail.com> * Update CHANGELOG.md Signed-off-by: Adis Osmonov <adis.osmonov@gmail.com> * Add E2E test for using non default MetricStat Signed-off-by: Adis Osmonov <adis.osmonov@gmail.com> * Fix e2e test Signed-off-by: Adis Osmonov <adis.osmonov@gmail.com> * Update CHANGELOG.md Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es> Signed-off-by: Adis Osmonov <adis.osmonov@gmail.com> --------- Signed-off-by: Adis Osmonov <adis.osmonov@gmail.com> Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es>
…mean, etc.) in the CloudWatch scaler to enable more advanced metric queries (kedacore#7109) * Remove checkMetricStat validation and let CloudWatch validate it The CloudWatch API will automatically recognize whether it's a standard or extended statistic based on the value This enables using metrics like: - Percentiles: p99, p95, p50, p99.9 - Trimmed Mean: TM(10:90), tm99 - Trimmed Count/Sum: TC(0:100), TS(0:100) - Winsorized Mean: WM(0:100) - Percentile Rank: PR(value) - And any future extended statistics supported by CloudWatch Signed-off-by: Adis Osmonov <adis.osmonov@gmail.com> * Update CHANGELOG.md Signed-off-by: Adis Osmonov <adis.osmonov@gmail.com> * Add E2E test for using non default MetricStat Signed-off-by: Adis Osmonov <adis.osmonov@gmail.com> * Fix e2e test Signed-off-by: Adis Osmonov <adis.osmonov@gmail.com> * Update CHANGELOG.md Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es> Signed-off-by: Adis Osmonov <adis.osmonov@gmail.com> --------- Signed-off-by: Adis Osmonov <adis.osmonov@gmail.com> Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es>
Summary
Remove checkMetricStat validation and let CloudWatch validate it
The CloudWatch API will automatically recognize whether it's a standard or extended statistic based on the value
This enables using metrics like:
Testing
Testing
In main branch:
In my branch:
Script for testing: https://gist.github.com/adis-io/62f6eacda900a2472a6dcc4fdf552aeb
Checklist
Relates to kedacore/keda-docs#1631