MCPcopy Index your code
hub / github.com/cortexproject/cortex / newManager

Method newManager

pkg/ruler/manager.go:291–303  ·  view source on GitHub ↗

newManager creates a prometheus rule manager wrapped with a user id configured storage, appendable, notifier, and instrumentation

(ctx context.Context, userID string)

Source from the content-addressed store, hash-verified

289// newManager creates a prometheus rule manager wrapped with a user id
290// configured storage, appendable, notifier, and instrumentation
291func (r *DefaultMultiTenantManager) newManager(ctx context.Context, userID string) (RulesManager, error) {
292 // Create a new Prometheus registry and register it within
293 // our metrics struct for the provided user if it doesn't already exist.
294 reg := prometheus.NewRegistry()
295 r.userManagerMetrics.AddUserRegistry(userID, reg)
296
297 notifier, err := r.getOrCreateNotifier(userID, reg)
298 if err != nil {
299 return nil, err
300 }
301
302 return r.managerFactory(ctx, userID, notifier, r.logger, r.frontendPool, reg)
303}
304
305func (r *DefaultMultiTenantManager) removeNotifier(userID string) {
306 r.notifiersMtx.Lock()

Callers 1

createRulesManagerMethod · 0.95

Calls 2

getOrCreateNotifierMethod · 0.95
AddUserRegistryMethod · 0.45

Tested by

no test coverage detected