Versions in this module Expand all Collapse all v2 v2.0.0 Jun 14, 2023 Changes in this version + const DefaultBlockedQueryMessage + const DefaultEngineTimeout + const FailureKey + const MetricsKey + const NoopKey + const QueryTypeFilter + const QueryTypeLabels + const QueryTypeLimited + const QueryTypeMetric + const QueryTypeSeries + const StreamsKey + const SuccessKey + var NoLimits = &fakeLimits + var QueriesBlocked = promauto.NewCounterVec(prometheus.CounterOpts{ ... }, []string{ ... }) + var QueryTime = promauto.NewHistogramVec(prometheus.HistogramOpts{ ... }, []string{ ... }) + func EvaluatorUnsupportedType(expr syntax.Expr, ev Evaluator) error + func HashedQuery(query string) uint32 + func Match(xs []string) ([][]*labels.Matcher, error) + func PopulateMatrixFromScalar(data promql.Scalar, params Params) promql.Matrix + func PrintMatches(matches []string) string + 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) + func Sortable(q Params) (bool, error) + type AvgOverTime struct + type BatchRangeVectorAggregator func([]promql.FPoint) float64 + 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) GetStats(_ syntax.Expr) (stats.Stats, error) + func (s ConstantShards) Shards(_ syntax.Expr) (int, uint64, error) + type CountOverTime struct + 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 + Timeout time.Duration + func NewEngine(opts EngineOpts, q Querier, l Limits, logger log.Logger) *Engine + func (ng *Engine) Query(params Params) Query + type EngineOpts struct + LogExecutingQuery bool + 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 FirstOverTime struct + type LastOverTime struct + type Limits interface + BlockedQueries func(context.Context, string) []*validation.BlockedQuery + MaxQueryRange func(ctx context.Context, userID string) time.Duration + MaxQuerySeries func(context.Context, string) int + QueryTimeout func(context.Context, string) time.Duration + 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 MaxOverTime struct + type MinOverTime struct + 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(_ context.Context, req SelectLogParams) (iter.EntryIterator, error) + func (q MockQuerier) SelectSamples(_ context.Context, req SelectSampleParams) (iter.SampleIterator, error) + type OneOverTime struct + 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 QuantileOverTime struct + 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 RangeStreamingAgg interface + type RangeVectorIterator interface + At func() (int64, promql.Vector) + Close func() error + Error func() error + Next func() bool + type RateCounterOverTime struct + type RateLogBytesOverTime struct + type RateLogsOverTime struct + 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, uint64, error) + func (m ShardMapper) Parse(query string) (noop bool, bytesPerShard uint64, expr syntax.Expr, err error) + type ShardResolver interface + GetStats func(e syntax.Expr) (stats.Stats, error) + Shards func(expr syntax.Expr) (int, uint64, error) + type Shards []astmapper.ShardAnnotation + func ParseShards(strs []string) (Shards, error) + func (xs Shards) Encode() (encoded []string) + type StddevOverTime struct + type StdvarOverTime struct + 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) + type SumOverTime struct