-
Notifications
You must be signed in to change notification settings - Fork 569
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ruler: add /ruler/tenants service API #10738
Conversation
Signed-off-by: Vladimir Varankin <[email protected]>
b58a13f
to
15d9580
Compare
Signed-off-by: Vladimir Varankin <[email protected]>
15d9580
to
cd9853e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a couple of tests? Especially for requests sending JSON.
It's not clear from the code that we're creating a contract on the contents of the JSON returned.
for _, g := range rg { | ||
groups = append(groups, ruleGroupData{ | ||
Name: g.GetName(), | ||
Namespace: g.GetNamespace(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about we include RuleCount: len(g.Rules)
here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually wanted to do the same initially, but len(g.Rules)
doesn't have any rules until we ask the Ruler
to go to storage, and to populate them for every namespace and group — via the RuleStore.LoadRuleGroups
— this is confusing, yes. I'd skip doing that (at least for now).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, okay!
Signed-off-by: Vladimir Varankin <[email protected]>
Sure, good point. We seem to not see these service APIs as something we guarantee (at I haven't noticed any similar tests in other places), but I don't see why the behaviour around how limits work with this API shouldn't be covered. |
What this PR does
This PR adds a new
/ruler/tenants
endpoint to list tenants, theruler
service discovered in its storage. The idea here is to provide an external operator-component a way to observe which tenants have rules, without asking Mimir to retrieve the actual rules.The API endpoint is complementary to the existing
/store-gateway/tenants
,/compactor/tenants
, and/ingesters/tenants
.Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]
.about-versioning.md
updated with experimental features.