Skip to content

Comments

feat(temporal): add composite metric (backlog + running workflow count)#7460

Draft
Sanil2108 wants to merge 1 commit intokedacore:mainfrom
Sanil2108:feature/temporal-scaler-composite-metric
Draft

feat(temporal): add composite metric (backlog + running workflow count)#7460
Sanil2108 wants to merge 1 commit intokedacore:mainfrom
Sanil2108:feature/temporal-scaler-composite-metric

Conversation

@Sanil2108
Copy link

@Sanil2108 Sanil2108 commented Feb 18, 2026

  • Add includeRunningWorkflowCount (default: true) to use backlog + running workflow count as the scaling metric, avoiding premature scale-down when workers are fast and backlog is often zero.
  • Add optional workflowTaskQueueForCount to scope running count by workflow task queue (e.g. when scaling activity workers).
  • getRunningWorkflowCount() uses CountWorkflow with visibility query ExecutionStatus = 'Running' AND TaskQueue = ''.
  • On CountWorkflow failure, fall back to backlog-only and log at V(1).
  • Add tests for new metadata and default composite behavior.

Provide a description of what has been changed

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 #7459

- Add includeRunningWorkflowCount (default: true) to use backlog + running
  workflow count as the scaling metric, avoiding premature scale-down when
  workers are fast and backlog is often zero.
- Add optional workflowTaskQueueForCount to scope running count by workflow
  task queue (e.g. when scaling activity workers).
- getRunningWorkflowCount() uses CountWorkflow with visibility query
  ExecutionStatus = 'Running' AND TaskQueue = '<queue>'.
- On CountWorkflow failure, fall back to backlog-only and log at V(1).
- Add tests for new metadata and default composite behavior.

Ref: kedacore#7459
Co-authored-by: Cursor <cursoragent@cursor.com>
@keda-automation keda-automation requested a review from a team February 18, 2026 11:07
@github-actions
Copy link

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 a review from a team February 18, 2026 11:07
@snyk-io
Copy link

snyk-io bot commented Feb 18, 2026

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

Status Scanner 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhance the Temporal scaler to use a composite metric that considers both task queue backlog and running workflows

2 participants