Skip to content

Add new Elastic Forecast scaler#7496

Merged
rickbrouwer merged 9 commits into
kedacore:mainfrom
rickbrouwer:elastic-forecast
May 25, 2026
Merged

Add new Elastic Forecast scaler#7496
rickbrouwer merged 9 commits into
kedacore:mainfrom
rickbrouwer:elastic-forecast

Conversation

@rickbrouwer

@rickbrouwer rickbrouwer commented Feb 27, 2026

Copy link
Copy Markdown
Member

Introduce the new Elastic Forecast (Experimental) scaler, as described in mentioned issue.

Checklist

  • When introducing a new scaler, I agree with the scaling governance policy
  • I have verified that my change is according to the deprecations & breaking changes policy
  • Tests have been added (if applicable)
  • Ensure make generate-scalers-schema has been run to update any outdated generated files
  • Changelog has been updated and is aligned with our changelog requirements, only when the change impacts end users
  • A PR is opened to update our Helm chart (repo) (if applicable, ie. when deployment manifests are modified)
  • A PR is opened to update the documentation on (repo) (if applicable)
  • Commits are signed with Developer Certificate of Origin (DCO - learn more)

Fixes #7494
Docs: kedacore/keda-docs#1710

@github-actions

Copy link
Copy Markdown

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:

  • Add an entry in our changelog in alphabetical order and link related issue
  • Update the documentation, if needed
  • Add unit & e2e tests for your changes
  • GitHub checks are passing
  • Is the DCO check failing? Here is how you can fix DCO issues

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.

@keda-automation keda-automation requested review from a team February 27, 2026 16:19
Comment thread pkg/scalers/elastic_forecast_scaler.go
@snyk-io

snyk-io Bot commented Feb 27, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@rickbrouwer

rickbrouwer commented Feb 27, 2026

Copy link
Copy Markdown
Member Author

/run-e2e elastic_forecast_test
Update: You can check the progress here

@rickbrouwer rickbrouwer force-pushed the elastic-forecast branch 2 times, most recently from c2ca814 to 9bd32dc Compare February 27, 2026 18:39
@rickbrouwer

rickbrouwer commented Feb 27, 2026

Copy link
Copy Markdown
Member Author

/run-e2e elastic*
Update: You can check the progress here

@rickbrouwer rickbrouwer marked this pull request as ready for review February 27, 2026 19:50

@dttung2905 dttung2905 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the initiative @rickbrouwer ! 🚀

Comment thread pkg/scalers/elastic_forecast_scaler.go
Comment thread pkg/scalers/elastic_forecast_scaler.go

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new elastic-forecast scaler to KEDA, enabling proactive scaling based on Elasticsearch ML forecast results (with accompanying unit/e2e tests and schema/changelog updates).

Changes:

  • Add elastic-forecast scaler implementation (forecast creation/renewal + forecast querying).
  • Register the scaler in the scaler builder and update generated scaler schemas (YAML/JSON).
  • Add unit tests and an e2e test scenario for the new scaler; update changelog entry.

Reviewed changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
pkg/scalers/elastic_forecast_scaler.go Implements the new Elastic Forecast scaler logic (forecast lifecycle + metric retrieval).
pkg/scalers/elastic_forecast_scaler_test.go Adds unit tests for metadata parsing, metric spec naming, and renewal-related logic.
pkg/scaling/scalers_builder.go Registers the new elastic-forecast trigger type in the scaler factory.
schema/generated/scalers-schema.yaml Adds the new scaler parameters to the generated YAML schema.
schema/generated/scalers-schema.json Adds the new scaler parameters to the generated JSON schema.
tests/scalers/elastic_forecast/elastic_forecast_test.go Adds an e2e test that provisions Elasticsearch + ML job/datafeed and validates scale-out behavior.
CHANGELOG.md Adds an Unreleased “New” entry for the Elastic Forecast scaler.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/scalers/elastic_forecast_scaler.go Outdated
Comment thread pkg/scalers/elastic_forecast_scaler.go Outdated
Comment thread pkg/scalers/elastic_forecast_scaler.go Outdated
Comment thread pkg/scalers/elastic_forecast_scaler_test.go Outdated
Comment thread pkg/scalers/elastic_forecast_scaler_test.go Outdated
Comment thread tests/scalers/elastic_forecast/elastic_forecast_test.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@rickbrouwer rickbrouwer force-pushed the elastic-forecast branch 2 times, most recently from 8802361 to 1367dc4 Compare March 4, 2026 19:39
@rickbrouwer rickbrouwer requested a review from Copilot March 4, 2026 19:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@rickbrouwer

