fix(metrics-api-scaler): Fix division by 0 for expectedNbMetric#7743
Conversation
Signed-off-by: dttung2905 <ttdao.2015@accountancy.smu.edu.sg>
|
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. |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Signed-off-by: dttung2905 <ttdao.2015@accountancy.smu.edu.sg>
|
/run-e2e metrics_api |
Co-authored-by: Rick Brouwer <rickbrouwer@gmail.com> Signed-off-by: Dao Thanh Tung <ttdao.2015@accountancy.smu.edu.sg>
|
/run-e2e metrics_api |
|
@dttung2905 can you check the race error? |
Signed-off-by: dttung2905 <ttdao.2015@accountancy.smu.edu.sg>
|
/run-e2e metrics_api |
|
Hi @rickbrouwer , I have fixed the race condition in the CI test now. Can you help to check it again? |
Signed-off-by: Jan Wozniak <wozniak.jan@gmail.com>
|
/run-e2e metrics_api passed tests: 1failed tests: 0 |
When the metrics-api scaler aggregates metrics from multiple Kubernetes service endpoints with
aggregationType: average(the default), and every endpoint request fails,aggregateMetricsFromMultipleEndpointsstill divides the aggregated value byexpectedNbMetricsafter it has been decremented to 0.keda/pkg/scalers/metrics_api_scaler.go
Lines 457 to 458 in ef9df93
Checklist
make generate-scalers-schemahas been run to update any outdated generated filesFixes #7742