﻿# Kueue makes custom-label metric history retention consistent

Old custom-label series survive value changes only when every label of that kind has trackedValues; 0.20.6 applies one rule across queue and cohort types.

Author: Retrivium team
Updated: 2026-11-15
Canonical URL: https://retrivium.ai/journal/week46-ops-kueue-custom-label-history-policy/
Language: en

Kueue 0.20.6 unifies what happens to counter and histogram series when a custom metric label changes on a ClusterQueue, LocalQueue or Cohort. Old-value series are retained only when every custom label of that kind defines trackedValues. Previously ClusterQueue and LocalQueue always reset them, while Cohort always retained them. Label configuration now expresses a common retention rule rather than relying on the object type’s accidental behavior.

## Every label is a stronger requirement than one

PR 18519 says every custom label of the relevant kind must set trackedValues. A configuration with one bounded label and one unbounded label therefore differs from a fully tracked configuration. Qualification should include both, rather than checking a single-label example and extrapolating. The condition is about the label configuration as a set. It should not be simplified to whether the particular label being changed happens to have tracked values.

## History belongs to the old label value

Retaining old-value series does not mean moving their cumulative counts into the new label value. Those histories describe different classifications of activity over time. A proposed check first generates activity under one value, changes the value and inspects both old and new series. Rate queries that sum across classifications should state whether they intentionally combine historical populations. Otherwise a label migration can appear to change traffic merely because the query selects a different series set.

## Compare all three object kinds

The old behavior differed between Cohort and the two queue kinds. A regression matrix should exercise ClusterQueue, LocalQueue and Cohort under the same tracked and untracked label configurations. Checking only one type could miss the consistency claim of the patch. Counters and histograms both belong in the observation because a retained counter with missing histogram buckets would not establish the documented history policy for all affected metric families.

## Retention is not unlimited durability

The release changes exporter behavior on label changes. It does not promise durable metrics across process restarts or alter the storage retention of Prometheus. Operational notes should name the event being tested and distinguish current exposition from historical query results. The practical improvement is predictable handling of old classifications. Capacity and cardinality review still needs the actual configured tracked values and metric families; the patch is not a license to add arbitrary unbounded dimensions.

## Sources

- [kubernetes-sigs/kueue v0.20.6 release notes](https://github.com/kubernetes-sigs/kueue/releases/tag/v0.20.6)
- [[release-0.20] Keep counters on a custom label change only when every label has trackedValues by k8s-infra-cherrypick-robot](https://github.com/kubernetes-sigs/kueue/pull/18519)

## Related reading

- [Rate metrics jump after restart: counter resets and rate before sum](/journal/prometheus-counter-reset-rate/)
- [Prometheus relabel_configs vs metric_relabel_configs: where to filter data](/journal/prometheus-target-vs-metric-relabeling/)
