Skip to content

Fix running_taskruns metric overcounting TaskRuns with no condition#9485

Open
bot4us wants to merge 2 commits intotektoncd:mainfrom
bot4us:fix-running-taskruns-overcount-9438
Open

Fix running_taskruns metric overcounting TaskRuns with no condition#9485
bot4us wants to merge 2 commits intotektoncd:mainfrom
bot4us:fix-running-taskruns-overcount-9438

Conversation

@bot4us
Copy link

@bot4us bot4us commented Mar 3, 2026

Replace !tr.IsDone() with an explicit nil + ConditionUnknown check so that newly created TaskRuns (before their first reconcile) are no longer counted as running. This aligns with the pipelinerunmetrics behavior and eliminates the inconsistency where sub-metrics were gated on ConditionUnknown while the top-level count was not.

Fixes #9438

Changes

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps
  • Has Tests included if any functionality added or changed
  • pre-commit Passed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings). See some examples of good release notes.
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

NONE

Replace !tr.IsDone() with an explicit nil + ConditionUnknown check so
that newly created TaskRuns (before their first reconcile) are no longer
counted as running. This aligns with the pipelinerunmetrics behavior and
eliminates the inconsistency where sub-metrics were gated on
ConditionUnknown while the top-level count was not.

Fixes tektoncd#9438

Made-with: Cursor
@tekton-robot tekton-robot added the release-note-none Denotes a PR that doesnt merit a release note. label Mar 3, 2026
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Mar 3, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 3, 2026
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign twogiants after the PR has been reviewed.
You can assign the PR to them by writing /assign @twogiants in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 3, 2026
@bot4us
Copy link
Author

bot4us commented Mar 3, 2026

/kind bug

@tekton-robot tekton-robot added the kind/bug Categorizes issue or PR as related to a bug. label Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Categorizes issue or PR as related to a bug. release-note-none Denotes a PR that doesnt merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

running_taskruns metric overcounts TaskRuns that have no condition set yet

2 participants