Skip to content

馃挜 Surface priority and fairness details in CLI output - #1217

Draft
moody-temporal wants to merge 1 commit into
temporalio:mainfrom
moody-temporal:feature/priority-fairness-cli-output
Draft

moody-temporal wants to merge 1 commit into
temporalio:mainfrom
moody-temporal:feature/priority-fairness-cli-output

Conversation

@moody-temporal

Copy link
Copy Markdown

Related issues

What changed?

  • Show workflow and activity priority, fairness key, and fairness weight in human-readable describe output.
  • Show fairness weight overrides in task queue config output.
  • Add task-queue describe --report-priority-stats to show per-priority task counts for all build IDs, including statsByPriority in JSON output when requested.

Release notes 馃挜

The new statsByPriority field changes task-queue describe -o json output when --report-priority-stats is used.

Validation

  • go test ./... -count=1 and cd cliext && go test ./... -count=1 passed.
  • Module tidy, generated code and docs, formatting, and server version checks passed.
  • Manually tested end to end against an OSS Temporal dev server 1.32.0 with fairness enabled. Workflow and activity details, fairness overrides, and workflow/activity queue stats showed the expected values.

Checklist

Stability

  • Breaking changes are marked with 馃挜 in the PR title and release notes
  • Changes to JSON output (-o json / -o jsonl) are treated as breaking changes

Design

  • This feature does not depend on Cloud-only APIs or behavior (it works against an OSS server)
  • New flags are named after the API concept, not the implementation mechanism
  • New flags don't duplicate an existing flag that serves the same purpose
  • New flags do not have short aliases without strong justification

Help text

  • All flags shown in help text and examples are implemented and functional
  • Summaries use sentence case and have no trailing period
  • Long descriptions end with a period and include at least one example invocation
  • Examples use long flags (--namespace, not -n), one flag per line
  • Placeholder values use YourXxx form (YourWorkflowId, YourNamespace)

Behavior

  • Results go to stdout; errors and warnings go to stderr
  • Error messages are lowercase with no trailing punctuation

Tests

  • Added functional test(s) (SharedServerSuite)

Manual tests

Setup

temporal server start-dev \
    --headless \
    --dynamic-config-value matching.enableFairness=true

temporal task-queue config set \
    --task-queue YourTaskQueue \
    --task-queue-type workflow \
    --fairness-key-weight tenant-a=4.5

temporal workflow start \
    --type YourWorkflowType \
    --task-queue YourTaskQueue \
    --workflow-id YourWorkflowId \
    --priority-key 2 \
    --fairness-key tenant-a \
    --fairness-weight 5.5

Happy path

$ temporal workflow describe \
    --workflow-id YourWorkflowId
# Priority: 2; fairness key: tenant-a; fairness weight: 5.5

$ temporal task-queue config get \
    --task-queue YourTaskQueue \
    --task-queue-type workflow
# tenant-a has fairness weight 4.5

$ temporal task-queue describe \
    --task-queue YourTaskQueue \
    --report-priority-stats
# Per-priority task counts include priority 2

$ temporal task-queue describe \
    --task-queue YourTaskQueue \
    --report-priority-stats \
    --output json
# statsByPriority contains the per-priority counts

Error case

$ temporal task-queue describe \
    --task-queue YourTaskQueue \
    --report-priority-stats \
    --disable-stats
Error: --report-priority-stats cannot be used with --disable-stats
$ echo $?
1

Composition

$ temporal activity start \
    --activity-id YourActivityId \
    --type YourActivityType \
    --task-queue YourTaskQueue \
    --start-to-close-timeout 5m \
    --priority-key 2 \
    --fairness-key tenant-a \
    --fairness-weight 5.5 \
    --output json | jq -r .runId
YourRunId

$ temporal activity describe \
    --activity-id YourActivityId \
    --run-id YourRunId
# Priority: 2; fairness key: tenant-a; fairness weight: 5.5

$ temporal task-queue describe \
    --task-queue YourTaskQueue \
    --report-priority-stats
# Activity queue stats include priority 2

@CLAassistant

CLAassistant commented Sep 24, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

2 participants