Skip to content

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

Closed
SanilK2108 wants to merge 7 commits intokedacore:release/v2.18from
atlanhq:feature/temporal-scaler-composite-metric
Closed

feat(temporal): add composite metric (backlog + running workflow count)#7476
SanilK2108 wants to merge 7 commits intokedacore:release/v2.18from
atlanhq:feature/temporal-scaler-composite-metric

Conversation

@SanilK2108
Copy link
Copy Markdown

  • 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.

Ref: #7459

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 #

Relates to #

- 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>
@SanilK2108 SanilK2108 requested a review from a team as a code owner February 23, 2026 09:12
@keda-automation keda-automation requested a review from a team February 23, 2026 09:12
@snyk-io
Copy link
Copy Markdown

snyk-io Bot commented Feb 23, 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.

@rickbrouwer
Copy link
Copy Markdown
Member

duplicate: #7460

@rickbrouwer rickbrouwer added the duplicate This issue or pull request already exists label Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants