TECHNOLOGY

Kueue cohort gauges count only queues matching each custom-label series

In this article
THE QUICK TAKE

Cohort metric labels now partition the counted queue population correctly instead of repeating the entire subtree total in every series.

Kueue 0.20.6 fixes over-counting in kueue_cohort_subtree_admitted_active_workloads when CustomMetricLabels is enabled. Each labeled series previously repeated the whole subtree total. Summing those series multiplied the population instead of reconstructing it. The gauge now counts only ClusterQueues matching each series’ custom-label values. Without custom labels, the single series is unchanged, so the correction is specifically about attribution within a labeled population.

A label does not make a total a partition

PR 18078 explains that every custom-label series carried the full count. Merely attaching different labels to an aggregate does not create distinct underlying populations. A proposed fixture uses two ClusterQueues with different label values and different active-workload counts. Each series must match its own queue subset. Deliberately unequal counts make the error visible; equal populations can make duplicated totals look plausible and obscure which queue contributed to each result.

Nested cohorts need the same membership rule

The upstream PR reports coverage for a nested Cohort, where an ancestor counts only matching ClusterQueues. Hierarchical aggregation can otherwise repeat the same attribution mistake at a higher level. A local check should retain the tree and label assignments, then compare both child and ancestor series. Counting all descendants is correct for an unlabeled total, but not for a series that claims to represent only one custom-label combination within that tree.

Deletion tests stale membership

PR 18078 also names deleting a ClusterQueue as a test case. Removing a queue should remove its contribution from the relevant labeled subtree count. A proposed qualification records before-and-after membership and gauge values while leaving another queue active. That avoids interpreting a zeroed entire fixture as proof of selective cleanup. The test concerns active workload counting, so historical completed jobs and cumulative admission counters should not be used as the expected population.

Correct arithmetic starts with correct populations

After the fix, a sum across appropriate label series can be reviewed against the corresponding queue population. Query changes alone could have hidden the old duplication, so dashboards should be checked when upgrading rather than preserving unexplained divisors. The release does not change the number of workloads actually running. Its contribution is a truthful gauge attribution that makes arithmetic meaningful, while the operator remains responsible for selecting compatible labels and avoiding duplicate aggregation across hierarchy levels.

Sources

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles