MCPcopy Create free account
hub / github.com/cortexproject/cortex / GetRules

Method GetRules

pkg/ruler/manager.go:398–411  ·  view source on GitHub ↗
(userID string)

Source from the content-addressed store, hash-verified

396}
397
398func (r *DefaultMultiTenantManager) GetRules(userID string) []*promRules.Group {
399 var groups []*promRules.Group
400 groups, cached := r.getCachedRules(userID)
401 if cached {
402 return groups
403 }
404 r.userManagerMtx.RLock()
405 mngr, exists := r.userManagers[userID]
406 r.userManagerMtx.RUnlock()
407 if exists {
408 groups = mngr.RuleGroups()
409 }
410 return groups
411}
412
413func (r *DefaultMultiTenantManager) GetBackupRules(userID string) rulespb.RuleGroupList {
414 if r.rulesBackupManager != nil {

Calls 2

getCachedRulesMethod · 0.95
RuleGroupsMethod · 0.65