Skip to content

Formally deprecate -blocks-storage.tsdb.max-exemplars - #7793

Open
CharlieTLe wants to merge 1 commit into
cortexproject:masterfrom
CharlieTLe:release-1.22-pr-f-deprecate-max-exemplars
Open

Formally deprecate -blocks-storage.tsdb.max-exemplars#7793
CharlieTLe wants to merge 1 commit into
cortexproject:masterfrom
CharlieTLe:release-1.22-pr-f-deprecate-max-exemplars

Conversation

@CharlieTLe

Copy link
Copy Markdown
Member

Groundwork for v1.22.0. Refs #5922. Optional — happy to drop this if the maintainers would
rather not start another clock this cycle.

-blocks-storage.tsdb.max-exemplars has called itself deprecated in its flag help for a
long time:

"Deprecated, use maxExemplars in limits instead. ..."

But the deprecation was never announced in CHANGELOG.md, so the two-minor removal
window in v1-guarantees.md never actually started, and there is no signal an operator can
alert on.

It is also still live code, not an overdue no-op. Ingester.getMaxExemplars uses it as
the global fallback whenever a tenant's max_exemplars limit is 0:

if maxExemplarsFromLimits == 0 {
    return int64(i.cfg.BlocksStorageConfig.TSDB.MaxExemplars)
}

Removing it now would silently disable exemplars for every tenant relying on that fallback.

What this does instead

Starts the clock properly. The flag keeps working exactly as before, but:

  • the help text now names v1.24.0 as the removal target and describes what it actually
    does, rather than just "use maxExemplars in limits instead";
  • setting it to a non-zero value logs a warning at ingester startup and increments
    deprecated_flags_inuse_total, so operators can find and migrate the usages — which is
    the whole point of a formal deprecation.

Removal in 1.24.0, two minors from now, per v1-guarantees.md.

Verification

go build ./..., make doc (generated config reference and JSON schema regenerated), and
./pkg/ingester/ ./pkg/storage/tsdb/ green.

@dosubot dosubot Bot added the type/chore Something that needs to be done; not a bug or a feature label Aug 20, 2026
@CharlieTLe
CharlieTLe force-pushed the release-1.22-pr-f-deprecate-max-exemplars branch from 1d41b36 to d93a92d Compare August 20, 2026 01:17
The flag's help text has called itself deprecated for a long time, but the deprecation
was never announced in CHANGELOG.md, so the two-minor removal window in v1-guarantees.md
never started. It is also still live code: getMaxExemplars uses it as the global fallback
whenever a tenant's max_exemplars limit is 0, so removing it now would silently disable
exemplars for those tenants.

Start the clock properly instead. The flag keeps working, but setting it logs a warning
and increments deprecated_flags_inuse_total so operators can find and migrate the usages,
and the help text names v1.24.0 as the removal target.

Signed-off-by: Charlie Le <charlie_le@apple.com>
@CharlieTLe
CharlieTLe force-pushed the release-1.22-pr-f-deprecate-max-exemplars branch from d93a92d to a29e5db Compare August 20, 2026 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M type/chore Something that needs to be done; not a bug or a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant