Skip to content

Commit

Permalink
Add comments to Marker interface
Browse files Browse the repository at this point in the history
Signed-off-by: George Robinson <[email protected]>
  • Loading branch information
grobinson-grafana committed Oct 13, 2023
1 parent dc56210 commit ca33ca9
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,29 @@ type AlertStatus struct {
// Marker helps to mark alerts as silenced and/or inhibited.
// All methods are goroutine-safe.
type Marker interface {
// SetActiveOrSilenced replaces the previous SilencedBy by the provided IDs of
// active and pending silences, including the version number of the
// silences state. The set of provided IDs is supposed to represent the
// complete set of relevant silences. If no active silence IDs are provided and
// InhibitedBy is already empty, it sets the provided alert to AlertStateActive.
// Otherwise, it sets the provided alert to AlertStateSuppressed.
// SetActiveOrSilenced replaces the previous SilencedBy by the provided
// IDs of active and pending silences, including the version number of
// the silences state. The set of provided IDs is supposed to represent
// the complete set of relevant silences. If no active silence IDs are
// provided and both InhibitedBy and MutedBy are empty, it sets the
// provided alert to AlertStateActive. Otherwise, it sets the provided
// alert to AlertStateSuppressed.
SetActiveOrSilenced(alert model.Fingerprint, version int, activeSilenceIDs, pendingSilenceIDs []string)
// SetInhibited replaces the previous InhibitedBy by the provided IDs of
// alerts. In contrast to SetActiveOrSilenced, the set of provided IDs is not
// expected to represent the complete set of inhibiting alerts. (In
// practice, this method is only called with one or zero IDs. However,
// SetInhibited replaces the previous InhibitedBy by the provided IDs
// of alerts. In contrast to SetActiveOrSilenced, the set of provided
// IDs is not expected to represent the complete set of inhibiting alerts.
// In practice, this method is only called with one or zero IDs. However,
// this expectation might change in the future. If no IDs are provided
// and InhibitedBy is already empty, it sets the provided alert to
// and InhibitedBy and SilencedBy are empty, it sets the provided alert to
// AlertStateActive. Otherwise, it sets the provided alert to
// AlertStateSuppressed.
SetInhibited(alert model.Fingerprint, alertIDs ...string)
// SetMuted
// SetMuted replaces the previous MutedBy by the provided time intervals.
// Unlike SetInhibited, the set of provided time intervals is expected
// to represent the complete set of relevant time intervals. If no time
// intervals are provided and both InhibitedBy and SilencedBy are empty,
// it sets the provided alert to AlertStateActive. Otherwise, it sets the
// provided alert to AlertStateSuppressed.
SetMuted(alert model.Fingerprint, alertIDs ...string)

// Count alerts of the given state(s). With no state provided, count all
Expand Down

0 comments on commit ca33ca9

Please sign in to comment.