rules

package
v0.0.0-...-6ee8545 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	NotificationQueueCapacity: 10000,
	OutageTolerance:           time.Hour,
	ForGracePeriod:            time.Minute * 10,
	ResendDelay:               time.Minute,
}

Functions

func RegisterForTelemetry

func RegisterForTelemetry(t telemetry.Engine) error

func Validate

func Validate(cfg *Config) error

Types

type Config

type Config struct {
	NotificationQueueCapacity int
	OutageTolerance           time.Duration
	ForGracePeriod            time.Duration
	ResendDelay               time.Duration
	PrometheusConfigAddress   string
	PrometheusConfig          *prometheus_config.Config
}

func ParseFlags

func ParseFlags(fs *flag.FlagSet, cfg *Config) *Config

func (*Config) ContainsAlertingConfig

func (cfg *Config) ContainsAlertingConfig() bool

func (*Config) ContainsRules

func (cfg *Config) ContainsRules() bool

type Manager

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

func NewManager

func NewManager(ctx context.Context, r prometheus.Registerer, client *pgclient.Client, cfg *Config) (*Manager, func() error, error)

func (*Manager) AlertingRules

func (m *Manager) AlertingRules() []*prom_rules.AlertingRule

func (*Manager) ApplyConfig

func (m *Manager) ApplyConfig(cfg *prometheus_config.Config) error

func (*Manager) RuleGroups

func (m *Manager) RuleGroups() []*prom_rules.Group

func (*Manager) Run

func (m *Manager) Run() error

Run runs the managers and blocks on either a graceful exit or on error.

func (*Manager) WithPostRulesProcess

func (m *Manager) WithPostRulesProcess(f prom_rules.RuleGroupPostProcessFunc)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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