Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
API implements the configs api.
func NewAPIFromConfig ¶
NewAPIFromConfig makes a new API from our database config.
func (*API) RegisterRoutes ¶
RegisterRoutes registers the configs API HTTP routes with the provided Router.
type Config ¶
type Config struct { // This is used for template expansion in alerts; must be a valid URL ExternalURL flagext.URLValue // How frequently to evaluate rules by default. EvaluationInterval time.Duration NumWorkers int // URL of the Alertmanager to send notifications to. AlertmanagerURL flagext.URLValue // Whether to use DNS SRV records to discover alertmanagers. AlertmanagerDiscovery bool // How long to wait between refreshing the list of alertmanagers based on // DNS service discovery. AlertmanagerRefreshInterval time.Duration // Enables the ruler notifier to use the alertmananger V2 API AlertmanangerEnableV2API bool // Capacity of the queue for notifications to be sent to the Alertmanager. NotificationQueueCapacity int // HTTP timeout duration when sending notifications to the Alertmanager. NotificationTimeout time.Duration // Timeout for rule group evaluation, including sending result to ingester GroupTimeout time.Duration EnableSharding bool SearchPendingFor time.Duration LifecyclerConfig ring.LifecyclerConfig FlushCheckPeriod time.Duration }
Config is the configuration for the recording rules server.
func (*Config) RegisterFlags ¶
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 Ruler ¶
type Ruler struct {
// contains filtered or unexported fields
}
Ruler evaluates rules.
func NewRuler ¶
func NewRuler(cfg Config, engine *promql.Engine, queryable storage.Queryable, d *distributor.Distributor, rulesAPI client.Client) (*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) 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.
type ScheduledItem ¶
type ScheduledItem interface { Key() string // Scheduled returns the earliest possible time the time is available for // dequeueing. Scheduled() time.Time }
ScheduledItem is an item in a queue of scheduled items.
type SchedulingQueue ¶
type SchedulingQueue struct {
// contains filtered or unexported fields
}
SchedulingQueue is like a priority queue, but the first item is the oldest scheduled item. Items are only able to be dequeued after the time they are scheduled to be run.
func NewSchedulingQueue ¶
func NewSchedulingQueue(clock clockwork.Clock) *SchedulingQueue
NewSchedulingQueue makes a new scheduling queue.
func (*SchedulingQueue) Close ¶
func (sq *SchedulingQueue) Close()
Close the scheduling queue. No more items can be added. Items can be dequeued until there are none left.
func (*SchedulingQueue) Dequeue ¶
func (sq *SchedulingQueue) Dequeue() ScheduledItem
Dequeue takes an item from the queue. If there are no items, or the first item isn't ready to be scheduled, it blocks. If there queue is closed, this will return nil.
func (*SchedulingQueue) Enqueue ¶
func (sq *SchedulingQueue) Enqueue(item ScheduledItem)
Enqueue schedules an item for later Dequeueing.