feature: add custom HTTP client timeout to Metrics API scaler#7551
feature: add custom HTTP client timeout to Metrics API scaler#7551rickbrouwer merged 8 commits intokedacore:mainfrom
Conversation
Signed-off-by: RokeshVS <rokesh550@gmail.com>
|
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: RokeshVS <rokesh550@gmail.com>
|
please run |
Signed-off-by: RokeshVS <rokesh550@gmail.com>
Done @rickbrouwer |
|
The scalers were later refactored to comply with the new metadata parsing; see the Some adjustments are still needed to comply with that as well, see for example: |
Signed-off-by: RokeshVS <rokesh550@gmail.com>
dttung2905
left a comment
There was a problem hiding this comment.
Hi @RokeshVS ,
thanks for making this PR. Could you help fixing this to make the CI passed
golangci/golangci-lint info checking GitHub for tag 'v2.8.0'
golangci/golangci-lint info found version: 2.8.0 for v2.8.0/linux/amd64
golangci/golangci-lint info installed /home/runner/go/bin/golangci-lint
golangci-lint run
pkg/scalers/metrics_api_scaler.go:101:36: unnecessary conversion (unconvert)
httpClientTimeout = time.Duration(meta.Timeout) * time.Millisecond
^
1 issues:
* unconvert: 1
make: *** [Makefile:163: golangci] Error 1
Signed-off-by: RokeshVS <rokesh550@gmail.com>
Hi @dttung2905 , Thanks for mentioning , Removed unnecessary conversion . |
Signed-off-by: RokeshVS <rokesh550@gmail.com>
|
/run-e2e metric |
rickbrouwer
left a comment
There was a problem hiding this comment.
Thanks for this contribution @RokeshVS !
|
I know that this is totally consistent with the current scalers, but I'm afraid about supporting the same parameters multiple times. @kedacore/keda-core-contributors @kedacore/keda-core-maintainers, should we support these kind of HTTP options at trigger level and not inside each scaler? |
I would like this to discuss on KubeCon and/or the next Community Call. |
💯 |
Signed-off-by: Rick Brouwer <rickbrouwer@gmail.com>
|
/run-e2e metric |
|
Let's move on to this PR. Supporting this setting at the trigger level seems like a good candidate for V3 to me, as briefly discussed at KubeCon. Agree @kedacore/keda-core-maintainers ? |
Signed-off-by: Rick Brouwer <rickbrouwer@gmail.com>
|
/run-e2e metric |
Adds support for a custom HTTP client timeout to the Metrics API scaler, consistent with the same feature recently added to the Prometheus and Azure Log Analytics scalers in #6607.
Previously, the Metrics API scaler always used the global HTTP timeout configured for KEDA. This change allows users to override that per-trigger via a
timeouttriggerMetadata field (value in milliseconds).Changes
timeoutfield (time.Duration) tometricsAPIScalerMetadatameta.timeouttokedautil.CreateHTTPClientinNewMetricsAPIScalertestMetricsAPIMetadatacovering valid, negative, and non-numeric timeout valuesCHANGELOG.mdChecklist
Fixes #7549
Docs: kedacore/keda-docs#1720