engine

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const TypeHeader = "X-PromQL-EngineType"

Variables

This section is empty.

Functions

func AddEngineTypeToContext

func AddEngineTypeToContext(ctx context.Context, r *http.Request) context.Context

Types

type Engine

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

func New

func New(opts promql.EngineOpts, thanosEngineCfg ThanosEngineConfig, reg prometheus.Registerer) *Engine

func (*Engine) MakeInstantQueryFromPlan

func (qf *Engine) MakeInstantQueryFromPlan(ctx context.Context, q storage.Queryable, opts promql.QueryOpts, root logicalplan.Node, ts time.Time, qs string) (promql.Query, error)

func (*Engine) MakeRangeQueryFromPlan

func (qf *Engine) MakeRangeQueryFromPlan(ctx context.Context, q storage.Queryable, opts promql.QueryOpts, root logicalplan.Node, start time.Time, end time.Time, interval time.Duration, qs string) (promql.Query, error)

func (*Engine) NewInstantQuery

func (qf *Engine) NewInstantQuery(ctx context.Context, q storage.Queryable, opts promql.QueryOpts, qs string, ts time.Time) (promql.Query, error)

func (*Engine) NewRangeQuery

func (qf *Engine) NewRangeQuery(ctx context.Context, q storage.Queryable, opts promql.QueryOpts, qs string, start, end time.Time, interval time.Duration) (promql.Query, error)

type QueryEngine

type QueryEngine interface {
	promql.QueryEngine
	MakeInstantQueryFromPlan(ctx context.Context, q storage.Queryable, opts promql.QueryOpts, root logicalplan.Node, ts time.Time, qs string) (promql.Query, error)
	MakeRangeQueryFromPlan(ctx context.Context, q storage.Queryable, opts promql.QueryOpts, root logicalplan.Node, start time.Time, end time.Time, interval time.Duration, qs string) (promql.Query, error)
}

type ThanosEngineConfig

type ThanosEngineConfig struct {
	Enabled           bool                    `yaml:"enabled"`
	EnableXFunctions  bool                    `yaml:"enable_x_functions"`
	Optimizers        string                  `yaml:"optimizers"`
	LogicalOptimizers []logicalplan.Optimizer `yaml:"-"`
}

ThanosEngineConfig contains the configuration to create engine

func (*ThanosEngineConfig) RegisterFlagsWithPrefix

func (cfg *ThanosEngineConfig) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet)

func (*ThanosEngineConfig) Validate

func (cfg *ThanosEngineConfig) Validate() error

type Type

type Type string
const (
	Prometheus Type = "prometheus"
	Thanos     Type = "thanos"
	None       Type = "none"
)

func GetEngineType

func GetEngineType(ctx context.Context) Type

Jump to

Keyboard shortcuts

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