ruler

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Overview

Package ruler runs Loki's ruler (rule storage, evaluation, alert notification, recording-rule remote write and the rules HTTP API) over runakefli's query engine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Defaults

func Defaults() (lokiruler.Config, rulestore.Config)

Defaults returns Loki's ruler and ruler_storage defaults (their flag defaults). rule_path moves from Loki's /rules to rules-temp, relative to the working directory like Loki's default ruler WAL directory (ruler-wal); Loki's single binary moves it under common.path_prefix, which runakefli lacks.

func Enabled

func Enabled(sc rulestore.Config) bool

Enabled reports whether the ruler runs: as in Loki's single binary, only when ruler_storage is configured.

func New

New builds Loki's ruler over e, as pkg/loki/modules.go initRulerStorage, initRuleEvaluator (local mode) and initRuler do, plus Loki's ruler HTTP API. The ruler is a dskit service the caller starts and stops. Only one ruler may run per process: Loki keeps its remote-write registry in a package variable.

func Validate

func Validate(rc lokiruler.Config, sc rulestore.Config) error

Validate runs Loki's ruler config validation and rejects the modes runakefli does not support.

Types

type Engine

type Engine interface {
	Query(ctx context.Context, p logql.Params) logql.Query
}

Engine executes a LogQL query; *pushdown.Engine and api.NewPlainQuerier satisfy it (it has api.Querier's method set).

type Evaluator

type Evaluator struct {
	Engine Engine
}

Evaluator implements Loki's pkg/ruler.Evaluator on runakefli's engine, so rules get Tier A push-down, Tier B fallback and query-time delete filtering like every other query.

func (*Evaluator) Eval

func (e *Evaluator) Eval(ctx context.Context, qs string, now time.Time) (*logqlmodel.Result, error)

Eval evaluates a LogQL query string at the given time.

Jump to

Keyboard shortcuts

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