Skip to content

Add ruler tenant federation - #7828

Open
SungJin1212 wants to merge 5 commits into
masterfrom
ruler-tenant-federation
Open

Add ruler tenant federation#7828
SungJin1212 wants to merge 5 commits into
masterfrom
ruler-tenant-federation

Conversation

@SungJin1212

Copy link
Copy Markdown
Member

Implement the federated ruler proposal. A rule group listing tenants in its src_tenants field is evaluated against those tenants, while the resulting series, ALERTS series and notifications are written to the tenant owning the rule group.

This feature behind -ruler.enable-federated-rules and restrict the owning tenants with -ruler.allowed-federated-tenants and -ruler.disallowed-federated-tenants.

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]
  • docs/configuration/v1-guarantees.md updated if this PR introduces experimental flags

@SungJin1212
SungJin1212 requested a review from a team as a code owner September 4, 2026 11:00
@SungJin1212
SungJin1212 requested a review from yeya24 September 4, 2026 11:00
@SungJin1212
SungJin1212 force-pushed the ruler-tenant-federation branch 3 times, most recently from a9f4d98 to e42ed8e Compare September 4, 2026 11:58

@friedrichg friedrichg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a good start. I have only one nit

Comment thread docs/guides/ruler-tenant-federation.md Outdated
@SungJin1212
SungJin1212 force-pushed the ruler-tenant-federation branch from 56c4e5f to f715432 Compare September 8, 2026 07:43

@friedrichg friedrichg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks actually really good. One question only I found

Comment thread pkg/ruler/manager.go Outdated
// not own them, e.g. because the feature was disabled after they were stored.
func (r *DefaultMultiTenantManager) filterFederatedRuleGroups(userID string, groups rulespb.RuleGroupList) rulespb.RuleGroupList {
ownerErr := r.federatedRules.checkOwner(userID)
if ownerErr == nil {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If checkOwner returns no error we should not exit the function: the owner being
allowed to have federated rule groups says nothing about whether these particular
source tenants are still acceptable under the current tenant federation config.
We should validate the source tenants here too. (Probably using r.federatedRules.validateSourceTenants)

Imagine scenarios where regex-matcher-enabled or max-tenant has changed

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching it. I validated the source tenants in filterFederatedRuleGroups.

friedrichg

This comment was marked as duplicate.

Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
… and regex constraints

Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
@friedrichg
friedrichg force-pushed the ruler-tenant-federation branch from f2b6ed5 to a6eafa6 Compare September 14, 2026 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants