newManager creates a prometheus rule manager wrapped with a user id configured storage, appendable, notifier, and instrumentation
(ctx context.Context, userID string)
| 289 | // newManager creates a prometheus rule manager wrapped with a user id |
| 290 | // configured storage, appendable, notifier, and instrumentation |
| 291 | func (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 | |
| 305 | func (r *DefaultMultiTenantManager) removeNotifier(userID string) { |
| 306 | r.notifiersMtx.Lock() |
no test coverage detected