Versions in this module Expand all Collapse all v2 v2.6.2 Aug 12, 2022 Changes in this version + const FailureKey + const MetricsKey + const NoopKey + const QueryTypeFilter + const QueryTypeLabels + const QueryTypeLimited + const QueryTypeMetric + const QueryTypeSeries + const StreamsKey + const SuccessKey + var NoLimits = &fakeLimits + var QueryTime = promauto.NewHistogramVec(prometheus.HistogramOpts{ ... }, []string{ ... }) + 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 RecordLabelQueryMetrics(ctx context.Context, log log.Logger, start, end time.Time, ...) + func RecordRangeAndInstantQueryMetrics(ctx context.Context, log log.Logger, p Params, status string, ...) + func RecordSeriesQueryMetrics(ctx context.Context, log log.Logger, start, end time.Time, match []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 ConstantShards int + func (s ConstantShards) Shards(_ syntax.Expr) (int, error) + 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, limits Limits, ...) *DownstreamEngine + func (ng *DownstreamEngine) Opts() EngineOpts + func (ng *DownstreamEngine) Query(ctx context.Context, 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(context.Context) 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 MapperMetrics struct + DownstreamFactor prometheus.Histogram + DownstreamQueries *prometheus.CounterVec + ParsedQueries *prometheus.CounterVec + func NewRangeMapperMetrics(registerer prometheus.Registerer) *MapperMetrics + func NewShardMapperMetrics(registerer prometheus.Registerer) *MapperMetrics + 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(_ context.Context) 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 RangeMapper struct + func NewRangeMapper(interval time.Duration, metrics *MapperMetrics) (RangeMapper, error) + func (m RangeMapper) Map(expr syntax.SampleExpr, vectorAggrPushdown *syntax.VectorAggregationExpr, ...) (syntax.SampleExpr, error) + func (m RangeMapper) Parse(query string) (bool, syntax.Expr, error) + 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(resolver ShardResolver, metrics *MapperMetrics) ShardMapper + func (m ShardMapper) Map(expr syntax.Expr, r *downstreamRecorder) (syntax.Expr, error) + func (m ShardMapper) Parse(query string) (noop bool, expr syntax.Expr, err error) + type ShardResolver interface + Shards func(expr syntax.Expr) (int, error) + 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/yankunsam/loki