ruler

package
v0.5.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2020 License: Apache-2.0 Imports: 43 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRuleStorage added in v0.6.0

func NewRuleStorage(cfg RuleStoreConfig) (rules.RuleStore, error)

NewRuleStorage returns a new rule storage backend poller and store

Types

type Config

type Config struct {
	ExternalURL        flagext.URLValue // This is used for template expansion in alerts; must be a valid URL
	EvaluationInterval time.Duration    // How frequently to evaluate rules by default.
	PollInterval       time.Duration    // How frequently to poll for updated rules
	StoreConfig        RuleStoreConfig  // Rule Storage and Polling configuration
	RulePath           string           // Path to store rule files for prom manager

	AlertmanagerURL             flagext.URLValue // URL of the Alertmanager to send notifications to.
	AlertmanagerDiscovery       bool             // Whether to use DNS SRV records to discover alertmanagers.
	AlertmanagerRefreshInterval time.Duration    // How long to wait between refreshing the list of alertmanagers based on DNS service discovery.
	AlertmanangerEnableV2API    bool             // Enables the ruler notifier to use the alertmananger V2 API
	NotificationQueueCapacity   int              // Capacity of the queue for notifications to be sent to the Alertmanager.
	NotificationTimeout         time.Duration    // HTTP timeout duration when sending notifications to the Alertmanager.

	EnableSharding   bool // Enable sharding rule groups
	SearchPendingFor time.Duration
	LifecyclerConfig ring.LifecyclerConfig
	FlushCheckPeriod time.Duration
}

Config is the configuration for the recording rules server.

func (*Config) RegisterFlags

func (cfg *Config) RegisterFlags(f *flag.FlagSet)

RegisterFlags adds the flags required to config this to the given FlagSet

type Pusher

type Pusher interface {
	Push(context.Context, *client.WriteRequest) (*client.WriteResponse, error)
}

Pusher is an ingester server that accepts pushes.

type RuleStoreConfig added in v0.6.0

type RuleStoreConfig struct {
	Type     string `yaml:"type"`
	ConfigDB client.Config
	// contains filtered or unexported fields
}

RuleStoreConfig conigures a rule store

func (*RuleStoreConfig) RegisterFlags added in v0.6.0

func (cfg *RuleStoreConfig) RegisterFlags(f *flag.FlagSet)

RegisterFlags registers flags.

type Ruler

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

Ruler evaluates rules.

func NewRuler

func NewRuler(cfg Config, engine *promql.Engine, queryable promStorage.Queryable, d *distributor.Distributor) (*Ruler, error)

NewRuler creates a new ruler from a distributor and chunk store.

func (*Ruler) Flush

func (r *Ruler) Flush()

Flush triggers a flush of all the work items currently scheduled by the ruler, currently every ruler will query a backend rule store for it's rules so no flush is required.

func (*Ruler) ServeHTTP

func (r *Ruler) ServeHTTP(w http.ResponseWriter, req *http.Request)

func (*Ruler) Stop

func (r *Ruler) Stop()

Stop stops the Ruler. Each function of the ruler is terminated before leaving the ring

func (*Ruler) StopIncomingRequests

func (r *Ruler) StopIncomingRequests()

StopIncomingRequests is called during the shutdown process. Ensure no new rules are scheduled on this Ruler Currently the api is decoupled from the scheduler, no action is required.

func (*Ruler) TransferOut

func (r *Ruler) TransferOut(ctx context.Context) error

TransferOut is a noop for the ruler

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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