v2beta1

package
v0.0.0-...-e779149 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// for rulegroup/alert
	FieldState   = "state"
	FieldBuiltin = "builtin"

	// for rulegroup
	FieldRuleGroupEvaluationTime = "evaluationTime"
	FieldRuleGroupLastEvaluation = "lastEvalution"

	// for alert
	FieldAlertLabelFilters = "label_filters"
	FieldAlertActiveAt     = "activeAt"
	FieldAlertLabelMatcher = "label_matcher"
)
View Source
const (
	LabelFilterOperatorEqual   = "="
	LabelFilterOperatorContain = "~"
)

Variables

View Source
var ComparableFields = []string{
	FieldState,
	FieldAlertLabelFilters,
}

Functions

This section is empty.

Types

type Alert

type Alert struct {
	ActiveAt    *time.Time        `json:"activeAt,omitempty" description:"time when this alert became active"`
	Annotations map[string]string `json:"annotations,omitempty" description:"annotations"`
	Labels      map[string]string `json:"labels,omitempty" description:"labels"`
	State       string            `json:"state,omitempty" description:"state"`
	Value       string            `json:"value,omitempty" description:"the value from the last expression evaluation"`
}

type ClusterRuleGroup

type ClusterRuleGroup struct {
	alertingv2beta1.ClusterRuleGroup `json:",inline"`
	Status                           RuleGroupStatus `json:"status,omitempty"`
}

type GlobalRuleGroup

type GlobalRuleGroup struct {
	alertingv2beta1.GlobalRuleGroup `json:",inline"`
	Status                          RuleGroupStatus `json:"status,omitempty"`
}

type LabelFilter

type LabelFilter struct {
	LabelName  string
	LabelValue string
	Operator   LabelFilterOperator
}

func (*LabelFilter) Matches

func (f *LabelFilter) Matches(labels map[string]string) bool

type LabelFilterOperator

type LabelFilterOperator string

type LabelFilters

type LabelFilters []LabelFilter

func ParseLabelFilters

func ParseLabelFilters(filters string) LabelFilters

func (LabelFilters) Matches

func (fs LabelFilters) Matches(labels map[string]string) bool

type RuleGroup

type RuleGroup struct {
	alertingv2beta1.RuleGroup `json:",inline"`
	Status                    RuleGroupStatus `json:"status,omitempty"`
}

type RuleGroupStatus

type RuleGroupStatus struct {
	EvaluationTime *float64     `json:"evaluationTime,omitempty" description:"time spent on rule group evaluation in seconds"`
	LastEvaluation *time.Time   `json:"lastEvaluation,omitempty" description:"time of last evaluation"`
	RulesStatus    []RuleStatus `json:"rulesStatus,omitempty" description:"status of rules in one RuleGroup"`
	RulesStats     RulesStats   `json:"rulesStats,omitempty" description:"statistics of rules in one RuleGroup"`
}

type RuleStatus

type RuleStatus struct {
	Expr           string     `json:"expr,omitempty" description:"expression evaluated, for global rules only"`
	State          string     `` /* 135-byte string literal not displayed */
	Health         string     `json:"health,omitempty" description:"health state of a rule, one of ok, err, unknown depending on the last execution result"`
	LastError      string     `json:"lastError,omitempty" description:"error of the last evaluation"`
	EvaluationTime *float64   `json:"evaluationTime,omitempty" description:"time spent on the expression evaluation in seconds"`
	LastEvaluation *time.Time `json:"lastEvaluation,omitempty" description:"time of last evaluation"`
	ActiveAt       *time.Time `json:"activeAt,omitempty" description:"time when this rule became active"`

	Alerts []*Alert `json:"alerts,omitempty" description:"alerts"`
}

type RulesStats

type RulesStats struct {
	Inactive int `json:"inactive" description:"count of rules in the inactive state"`
	Pending  int `json:"pending" description:"count of rules in the pending state"`
	Firing   int `json:"firing" description:"count of rules in the firing state"`
	Disabled int `json:"disabled" description:"count of disabled rules"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL