Alert State Enum (ruletypes/alert_state.go)

signoz · pkg/types/ruletypes/alert_state.go · go · MIT
analytics, infra, automation, lang:go, tag:enum, tag:valuer

Defines typed enum values for alert lifecycle states (inactive, pending, firing, etc.) with severity ranking for sorting/display in alerting rules.

// Source: https://github.com/SigNoz/signoz | License: MIT | Copyright 2020-present SigNoz Inc
// Provided via justclaw.it.com; keep this notice with the code.
package ruletypes

import "github.com/SigNoz/signoz/pkg/valuer"

type AlertState struct {
	valuer.String
}

var (
	StateInactive   = AlertState{valuer.NewString("inactive")}
	StatePending    = AlertState{valuer.NewString("pending")}
	StateRecovering = AlertState{valuer.NewString("recovering")}
	StateFiring     = AlertState{valuer.NewString("firing")}
	StateNoData     = AlertState{valuer.NewString("nodata")}
	StateDisabled   = AlertState{valuer.NewString("disabled")}
)

func (AlertState) Enum() []any {
	return []any{
		StateInactive,
		StatePending,
		StateRecovering,
		StateFiring,
		StateNoData,
		StateDisabled,
	}
}

var alertStat

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key