rule

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertingRule

type AlertingRule struct {
	Alert       string            `json:"alert" yaml:"alert"`
	Expr        string            `json:"expr" yaml:"expr"`
	Labels      map[string]string `json:"labels" yaml:"labels"`
	Annotations map[string]string `json:"annotations" yaml:"annotations"`
}

func (*AlertingRule) Prometheus

func (r *AlertingRule) Prometheus() rulefmt.RuleNode

type RecordingRule

type RecordingRule struct {
	Record string            `json:"record" yaml:"record"`
	Expr   string            `json:"expr" yaml:"expr"`
	Labels map[string]string `json:"labels" yaml:"labels"`
}

func (*RecordingRule) Prometheus

func (r *RecordingRule) Prometheus() rulefmt.RuleNode

type Rule

type Rule interface {
	Prometheus() rulefmt.RuleNode
}

type RuleGenerator

type RuleGenerator struct {
	// contains filtered or unexported fields
}

func NewRuleGenerator

func NewRuleGenerator() *RuleGenerator

func (*RuleGenerator) GenerateAlertingRules

func (g *RuleGenerator) GenerateAlertingRules(
	s *spec.Spec,
) error

func (*RuleGenerator) GenerateRecordingRules

func (g *RuleGenerator) GenerateRecordingRules(
	s *spec.Spec,
) error

func (*RuleGenerator) RuleGroups

func (g *RuleGenerator) RuleGroups() *RuleGroups

type RuleGroup

type RuleGroup struct {
	Name     string         `json:"name" yaml:"name"`
	Interval model.Duration `json:"interval,omitempty" yaml:"interval,omitempty"`
	Rules    []Rule         `json:"rules" yaml:"rules"`
}

func (RuleGroup) Prometheus

func (rg RuleGroup) Prometheus() rulefmt.RuleGroup

type RuleGroups

type RuleGroups struct {
	Groups []*RuleGroup `json:"groups" yaml:"rules"`
}

func (RuleGroups) Prometheus

func (rgs RuleGroups) Prometheus() rulefmt.RuleGroups

Jump to

Keyboard shortcuts

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