Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Group ¶
type Group struct { Type Type `yaml:"type,omitempty"` File string Name string `yaml:"name"` Interval *promutils.Duration `yaml:"interval,omitempty"` Limit int `yaml:"limit,omitempty"` Rules []Rule `yaml:"rules"` Concurrency int `yaml:"concurrency"` // Labels is a set of label value pairs, that will be added to every rule. // It has priority over the external labels. Labels map[string]string `yaml:"labels"` // Checksum stores the hash of yaml definition for this group. // May be used to detect any changes like rules re-ordering etc. Checksum string // Optional HTTP URL parameters added to each rule request Params url.Values `yaml:"params"` // Headers contains optional HTTP headers added to each rule request Headers []Header `yaml:"headers,omitempty"` // Catches all undefined fields and must be empty after parsing. XXX map[string]interface{} `yaml:",inline"` }
Group contains list of Rules grouped into entity with one name and evaluation interval
func Parse ¶
func Parse(pathPatterns []string, validateTplFn ValidateTplFn, validateExpressions bool) ([]Group, error)
Parse parses rule configs from given file patterns
func (*Group) UnmarshalYAML ¶ added in v1.41.0
UnmarshalYAML implements the yaml.Unmarshaler interface.
type Header ¶ added in v1.80.0
Header is a Key - Value struct for holding an HTTP header.
func (*Header) UnmarshalYAML ¶ added in v1.80.0
UnmarshalYAML implements the yaml.Unmarshaler interface.
type Rule ¶ added in v1.34.4
type Rule struct { ID uint64 Record string `yaml:"record,omitempty"` Alert string `yaml:"alert,omitempty"` Expr string `yaml:"expr"` For *promutils.Duration `yaml:"for,omitempty"` Labels map[string]string `yaml:"labels,omitempty"` Annotations map[string]string `yaml:"annotations,omitempty"` Debug bool `yaml:"debug,omitempty"` // UpdateEntriesLimit defines max number of rule's state updates stored in memory. // Overrides `-rule.updateEntriesLimit`. UpdateEntriesLimit *int `yaml:"update_entries_limit,omitempty"` // Catches all undefined fields and must be empty after parsing. XXX map[string]interface{} `yaml:",inline"` }
Rule describes entity that represent either recording rule or alerting rule.
func (*Rule) UnmarshalYAML ¶ added in v1.37.1
UnmarshalYAML implements the yaml.Unmarshaler interface.
type Type ¶ added in v1.80.0
type Type struct {
Name string
}
Type represents data source type
func NewGraphiteType ¶ added in v1.80.0
func NewGraphiteType() Type
NewGraphiteType returns graphite datasource type
func NewPrometheusType ¶ added in v1.80.0
func NewPrometheusType() Type
NewPrometheusType returns prometheus datasource type
func NewRawType ¶ added in v1.80.0
NewRawType returns datasource type from raw string without validation.
func (Type) MarshalYAML ¶ added in v1.80.0
MarshalYAML implements the yaml.Unmarshaler interface.
func (*Type) UnmarshalYAML ¶ added in v1.80.0
UnmarshalYAML implements the yaml.Unmarshaler interface.
func (*Type) ValidateExpr ¶ added in v1.80.0
ValidateExpr validates query expression with datasource ql.
type ValidateTplFn ¶ added in v1.80.0
ValidateTplFn must validate the given annotations