Versions in this module Expand all Collapse all v2 v2.4.3 Mar 21, 2022 Changes in this version + const FailureKey + const MetricsKey + const NoopKey + const QueryTypeFilter + const QueryTypeLimited + const QueryTypeMetric + const StreamsKey + const SuccessKey + var NoLimits = &fakeLimits + func EvaluatorUnsupportedType(expr syntax.Expr, ev Evaluator) error + func Match(xs []string) ([][]*labels.Matcher, error) + func PopulateMatrixFromScalar(data promql.Scalar, params Params) promql.Matrix + func QueryType(query string) (string, error) + func RecordMetrics(ctx context.Context, log log.Logger, p Params, status string, ...) + func ResultIterator(res logqlmodel.Result, params Params) (iter.EntryIterator, error) + type ConcatLogSelectorExpr struct + func (c ConcatLogSelectorExpr) String() string + type ConcatSampleExpr struct + func (c ConcatSampleExpr) String() string + func (c ConcatSampleExpr) Walk(f syntax.WalkFn) + type DefaultEvaluator struct + func NewDefaultEvaluator(querier Querier, maxLookBackPeriod time.Duration) *DefaultEvaluator + func (ev *DefaultEvaluator) Iterator(ctx context.Context, expr syntax.LogSelectorExpr, q Params) (iter.EntryIterator, error) + func (ev *DefaultEvaluator) StepEvaluator(ctx context.Context, nextEv SampleEvaluator, expr syntax.SampleExpr, q Params) (StepEvaluator, error) + type DownstreamEngine struct + func NewDownstreamEngine(opts EngineOpts, downstreamable Downstreamable, metrics *ShardingMetrics, ...) *DownstreamEngine + func (ng *DownstreamEngine) Query(p Params, mapped syntax.Expr) Query + type DownstreamEvaluator struct + func NewDownstreamEvaluator(downstreamer Downstreamer) *DownstreamEvaluator + func (ev *DownstreamEvaluator) Iterator(ctx context.Context, expr syntax.LogSelectorExpr, params Params) (iter.EntryIterator, error) + func (ev *DownstreamEvaluator) StepEvaluator(ctx context.Context, nextEv SampleEvaluator, expr syntax.SampleExpr, ...) (StepEvaluator, error) + func (ev DownstreamEvaluator) Downstream(ctx context.Context, queries []DownstreamQuery) ([]logqlmodel.Result, error) + type DownstreamLogSelectorExpr struct + func (d DownstreamLogSelectorExpr) String() string + type DownstreamQuery struct + Expr syntax.Expr + Params Params + Shards Shards + type DownstreamSampleExpr struct + func (d DownstreamSampleExpr) String() string + func (d DownstreamSampleExpr) Walk(f syntax.WalkFn) + type Downstreamable interface + Downstreamer func() Downstreamer + type Downstreamer interface + Downstream func(context.Context, []DownstreamQuery) ([]logqlmodel.Result, error) + type Engine struct + func NewEngine(opts EngineOpts, q Querier, l Limits, logger log.Logger) *Engine + func (ng *Engine) Query(params Params) Query + type EngineOpts struct + MaxLookBackPeriod time.Duration + Timeout time.Duration + func (opts *EngineOpts) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet) + type EntryEvaluator interface + Iterator func(context.Context, syntax.LogSelectorExpr, Params) (iter.EntryIterator, error) + type Evaluator interface + type Limits interface + MaxQuerySeries func(userID string) int + type LiteralParams struct + func NewLiteralParams(qs string, start, end time.Time, step, interval time.Duration, ...) LiteralParams + func (p LiteralParams) Copy() LiteralParams + func (p LiteralParams) Direction() logproto.Direction + func (p LiteralParams) End() time.Time + func (p LiteralParams) Interval() time.Duration + func (p LiteralParams) Limit() uint32 + func (p LiteralParams) Query() string + func (p LiteralParams) Shards() []string + func (p LiteralParams) Start() time.Time + func (p LiteralParams) Step() time.Duration + type MatrixStepper struct + func NewMatrixStepper(start, end time.Time, step time.Duration, m promql.Matrix) *MatrixStepper + func (m *MatrixStepper) Close() error + func (m *MatrixStepper) Error() error + func (m *MatrixStepper) Next() (bool, int64, promql.Vector) + type MockDownstreamer struct + func (m MockDownstreamer) Downstream(ctx context.Context, queries []DownstreamQuery) ([]logqlmodel.Result, error) + func (m MockDownstreamer) Downstreamer() Downstreamer + type MockQuerier struct + func NewMockQuerier(shards int, streams []logproto.Stream) MockQuerier + func (q MockQuerier) SelectLogs(ctx context.Context, req SelectLogParams) (iter.EntryIterator, error) + func (q MockQuerier) SelectSamples(ctx context.Context, req SelectSampleParams) (iter.SampleIterator, error) + type Params interface + Direction func() logproto.Direction + End func() time.Time + Interval func() time.Duration + Limit func() uint32 + Query func() string + Shards func() []string + Start func() time.Time + Step func() time.Duration + type Querier interface + SelectLogs func(context.Context, SelectLogParams) (iter.EntryIterator, error) + SelectSamples func(context.Context, SelectSampleParams) (iter.SampleIterator, error) + type Query interface + Exec func(ctx context.Context) (logqlmodel.Result, error) + type QueryParams interface + GetEnd func() time.Time + GetShards func() []string + GetStart func() time.Time + LogSelector func() (syntax.LogSelectorExpr, error) + type QueryRangeType string + var InstantType QueryRangeType = "instant" + var RangeType QueryRangeType = "range" + func GetRangeType(q Params) QueryRangeType + type RangeVectorAggregator func([]promql.Point) float64 + type RangeVectorIterator interface + At func(aggregator RangeVectorAggregator) (int64, promql.Vector) + Close func() error + Error func() error + Next func() bool + type SampleEvaluator interface + StepEvaluator func(ctx context.Context, nextEvaluator SampleEvaluator, expr syntax.SampleExpr, ...) (StepEvaluator, error) + type SampleEvaluatorFunc func(ctx context.Context, nextEvaluator SampleEvaluator, expr syntax.SampleExpr, ...) (StepEvaluator, error) + func (s SampleEvaluatorFunc) StepEvaluator(ctx context.Context, nextEvaluator SampleEvaluator, expr syntax.SampleExpr, ...) (StepEvaluator, error) + type SelectLogParams struct + func (s SelectLogParams) LogSelector() (syntax.LogSelectorExpr, error) + func (s SelectLogParams) String() string + type SelectSampleParams struct + func (s SelectSampleParams) Expr() (syntax.SampleExpr, error) + func (s SelectSampleParams) LogSelector() (syntax.LogSelectorExpr, error) + type ShardMapper struct + func NewShardMapper(shards int, metrics *ShardingMetrics) (ShardMapper, error) + func (m ShardMapper) Map(expr syntax.Expr, r *shardRecorder) (syntax.Expr, error) + func (m ShardMapper) Parse(query string) (noop bool, expr syntax.Expr, err error) + type ShardingMetrics struct + ShardFactor prometheus.Histogram + Shards *prometheus.CounterVec + func NewShardingMetrics(registerer prometheus.Registerer) *ShardingMetrics + type Shards []astmapper.ShardAnnotation + func ParseShards(strs []string) (Shards, error) + func (xs Shards) Encode() (encoded []string) + type StepEvaluator interface + Close func() error + Error func() error + Next func() (ok bool, ts int64, vec promql.Vector) + func ConcatEvaluator(evaluators []StepEvaluator) (StepEvaluator, error) + func ResultStepEvaluator(res logqlmodel.Result, params Params) (StepEvaluator, error) Other modules containing this package github.com/pao214/loki github.com/pao214/loki/v3