code: func (r *AlertingRule) State() AlertState {
  	r.mtx.Lock()
  	defer r.mtx.Unlock()
  
  	maxState := StateInactive
  	for _, a := range r.active {
  		if a.State > maxState {
  			maxState = a.State
  		}
  	}
  	return maxState
  }
docs: // State returns the maximum state of alert instances for this rule.
  // StateFiring > StatePending > StateInactive