rules

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareGroups

func CompareGroups(groupOne, groupTwo rulefmt.RuleGroup) error

CompareGroups differentiates between two rule groups

func ParseFiles

func ParseFiles(files []string) (map[string]RuleNamespace, error)

ParseFiles returns a formatted set of prometheus rule groups

func ValidateRuleGroup

func ValidateRuleGroup(g rulefmt.RuleGroup) []error

ValidateRuleGroup validates a rulegroup

Types

type RuleNamespace

type RuleNamespace struct {
	// Namespace field only exists for setting namespace in namespace body instead of file name
	Namespace string `yaml:"namespace,omitempty"`

	Groups []rulefmt.RuleGroup `yaml:"groups"`
}

RuleNamespace is used to parse a slightly modified prometheus rule file format, if no namespace is set, the default namespace is used. Namespace is functionally the same as a file name.

func Parse

func Parse(content []byte) (*RuleNamespace, []error)

Parse parses and validates a set of rules.

func (RuleNamespace) Validate

func (r RuleNamespace) Validate() []error

Validate each rule in the rule namespace is valid

Jump to

Keyboard shortcuts

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