rickbrouwer commented Mar 4, 2026

Copy link
Copy Markdown
Member Author

/run-e2e elastic_forecast_test
Update: You can check the progress here

@rickbrouwer

rickbrouwer commented Apr 17, 2026

Copy link
Copy Markdown
Member Author

/run-e2e elastic_forecast_test
Update: You can check the progress here

@rickbrouwer

rickbrouwer commented Apr 17, 2026

Copy link
Copy Markdown
Member Author

/run-e2e elastic_forecast_test
Update: You can check the progress here

@rickbrouwer

rickbrouwer commented Apr 18, 2026

Copy link
Copy Markdown
Member Author

/run-e2e elastic_forecast_test
Update: You can check the progress here

@rickbrouwer

Copy link
Copy Markdown
Member Author

ah, forget to update and merge the main branch :)

@rickbrouwer

Copy link
Copy Markdown
Member Author

Attention! I have switched the scaler to Experimental! See the docs.

@rickbrouwer rickbrouwer added the nice-to-have:keda-v2.20 Not strictly necessary, but nice if you can bring it along label May 25, 2026
@wozniakjan wozniakjan added the required:keda-v2.20 This is absolutely mandatory to bring along label May 25, 2026

@zroubalik zroubalik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, I would just change the log level on some messages, but that's just my personal opinion to reduce the number of messages emitted by the operator.

Feel free to disregard if you think it should be done this way, I am okay with that.

Comment thread pkg/scalers/elastic_forecast_scaler.go Outdated
@zroubalik zroubalik added waiting-author-response All PR's or Issues where we are waiting for a response from the author and removed Awaiting/2nd-approval This PR needs one more approval review labels May 25, 2026
@rickbrouwer rickbrouwer removed the nice-to-have:keda-v2.20 Not strictly necessary, but nice if you can bring it along label May 25, 2026
Signed-off-by: Rick Brouwer <[email protected]>
@keda-automation keda-automation requested a review from a team May 25, 2026 12:54
@rickbrouwer

rickbrouwer commented May 25, 2026

Copy link
Copy Markdown
Member Author

/run-e2e elastic_forecast_test
Update: You can check the progress here

@rickbrouwer rickbrouwer added ok-to-merge This PR can be merged waiting-for-e2e and removed waiting-author-response All PR's or Issues where we are waiting for a response from the author labels May 25, 2026
@rickbrouwer rickbrouwer enabled auto-merge (squash) May 25, 2026 15:15
@rickbrouwer

rickbrouwer commented May 25, 2026

Copy link
Copy Markdown
Member Author

/run-e2e elastic_forecast_test
Update: You can check the progress here

passed tests: 1
Execution of tests/scalers/elastic_forecast/elastic_forecast_test.go, has passed after "one" attempts
failed tests: 0

@rickbrouwer

rickbrouwer commented May 25, 2026

Copy link
Copy Markdown
Member Author

/run-e2e elastic_forecast_test
Update: You can check the progress here

passed tests: 1
Execution of tests/scalers/elastic_forecast/elastic_forecast_test.go, has passed after "one" attempts
failed tests: 0

@rickbrouwer rickbrouwer merged commit 0c693d5 into kedacore:main May 25, 2026
23 checks passed
@rickbrouwer rickbrouwer deleted the elastic-forecast branch May 26, 2026 07:12
shcherbak pushed a commit to shcherbak/keda that referenced this pull request Jun 3, 2026
Signed-off-by: Rick Brouwer <[email protected]>
Signed-off-by: Yurii Shcherbak <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-merge This PR can be merged required:keda-v2.20 This is absolutely mandatory to bring along

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New Elastic Forecast Scaler

5 participants