feat(runtime-config): Add default tenant ID for runtime config fallback#7501
Open
yeya24 wants to merge 1 commit into
Open
feat(runtime-config): Add default tenant ID for runtime config fallback#7501yeya24 wants to merge 1 commit into
yeya24 wants to merge 1 commit into
Conversation
Add -runtime-config.default-tenant-id flag that enables a synthetic tenant entry in the runtime config overrides to serve as the default for all tenants without per-tenant overrides. This allows changing default limits via the config pipeline (hot-reloaded) instead of requiring a Cortex restart. Resolution order: per-tenant override → default tenant → CLI flags. When the flag is empty (default), the feature is disabled and behavior is unchanged. This is an experimental feature. Signed-off-by: Ben Ye <benye@amazon.com>
bdfc33b to
beffda9
Compare
SungJin1212
reviewed
May 12, 2026
Member
There was a problem hiding this comment.
I think there might also be a way to match using regex without a new flag.
I like this method as well.
# runtime-config.yml
overrides:
.*: // like default tenant
max_global_series_per_user: 200000
ingestion_rate: 25000
cluster-prefix1-.+:
// xxx
cluster-prefix2-+:
// xxx
real_tenant_123:
max_global_series_per_user: 2000000
SungJin1212
approved these changes
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Adds a new experimental flag
-runtime-config.default-tenant-idthat enables a synthetic tenant entry in the runtime config overrides to serve as the default for all tenants without per-tenant overrides.Motivation
Today, changing default limits for all tenants (e.g.,
max_global_series_per_user) requires a Cortex restart because defaults are set via CLI flags read at startup. Per-tenant overrides, by contrast, are hot-reloaded from the runtime config file without restart.This feature allows operators to set default values in the runtime config file under a synthetic tenant ID, enabling default limit changes without pod restarts.
How it works
Resolution order when the flag is set:
When the flag is empty (default), the feature is disabled and behavior is unchanged.
Changes
pkg/util/validation/limits.go: AddeddefaultTenantIDfield toOverrides, newNewOverridesWithDefaultTenantIDconstructor, modifiedGetOverridesForUserto check default tenant before CLI flagspkg/util/runtimeconfig/manager.go: Added-runtime-config.default-tenant-idflagpkg/cortex/modules.go: Wired flag through to overrides initializationdocs/configuration/v1-guarantees.md: Listed as experimental featureExample usage
All tenants without their own override get the
__default__values. Tenants with overrides are unaffected.Checklist
make doc)