config

package
v1.37.0-cluster Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

type Group struct {
	File     string
	Name     string        `yaml:"name"`
	Interval time.Duration `yaml:"interval,omitempty"`
	Rules    []Rule        `yaml:"rules"`

	// 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, validateAnnotations bool) ([]Group, error)

Parse parses rule configs from given file patterns

func (*Group) Validate added in v1.37.0

func (g *Group) Validate(validateAnnotations bool) error

Validate check for internal Group or Rule configuration errors

type Rule added in v1.34.4

type Rule struct {
	Record      string            `yaml:"record,omitempty"`
	Alert       string            `yaml:"alert,omitempty"`
	Expr        string            `yaml:"expr"`
	For         time.Duration     `yaml:"for,omitempty"`
	Labels      map[string]string `yaml:"labels,omitempty"`
	Annotations map[string]string `yaml:"annotations,omitempty"`
}

Rule describes entity that represent either recording rule or alerting rule.

func (*Rule) Validate added in v1.37.0

func (r *Rule) Validate() error

Validate check for Rule configuration errors

Jump to

Keyboard shortcuts

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