promql

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package promql provides a PromQL engine implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFilteredSelector

func NewFilteredSelector(q storage.Querier, matchers, filters []*labels.Matcher, hints storage.SelectHints) promscanners.SeriesSelector

NewFilteredSelector creates new promscanners.SeriesSelector that applies filtering.

func NewHistogramStatsSelector

func NewHistogramStatsSelector(seriesSelector promscanners.SeriesSelector) promscanners.SeriesSelector

NewHistogramStatsSelector creates new promscanners.SeriesSelector that decodes native histograms.

func NewSelector

func NewSelector(q storage.Querier, matchers []*labels.Matcher, hints storage.SelectHints) promscanners.SeriesSelector

NewSelector creates new promscanners.SeriesSelector.

func SeriesShard

func SeriesShard(series []promscanners.SignedSeries, index, numShards int) []promscanners.SignedSeries

SeriesShard shards series using given index.

Types

type Engine

type Engine interface {
	NewInstantQuery(ctx context.Context, q storage.Queryable, opts promql.QueryOpts, qs string, ts time.Time) (promql.Query, error)
	NewRangeQuery(ctx context.Context, q storage.Queryable, opts promql.QueryOpts, qs string, start, end time.Time, interval time.Duration) (promql.Query, error)
}

Engine is a Prometheus engine interface.

func New

func New(q Querier, opts promql.EngineOpts) (Engine, error)

New creates new Engine.

type EngineOpts

type EngineOpts = promql.EngineOpts

EngineOpts defines PromQL engine options.

type Querier

type Querier interface {
	storage.Queryable
	storage.ExemplarQueryable
	MetricsScanners() (enginestorage.Scanners, error)
}

Querier is Prometheus storage interface.

Jump to

Keyboard shortcuts

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