Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pkg/alertmanager/alertmanager_ring.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ var RingOp = ring.NewOp([]ring.InstanceState{ring.ACTIVE}, func(s ring.InstanceS
return s != ring.ACTIVE
})

// UserOwnedRingOp is the operation used for checking if a user is owned by an alertmanager.
var UserOwnedRingOp = ring.NewOp([]ring.InstanceState{ring.ACTIVE, ring.JOINING}, func(s ring.InstanceState) bool {
// A user is owned by an alertmanager in both ACTIVE and JOINING states.
return (s != ring.ACTIVE && s != ring.JOINING)
})

// RingConfig masks the ring lifecycler config which contains
// many options not really required by the alertmanager ring. This config
// is used to strip down the config to the minimum, and avoid confusion
Expand Down
2 changes: 1 addition & 1 deletion pkg/alertmanager/multitenant.go
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ func (am *MultitenantAlertmanager) isUserOwned(userID string) bool {
return true
}

alertmanagers, err := am.ring.Get(shardByUser(userID), RingOp, nil, nil, nil)
alertmanagers, err := am.ring.Get(shardByUser(userID), UserOwnedRingOp, nil, nil, nil)
if err != nil {
am.ringCheckErrors.Inc()
level.Error(am.logger).Log("msg", "failed to load alertmanager configuration", "user", userID, "err", err)
Expand Down