Skip to content

feat(runtime-config): Add default tenant ID for runtime config fallback#7501

Open
yeya24 wants to merge 1 commit intomasterfrom
default-runtime-config
Open

feat(runtime-config): Add default tenant ID for runtime config fallback#7501
yeya24 wants to merge 1 commit intomasterfrom
default-runtime-config

Conversation

@yeya24
Copy link
Copy Markdown
Contributor

@yeya24 yeya24 commented May 10, 2026

What this PR does

Adds a new experimental flag -runtime-config.default-tenant-id that 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:

per-tenant override → default tenant override → CLI flag defaults

When the flag is empty (default), the feature is disabled and behavior is unchanged.

Changes

  • pkg/util/validation/limits.go: Added defaultTenantID field to Overrides, new NewOverridesWithDefaultTenantID constructor, modified GetOverridesForUser to check default tenant before CLI flags
  • pkg/util/runtimeconfig/manager.go: Added -runtime-config.default-tenant-id flag
  • pkg/cortex/modules.go: Wired flag through to overrides initialization
  • docs/configuration/v1-guarantees.md: Listed as experimental feature

Example usage

# runtime-config.yml
overrides:
  __default__:
    max_global_series_per_user: 200000
    ingestion_rate: 25000
  real_tenant_123:
    max_global_series_per_user: 2000000
cortex -runtime-config.default-tenant-id=__default__ ...

All tenants without their own override get the __default__ values. Tenants with overrides are unaffected.

Checklist

  • Tests added
  • Documentation updated (make doc)
  • V1 guarantees doc updated (experimental)
  • Signed-off commit

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>
@yeya24 yeya24 force-pushed the default-runtime-config branch from bdfc33b to beffda9 Compare May 10, 2026 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant