Documentation
¶
Overview ¶
Index ¶
- Constants
- Variables
- func EvaluatorUnsupportedType(expr syntax.Expr, ev EvaluatorFactory) error
- func JoinCountDistinctSketchVector(next bool, r StepResult, stepEvaluator StepEvaluator, params Params) (promql_parser.Value, error)
- func JoinCountMinSketchVector(_ bool, r StepResult, stepEvaluator StepEvaluator, params Params) (promql_parser.Value, error)
- func JoinQuantileSketchVector(next bool, r StepResult, stepEvaluator StepEvaluator, params Params) (promql_parser.Value, error)
- func MatchForSeriesRequest(xs []string) ([][]*labels.Matcher, error)
- func ParseShard(s string) (Shard, ShardVersion, error)
- func ParseShards(strs []string) (Shards, ShardVersion, error)
- func PopulateMatrixFromScalar(data promql.Scalar, params Params) promql.Matrix
- func PrintMatches(matches []string) string
- func Quantile(q float64, values vector.HeapByMaxValue) float64
- func QueryType(expr syntax.Expr) (string, error)
- func RecordDetectedFieldsQueryMetrics(ctx context.Context, log log.Logger, start, end time.Time, query string, ...)
- func RecordDetectedLabelsQueryMetrics(ctx context.Context, log log.Logger, start time.Time, end time.Time, ...)
- func RecordLabelQueryMetrics(ctx context.Context, log log.Logger, start, end time.Time, ...)
- func RecordLoglineIndexQueryMetrics(ctx context.Context, log log.Logger, start, end time.Time, query string, ...)
- 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 RecordShardsQueryMetrics(ctx context.Context, log log.Logger, start, end time.Time, query string, ...)
- func RecordStatsQueryMetrics(ctx context.Context, log log.Logger, start, end time.Time, query string, ...)
- func RecordVolumeQueryMetrics(ctx context.Context, log log.Logger, start, end time.Time, query string, ...)
- func ResultIterator(res logqlmodel.Result, direction logproto.Direction) (iter.EntryIterator, error)
- func Sortable(q Params) (bool, error)
- func StreamFirstRangeAggregation(query string) (*syntax.RangeAggregationExpr, bool)
- func StreamFirstRangeAggregationExpr(expr syntax.Expr) (*syntax.RangeAggregationExpr, bool)
- func WithComponentContext(ctx context.Context, component string) context.Context
- type AbsentRangeVectorEvaluator
- type AccumulatedStreams
- func (acc *AccumulatedStreams) Accumulate(_ context.Context, x logqlmodel.Result, _ int) error
- func (acc *AccumulatedStreams) Find(labels string) (int, bool)
- func (acc *AccumulatedStreams) Len() int
- func (acc *AccumulatedStreams) Less(i, j int) bool
- func (acc *AccumulatedStreams) Pop() any
- func (acc *AccumulatedStreams) Push(x any)
- func (acc *AccumulatedStreams) Result() []logqlmodel.Result
- func (acc *AccumulatedStreams) Swap(i, j int)
- type Accumulator
- type AvgOverTime
- type BatchRangeVectorAggregator
- type BinOpStepEvaluator
- type BufferedAccumulator
- type ConcatLogSelectorExpr
- type ConcatSampleExpr
- type ConcatStepEvaluator
- type ConstantShards
- type CountDistinctSketchAccumulator
- type CountDistinctSketchEvalExpr
- type CountDistinctSketchMatrix
- func (m CountDistinctSketchMatrix) Merge(right CountDistinctSketchMatrix) (CountDistinctSketchMatrix, error)
- func (CountDistinctSketchMatrix) String() string
- func (m CountDistinctSketchMatrix) ToProto() (*logproto.CountDistinctSketchMatrix, error)
- func (CountDistinctSketchMatrix) Type() promql_parser.ValueType
- type CountDistinctSketchMatrixStepEvaluator
- type CountDistinctSketchMergeExpr
- type CountDistinctSketchSample
- type CountDistinctSketchVector
- func (v CountDistinctSketchVector) CountDistinctSketchVec() CountDistinctSketchVector
- func (CountDistinctSketchVector) CountMinSketchVec() CountMinSketchVector
- func (v CountDistinctSketchVector) Estimate() SampleVector
- func (v CountDistinctSketchVector) Merge(right CountDistinctSketchVector) (CountDistinctSketchVector, error)
- func (CountDistinctSketchVector) QuantileSketchVec() ProbabilisticQuantileVector
- func (CountDistinctSketchVector) SampleVector() promql.Vector
- func (CountDistinctSketchVector) String() string
- func (v CountDistinctSketchVector) ToProto() (*logproto.CountDistinctSketchVector, error)
- func (CountDistinctSketchVector) Type() promql_parser.ValueType
- type CountDistinctSketchVectorStepEvaluator
- type CountMinSketchAccumulator
- type CountMinSketchEvalExpr
- type CountMinSketchEvalStepEvaluator
- type CountMinSketchVector
- func (CountMinSketchVector) CountDistinctSketchVec() CountDistinctSketchVector
- func (v CountMinSketchVector) CountMinSketchVec() CountMinSketchVector
- func (v *CountMinSketchVector) Merge(right *CountMinSketchVector) (*CountMinSketchVector, error)
- func (CountMinSketchVector) QuantileSketchVec() ProbabilisticQuantileVector
- func (CountMinSketchVector) SampleVector() promql.Vector
- func (CountMinSketchVector) String() string
- func (v CountMinSketchVector) ToProto() (*logproto.CountMinSketchVector, error)
- func (CountMinSketchVector) Type() promql_parser.ValueType
- type CountMinSketchVectorStepEvaluator
- type CountOverTime
- type DefaultEvaluator
- type DownstreamEngine
- type DownstreamEvaluator
- func (ev DownstreamEvaluator) Downstream(ctx context.Context, queries []DownstreamQuery, acc Accumulator) ([]logqlmodel.Result, error)
- func (ev *DownstreamEvaluator) NewIterator(ctx context.Context, expr syntax.LogSelectorExpr, params Params) (iter.EntryIterator, error)
- func (ev *DownstreamEvaluator) NewStepEvaluator(ctx context.Context, nextEvFactory SampleEvaluatorFactory, ...) (StepEvaluator, error)
- type DownstreamLogSelectorExpr
- type DownstreamQuery
- type DownstreamSampleExpr
- type Downstreamable
- type Downstreamer
- type DynamicBoundsStrategy
- type EmptyEvaluator
- type Engine
- type EngineOpts
- type EntryEvaluatorFactory
- type EvaluatorFactory
- type FirstOverTime
- type HeapCountMinSketchVector
- func (v *HeapCountMinSketchVector) Add(metric labels.Labels, value float64)
- func (v HeapCountMinSketchVector) Len() int
- func (v HeapCountMinSketchVector) Less(i, j int) bool
- func (v *HeapCountMinSketchVector) Pop() any
- func (v *HeapCountMinSketchVector) Push(x any)
- func (v HeapCountMinSketchVector) Swap(i, j int)
- type LabelReplaceEvaluator
- type LastOverTime
- type Limits
- type LiteralParams
- func (p LiteralParams) CachingOptions() resultscache.CachingOptions
- func (p LiteralParams) Copy() LiteralParams
- func (p LiteralParams) Direction() logproto.Direction
- func (p LiteralParams) End() time.Time
- func (p LiteralParams) GetDataObjOptions() *logproto.DataObjOptions
- func (p LiteralParams) GetExpression() syntax.Expr
- func (p LiteralParams) GetHintRanges() []logproto.HintTimeRange
- func (p LiteralParams) GetStoreChunks() *logproto.ChunkRefGroup
- func (p LiteralParams) Interval() time.Duration
- func (p LiteralParams) Limit() uint32
- func (p LiteralParams) QueryString() string
- func (p LiteralParams) Shards() []string
- func (p LiteralParams) Start() time.Time
- func (p LiteralParams) Step() time.Duration
- func (p LiteralParams) WithDataObjOptions(options *logproto.DataObjOptions) LiteralParams
- type LiteralStepEvaluator
- type MapperMetrics
- type MapperStats
- type MatrixStepEvaluator
- type MaxOverTime
- type MergeFirstOverTimeExpr
- type MergeLastOverTimeExpr
- type MinOverTime
- type MockDownstreamer
- type MockQuerier
- type Node
- type OneOverTime
- type Params
- type ParamsWithChunkOverrides
- type ParamsWithExpressionOverride
- type ParamsWithShardsOverride
- type PowerOfTwoStrategy
- type ProbabilisticQuantileMatrix
- func (m ProbabilisticQuantileMatrix) Merge(right ProbabilisticQuantileMatrix) (ProbabilisticQuantileMatrix, error)
- func (m ProbabilisticQuantileMatrix) Release()
- func (ProbabilisticQuantileMatrix) String() string
- func (m ProbabilisticQuantileMatrix) ToProto() *logproto.QuantileSketchMatrix
- func (ProbabilisticQuantileMatrix) Type() promql_parser.ValueType
- type ProbabilisticQuantileSample
- type ProbabilisticQuantileVector
- func (ProbabilisticQuantileVector) CountDistinctSketchVec() CountDistinctSketchVector
- func (ProbabilisticQuantileVector) CountMinSketchVec() CountMinSketchVector
- func (q ProbabilisticQuantileVector) Merge(right ProbabilisticQuantileVector) (ProbabilisticQuantileVector, error)
- func (q ProbabilisticQuantileVector) QuantileSketchVec() ProbabilisticQuantileVector
- func (q ProbabilisticQuantileVector) Release()
- func (ProbabilisticQuantileVector) SampleVector() promql.Vector
- func (q ProbabilisticQuantileVector) ToProto() *logproto.QuantileSketchVector
- type QuantileOverTime
- type QuantileSketchAccumulator
- type QuantileSketchEvalExpr
- type QuantileSketchMatrixStepEvaluator
- type QuantileSketchMergeExpr
- type QuantileSketchStepEvaluator
- type QuantileSketchVectorStepEvaluator
- type Querier
- type Query
- type QueryEngine
- type QueryParams
- type QueryRangeType
- type RangeMapper
- type RangeStreamingAgg
- type RangeVectorEvaluator
- type RangeVectorIterator
- type RateCounterOverTime
- type RateLogBytesOverTime
- type RateLogsOverTime
- type Resp
- type SampleEvaluatorFactory
- type SampleEvaluatorFunc
- type SampleVector
- type SelectLogParams
- type SelectSampleParams
- func (s SelectSampleParams) Expr() (syntax.SampleExpr, error)
- func (s SelectSampleParams) LogSelector() (syntax.LogSelectorExpr, error)
- func (s SelectSampleParams) WithStoreChunks(chunkRefGroup *logproto.ChunkRefGroup) SelectSampleParams
- func (s SelectSampleParams) WithTimeRange(start, end time.Time) SelectSampleParams
- type Shard
- type ShardMapper
- type ShardResolver
- type ShardVersion
- type ShardWithChunkRefs
- type ShardingStrategy
- type Shards
- type SketchMatrixStepEvaluator
- type StddevOverTime
- type StdvarOverTime
- type StepEvaluator
- func NewMergeFirstOverTimeStepEvaluator(params Params, m []promql.Matrix, offset, rangeInterval time.Duration) StepEvaluator
- func NewMergeLastOverTimeStepEvaluator(params Params, m []promql.Matrix, offset, rangeInterval time.Duration) StepEvaluator
- func NewResultStepEvaluator(res logqlmodel.Result, params Params) (StepEvaluator, error)
- type StepResult
- type SumOverTime
- type VectorAggEvaluator
- type VectorIterator
- type VectorStepEvaluator
Constants ¶
const ( CountDistinctSketchVectorType = "CountDistinctSketchVector" CountDistinctSketchMatrixType = "CountDistinctSketchMatrix" )
const ( StreamsKey = "streams" MetricsKey = "metrics" )
expression type used in metrics
const ( SuccessKey = "success" FailureKey = "failure" NoopKey = "noop" )
parsing evaluation result used in metrics
const ( QueryTypeMetric = "metric" QueryTypeFilter = "filter" QueryTypeLimited = "limited" QueryTypeLabels = "labels" QueryTypeSeries = "series" QueryTypeStats = "stats" QueryTypeLoglineIndex = "logline_index" QueryTypeShards = "shards" QueryTypeVolume = "volume" )
const ( ShardLastOverTime = "last_over_time" ShardFirstOverTime = "first_over_time" ShardQuantileOverTime = "quantile_over_time" SupportApproxTopk = "approx_topk" SupportApproxCountDistinct = "approx_count_distinct" )
const ConCurrency = 100
const (
CountMinSketchVectorType = "CountMinSketchVector"
)
const (
DefaultBlockedQueryMessage = "blocked by policy"
)
const MaxChildrenDisplay = 3
MaxChildrenDisplay defines the maximum number of children that should be shown by explain.
const (
QuantileSketchMatrixType = "QuantileSketchMatrix"
)
Variables ¶
var ( QueryTime = promauto.NewHistogramVec(prometheus.HistogramOpts{ Namespace: "logql", Name: "query_duration_seconds", Help: "LogQL query timings", Buckets: prometheus.DefBuckets, }, []string{"query_type"}) QueriesBlocked = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: constants.Loki, Name: "blocked_queries", Help: "Count of queries blocked by per-tenant policy", }, []string{"user"}) )
var NoLimits = &fakeLimits{ maxSeries: math.MaxInt32, timeout: time.Hour, }
Functions ¶
func EvaluatorUnsupportedType ¶
func EvaluatorUnsupportedType(expr syntax.Expr, ev EvaluatorFactory) error
EvaluatorUnsupportedType is a helper for signaling that an evaluator does not support an Expr type
func JoinCountDistinctSketchVector ¶
func JoinCountDistinctSketchVector(next bool, r StepResult, stepEvaluator StepEvaluator, params Params) (promql_parser.Value, error)
JoinCountDistinctSketchVector joins step sketches into a CountDistinctSketchMatrix.
func JoinCountMinSketchVector ¶
func JoinCountMinSketchVector(_ bool, r StepResult, stepEvaluator StepEvaluator, params Params) (promql_parser.Value, error)
JoinCountMinSketchVector joins the results from stepEvaluator into a CountMinSketchVector.
func JoinQuantileSketchVector ¶
func JoinQuantileSketchVector(next bool, r StepResult, stepEvaluator StepEvaluator, params Params) (promql_parser.Value, error)
JoinQuantileSketchVector joins the results from stepEvaluator into a ProbabilisticQuantileMatrix.
func MatchForSeriesRequest ¶
MatchForSeriesRequest extracts and parses multiple matcher groups from a slice of strings. Does not perform validation as it's used for series queries which allow empty matchers
func ParseShard ¶
func ParseShard(s string) (Shard, ShardVersion, error)
func ParseShards ¶
func ParseShards(strs []string) (Shards, ShardVersion, error)
ParseShards parses a list of string encoded shards
func PrintMatches ¶
func Quantile ¶
func Quantile(q float64, values vector.HeapByMaxValue) float64
Quantile calculates the given Quantile of a vector of samples.
The Vector will be sorted. If 'values' has zero elements, NaN is returned. If q<0, -Inf is returned. If q>1, +Inf is returned.
func RecordLabelQueryMetrics ¶
func RecordStatsQueryMetrics ¶
func ResultIterator ¶
func ResultIterator(res logqlmodel.Result, direction logproto.Direction) (iter.EntryIterator, error)
ResultIterator coerces a downstream streams result into an iter.EntryIterator
func StreamFirstRangeAggregation ¶
func StreamFirstRangeAggregation(query string) (*syntax.RangeAggregationExpr, bool)
StreamFirstRangeAggregation returns the range aggregation of query, and true, when the engine is capable of running query in stream-first sample order.
func StreamFirstRangeAggregationExpr ¶
func StreamFirstRangeAggregationExpr(expr syntax.Expr) (*syntax.RangeAggregationExpr, bool)
StreamFirstRangeAggregationExpr returns the range aggregation of a stream-first sum expression, and true. It returns false for any other expression.
Types ¶
type AbsentRangeVectorEvaluator ¶
type AbsentRangeVectorEvaluator struct {
// contains filtered or unexported fields
}
func (AbsentRangeVectorEvaluator) Close ¶
func (r AbsentRangeVectorEvaluator) Close() error
func (AbsentRangeVectorEvaluator) Error ¶
func (r AbsentRangeVectorEvaluator) Error() error
func (*AbsentRangeVectorEvaluator) Explain ¶
func (e *AbsentRangeVectorEvaluator) Explain(parent Node)
func (*AbsentRangeVectorEvaluator) Next ¶
func (r *AbsentRangeVectorEvaluator) Next() (bool, int64, StepResult)
type AccumulatedStreams ¶
type AccumulatedStreams struct {
// contains filtered or unexported fields
}
heap impl for keeping only the top n results across m streams importantly, AccumulatedStreams is _bounded_, so it will only store the top `limit` results across all streams. To implement this, we use a min-heap when looking for the max values (logproto.FORWARD) and vice versa for logproto.BACKWARD. This allows us to easily find the 'worst' value and replace it with a better one. Once we've fully processed all log lines, we return the heap in opposite order and then reverse it to get the correct order. Heap implements container/heap.Interface solely to use heap.Interface as a library. It is not intended for the heap pkg functions to otherwise call this type.
func NewStreamAccumulator ¶
func NewStreamAccumulator(params Params) *AccumulatedStreams
NewStreamAccumulator returns an accumulator for limited log queries. Log queries, sharded thousands of times and each returning <limit> results, can be _considerably_ larger. In this case, we eagerly accumulate the results into a logsAccumulator, discarding values over the limit to keep memory pressure down while other subqueries are executing.
func (*AccumulatedStreams) Accumulate ¶
func (acc *AccumulatedStreams) Accumulate(_ context.Context, x logqlmodel.Result, _ int) error
func (*AccumulatedStreams) Less ¶
func (acc *AccumulatedStreams) Less(i, j int) bool
first order by timestamp, then by labels
func (*AccumulatedStreams) Pop ¶
func (acc *AccumulatedStreams) Pop() any
Pop returns a stream with one entry. It pops the first entry of the first stream
func (*AccumulatedStreams) Push ¶
func (acc *AccumulatedStreams) Push(x any)
func (*AccumulatedStreams) Result ¶
func (acc *AccumulatedStreams) Result() []logqlmodel.Result
Note: can only be called once as it will alter stream ordreing.
func (*AccumulatedStreams) Swap ¶
func (acc *AccumulatedStreams) Swap(i, j int)
type Accumulator ¶
type Accumulator interface {
Accumulate(context.Context, logqlmodel.Result, int) error
Result() []logqlmodel.Result
}
Accumulator is an interface for accumulating query results.
type AvgOverTime ¶
type AvgOverTime struct {
// contains filtered or unexported fields
}
AvgOverTime is the streaming counterpart of avgOverTime.
type BatchRangeVectorAggregator ¶
BatchRangeVectorAggregator aggregates the samples within a range window. It receives the samples in the window and the window end timestamp in nanoseconds.
type BinOpStepEvaluator ¶
type BinOpStepEvaluator struct {
// contains filtered or unexported fields
}
func (*BinOpStepEvaluator) Close ¶
func (e *BinOpStepEvaluator) Close() (lastError error)
func (*BinOpStepEvaluator) Error ¶
func (e *BinOpStepEvaluator) Error() error
func (*BinOpStepEvaluator) Explain ¶
func (e *BinOpStepEvaluator) Explain(parent Node)
func (*BinOpStepEvaluator) Next ¶
func (e *BinOpStepEvaluator) Next() (bool, int64, StepResult)
type BufferedAccumulator ¶
type BufferedAccumulator struct {
// contains filtered or unexported fields
}
func NewBufferedAccumulator ¶
func NewBufferedAccumulator(n int) *BufferedAccumulator
NewBufferedAccumulator returns an accumulator which aggregates all query results in a slice. This is useful for metric queries, which are generally small payloads and the memory overhead for buffering is negligible.
func (*BufferedAccumulator) Accumulate ¶
func (a *BufferedAccumulator) Accumulate(_ context.Context, acc logqlmodel.Result, i int) error
func (*BufferedAccumulator) Result ¶
func (a *BufferedAccumulator) Result() []logqlmodel.Result
type ConcatLogSelectorExpr ¶
type ConcatLogSelectorExpr struct {
DownstreamLogSelectorExpr
// contains filtered or unexported fields
}
ConcatLogSelectorExpr is an expr for concatenating multiple LogSelectorExpr
func (*ConcatLogSelectorExpr) Pretty ¶
func (c *ConcatLogSelectorExpr) Pretty(level int) string
ConcatLogSelectorExpr has no representation in LogQL. Its prettified version is e.g. `concat(downstream<{foo="bar"} |= "error", shard=1_of_3>)`
func (*ConcatLogSelectorExpr) String ¶
func (c *ConcatLogSelectorExpr) String() string
type ConcatSampleExpr ¶
type ConcatSampleExpr struct {
DownstreamSampleExpr
// contains filtered or unexported fields
}
ConcatSampleExpr is an expr for concatenating multiple SampleExpr Contract: The embedded SampleExprs within a linked list of ConcatSampleExprs must be of the same structure. This makes special implementations of SampleExpr.Associative() unnecessary.
func (*ConcatSampleExpr) Pretty ¶
func (c *ConcatSampleExpr) Pretty(level int) string
ConcatSampleExpr has no LogQL repretenstation. It is expressed in in the prettified version as e.g. `concat(downstream<count_over_time({foo="bar"}), shard=...> ++ )`
func (*ConcatSampleExpr) String ¶
func (c *ConcatSampleExpr) String() string
func (*ConcatSampleExpr) Walk ¶
func (c *ConcatSampleExpr) Walk(f syntax.WalkFn)
type ConcatStepEvaluator ¶
type ConcatStepEvaluator struct {
// contains filtered or unexported fields
}
func NewConcatStepEvaluator ¶
func NewConcatStepEvaluator(evaluators []StepEvaluator) *ConcatStepEvaluator
NewConcatStepEvaluator joins multiple StepEvaluators. Contract: They must be of identical start, end, and step values.
func (*ConcatStepEvaluator) Close ¶
func (e *ConcatStepEvaluator) Close() (lastErr error)
func (*ConcatStepEvaluator) Error ¶
func (e *ConcatStepEvaluator) Error() error
func (*ConcatStepEvaluator) Explain ¶
func (e *ConcatStepEvaluator) Explain(parent Node)
func (*ConcatStepEvaluator) Next ¶
func (e *ConcatStepEvaluator) Next() (bool, int64, StepResult)
type ConstantShards ¶
type ConstantShards int
func (ConstantShards) ShardingRanges ¶
func (s ConstantShards) ShardingRanges(_ syntax.Expr, _ uint64) ([]logproto.Shard, []logproto.ChunkRefGroup, error)
type CountDistinctSketchAccumulator ¶
type CountDistinctSketchAccumulator struct {
// contains filtered or unexported fields
}
func (*CountDistinctSketchAccumulator) Accumulate ¶
func (a *CountDistinctSketchAccumulator) Accumulate(_ context.Context, res logqlmodel.Result, _ int) error
func (*CountDistinctSketchAccumulator) Result ¶
func (a *CountDistinctSketchAccumulator) Result() []logqlmodel.Result
type CountDistinctSketchEvalExpr ¶
type CountDistinctSketchEvalExpr struct {
syntax.SampleExpr
// contains filtered or unexported fields
}
CountDistinctSketchEvalExpr merges sharded sketches then estimates.
func (*CountDistinctSketchEvalExpr) String ¶
func (e *CountDistinctSketchEvalExpr) String() string
func (*CountDistinctSketchEvalExpr) Walk ¶
func (e *CountDistinctSketchEvalExpr) Walk(f syntax.WalkFn)
type CountDistinctSketchMatrix ¶
type CountDistinctSketchMatrix []CountDistinctSketchVector
CountDistinctSketchMatrix is one CountDistinctSketchVector per evaluation step.
func CountDistinctSketchMatrixFromProto ¶
func CountDistinctSketchMatrixFromProto(proto *logproto.CountDistinctSketchMatrix) (CountDistinctSketchMatrix, error)
CountDistinctSketchMatrixFromProto deserializes a CountDistinctSketchMatrix.
func (CountDistinctSketchMatrix) Merge ¶
func (m CountDistinctSketchMatrix) Merge(right CountDistinctSketchMatrix) (CountDistinctSketchMatrix, error)
Merge unions each step's sketches. Lengths must match so the same evaluation time is never combined with another.
func (CountDistinctSketchMatrix) String ¶
func (CountDistinctSketchMatrix) String() string
func (CountDistinctSketchMatrix) ToProto ¶
func (m CountDistinctSketchMatrix) ToProto() (*logproto.CountDistinctSketchMatrix, error)
func (CountDistinctSketchMatrix) Type ¶
func (CountDistinctSketchMatrix) Type() promql_parser.ValueType
type CountDistinctSketchMatrixStepEvaluator ¶
type CountDistinctSketchMatrixStepEvaluator = SketchMatrixStepEvaluator[CountDistinctSketchVector]
CountDistinctSketchMatrixStepEvaluator steps through a matrix of count-distinct sketches.
func NewCountDistinctSketchMatrixStepEvaluator ¶
func NewCountDistinctSketchMatrixStepEvaluator(m CountDistinctSketchMatrix, params Params) *CountDistinctSketchMatrixStepEvaluator
type CountDistinctSketchMergeExpr ¶
type CountDistinctSketchMergeExpr struct {
syntax.SampleExpr
// contains filtered or unexported fields
}
CountDistinctSketchMergeExpr concatenates sharded CountDistinctSketchExpr children.
func (*CountDistinctSketchMergeExpr) String ¶
func (e *CountDistinctSketchMergeExpr) String() string
func (*CountDistinctSketchMergeExpr) Walk ¶
func (e *CountDistinctSketchMergeExpr) Walk(f syntax.WalkFn)
type CountDistinctSketchSample ¶
type CountDistinctSketchSample struct {
T int64
F *hyperloglog.Sketch
Metric labels.Labels
}
CountDistinctSketchSample is one HyperLogLog sketch keyed by metric labels.
func CountDistinctSketchSampleFromProto ¶
func CountDistinctSketchSampleFromProto(proto *logproto.CountDistinctSketchSample) (CountDistinctSketchSample, error)
CountDistinctSketchSampleFromProto deserializes one sketch sample.
func (CountDistinctSketchSample) ToProto ¶
func (s CountDistinctSketchSample) ToProto() (*logproto.CountDistinctSketchSample, error)
ToProto serializes one sketch sample.
type CountDistinctSketchVector ¶
type CountDistinctSketchVector []CountDistinctSketchSample
CountDistinctSketchVector is a list of HyperLogLog sketches keyed by metric labels.
func CountDistinctSketchVectorFromProto ¶
func CountDistinctSketchVectorFromProto(proto *logproto.CountDistinctSketchVector) (CountDistinctSketchVector, error)
CountDistinctSketchVectorFromProto deserializes a CountDistinctSketchVector.
func (CountDistinctSketchVector) CountDistinctSketchVec ¶
func (v CountDistinctSketchVector) CountDistinctSketchVec() CountDistinctSketchVector
func (CountDistinctSketchVector) CountMinSketchVec ¶
func (CountDistinctSketchVector) CountMinSketchVec() CountMinSketchVector
func (CountDistinctSketchVector) Estimate ¶
func (v CountDistinctSketchVector) Estimate() SampleVector
Estimate converts sketches into a numeric sample vector.
func (CountDistinctSketchVector) Merge ¶
func (v CountDistinctSketchVector) Merge(right CountDistinctSketchVector) (CountDistinctSketchVector, error)
Merge unions sketches that share exact grouping labels.
func (CountDistinctSketchVector) QuantileSketchVec ¶
func (CountDistinctSketchVector) QuantileSketchVec() ProbabilisticQuantileVector
func (CountDistinctSketchVector) SampleVector ¶
func (CountDistinctSketchVector) SampleVector() promql.Vector
func (CountDistinctSketchVector) String ¶
func (CountDistinctSketchVector) String() string
func (CountDistinctSketchVector) ToProto ¶
func (v CountDistinctSketchVector) ToProto() (*logproto.CountDistinctSketchVector, error)
ToProto serializes the vector for frontend/querier transport.
func (CountDistinctSketchVector) Type ¶
func (CountDistinctSketchVector) Type() promql_parser.ValueType
type CountDistinctSketchVectorStepEvaluator ¶
type CountDistinctSketchVectorStepEvaluator struct {
// contains filtered or unexported fields
}
CountDistinctSketchVectorStepEvaluator estimates one sketch vector per step.
func NewCountDistinctSketchVectorStepEvaluator ¶
func NewCountDistinctSketchVectorStepEvaluator(inner StepEvaluator) *CountDistinctSketchVectorStepEvaluator
func (*CountDistinctSketchVectorStepEvaluator) Close ¶
func (e *CountDistinctSketchVectorStepEvaluator) Close() error
func (*CountDistinctSketchVectorStepEvaluator) Error ¶
func (e *CountDistinctSketchVectorStepEvaluator) Error() error
func (*CountDistinctSketchVectorStepEvaluator) Explain ¶
func (e *CountDistinctSketchVectorStepEvaluator) Explain(parent Node)
func (*CountDistinctSketchVectorStepEvaluator) Next ¶
func (e *CountDistinctSketchVectorStepEvaluator) Next() (bool, int64, StepResult)
type CountMinSketchAccumulator ¶
type CountMinSketchAccumulator struct {
// contains filtered or unexported fields
}
func (*CountMinSketchAccumulator) Accumulate ¶
func (a *CountMinSketchAccumulator) Accumulate(_ context.Context, res logqlmodel.Result, _ int) error
func (*CountMinSketchAccumulator) Result ¶
func (a *CountMinSketchAccumulator) Result() []logqlmodel.Result
type CountMinSketchEvalExpr ¶
type CountMinSketchEvalExpr struct {
syntax.SampleExpr
// contains filtered or unexported fields
}
func (CountMinSketchEvalExpr) String ¶
func (e CountMinSketchEvalExpr) String() string
func (*CountMinSketchEvalExpr) Walk ¶
func (e *CountMinSketchEvalExpr) Walk(f syntax.WalkFn)
type CountMinSketchEvalStepEvaluator ¶
type CountMinSketchEvalStepEvaluator struct {
// contains filtered or unexported fields
}
CountMinSketchEvalStepEvaluator transforms a CountMinSketchEvalExpr into a CountMinSketchVector.
func NewCountMinSketchEvalStepEvaluator ¶
func NewCountMinSketchEvalStepEvaluator(ctx context.Context, nextEvFactory SampleEvaluatorFactory, expr *CountMinSketchEvalExpr, params Params) (*CountMinSketchEvalStepEvaluator, error)
func (*CountMinSketchEvalStepEvaluator) Close ¶
func (e *CountMinSketchEvalStepEvaluator) Close() error
func (*CountMinSketchEvalStepEvaluator) Error ¶
func (e *CountMinSketchEvalStepEvaluator) Error() error
func (*CountMinSketchEvalStepEvaluator) Explain ¶
func (e *CountMinSketchEvalStepEvaluator) Explain(_ Node)
func (*CountMinSketchEvalStepEvaluator) Next ¶
func (e *CountMinSketchEvalStepEvaluator) Next() (bool, int64, StepResult)
Next computes the single step of a CountMinSketchEvalExpr.
Only the first call computes it. Every later call returns false and does no work. Count min sketches only support instant queries, so there is only one step to compute.
type CountMinSketchVector ¶
type CountMinSketchVector struct {
T int64
F *sketch.CountMinSketch
Metrics []labels.Labels
}
CountMinSketchVector tracks the count or sum of values of a metric, ie list of label value pairs. It's storage for the values is upper bound bu delta and epsilon. To limit the storage for labels see HeapCountMinSketchVector. The main use case is for a topk approximation.
func CountMinSketchVectorFromProto ¶
func CountMinSketchVectorFromProto(p *logproto.CountMinSketchVector) (CountMinSketchVector, error)
func (CountMinSketchVector) CountDistinctSketchVec ¶
func (CountMinSketchVector) CountDistinctSketchVec() CountDistinctSketchVector
func (CountMinSketchVector) CountMinSketchVec ¶
func (v CountMinSketchVector) CountMinSketchVec() CountMinSketchVector
func (*CountMinSketchVector) Merge ¶
func (v *CountMinSketchVector) Merge(right *CountMinSketchVector) (*CountMinSketchVector, error)
func (CountMinSketchVector) QuantileSketchVec ¶
func (CountMinSketchVector) QuantileSketchVec() ProbabilisticQuantileVector
func (CountMinSketchVector) SampleVector ¶
func (CountMinSketchVector) SampleVector() promql.Vector
func (CountMinSketchVector) String ¶
func (CountMinSketchVector) String() string
func (CountMinSketchVector) ToProto ¶
func (v CountMinSketchVector) ToProto() (*logproto.CountMinSketchVector, error)
func (CountMinSketchVector) Type ¶
func (CountMinSketchVector) Type() promql_parser.ValueType
type CountMinSketchVectorStepEvaluator ¶
type CountMinSketchVectorStepEvaluator struct {
// contains filtered or unexported fields
}
CountMinSketchVectorStepEvaluator evaluates a count min sketch into a promql.Vector.
func NewCountMinSketchVectorStepEvaluator ¶
func NewCountMinSketchVectorStepEvaluator(vec *CountMinSketchVector) *CountMinSketchVectorStepEvaluator
func (*CountMinSketchVectorStepEvaluator) Close ¶
func (*CountMinSketchVectorStepEvaluator) Close() error
func (*CountMinSketchVectorStepEvaluator) Error ¶
func (*CountMinSketchVectorStepEvaluator) Error() error
func (*CountMinSketchVectorStepEvaluator) Explain ¶
func (e *CountMinSketchVectorStepEvaluator) Explain(parent Node)
func (*CountMinSketchVectorStepEvaluator) Next ¶
func (e *CountMinSketchVectorStepEvaluator) Next() (bool, int64, StepResult)
type CountOverTime ¶
type CountOverTime struct {
// contains filtered or unexported fields
}
type DefaultEvaluator ¶
type DefaultEvaluator struct {
// contains filtered or unexported fields
}
func NewDefaultEvaluator ¶
func NewDefaultEvaluator(querier Querier, maxLookBackPeriod time.Duration, maxCountMinSketchHeapSize int, limits Limits) *DefaultEvaluator
NewDefaultEvaluator constructs a DefaultEvaluator.
func (*DefaultEvaluator) NewIterator ¶
func (ev *DefaultEvaluator) NewIterator(ctx context.Context, expr syntax.LogSelectorExpr, q Params) (iter.EntryIterator, error)
func (*DefaultEvaluator) NewStepEvaluator ¶
func (ev *DefaultEvaluator) NewStepEvaluator( ctx context.Context, nextEvFactory SampleEvaluatorFactory, expr syntax.SampleExpr, q Params, isRootExpr bool, ) (StepEvaluator, error)
type DownstreamEngine ¶
type DownstreamEngine struct {
// contains filtered or unexported fields
}
DownstreamEngine is an Engine implementation that can split queries into more parallelizable forms via querying the underlying backend shards individually and re-aggregating them.
func NewDownstreamEngine ¶
func NewDownstreamEngine(opts EngineOpts, downstreamable Downstreamable, limits Limits, logger log.Logger) *DownstreamEngine
NewDownstreamEngine constructs a *DownstreamEngine
func (*DownstreamEngine) Opts ¶
func (ng *DownstreamEngine) Opts() EngineOpts
type DownstreamEvaluator ¶
type DownstreamEvaluator struct {
Downstreamer
// contains filtered or unexported fields
}
DownstreamEvaluator is an evaluator which handles shard aware AST nodes
func NewDownstreamEvaluator ¶
func NewDownstreamEvaluator(downstreamer Downstreamer) *DownstreamEvaluator
func (DownstreamEvaluator) Downstream ¶
func (ev DownstreamEvaluator) Downstream(ctx context.Context, queries []DownstreamQuery, acc Accumulator) ([]logqlmodel.Result, error)
Downstream runs queries and collects stats from the embedded Downstreamer
func (*DownstreamEvaluator) NewIterator ¶
func (ev *DownstreamEvaluator) NewIterator( ctx context.Context, expr syntax.LogSelectorExpr, params Params, ) (iter.EntryIterator, error)
NewIterator returns the iter.EntryIterator for a given LogSelectorExpr
func (*DownstreamEvaluator) NewStepEvaluator ¶
func (ev *DownstreamEvaluator) NewStepEvaluator( ctx context.Context, nextEvFactory SampleEvaluatorFactory, expr syntax.SampleExpr, params Params, isRootExpr bool, ) (StepEvaluator, error)
NewStepEvaluator returns a NewStepEvaluator for a given SampleExpr
type DownstreamLogSelectorExpr ¶
type DownstreamLogSelectorExpr struct {
syntax.LogSelectorExpr
// contains filtered or unexported fields
}
DownstreamLogSelectorExpr is a LogSelectorExpr which signals downstream computation
func (DownstreamLogSelectorExpr) Pretty ¶
func (d DownstreamLogSelectorExpr) Pretty(level int) string
The DownstreamLogSelectorExpr is not part of LogQL. In the prettified version it's represented as e.g. `downstream<{foo="bar"} |= "error", shard=1_of_3>`
func (DownstreamLogSelectorExpr) String ¶
func (d DownstreamLogSelectorExpr) String() string
type DownstreamQuery ¶
type DownstreamQuery struct {
Params Params
}
type DownstreamSampleExpr ¶
type DownstreamSampleExpr struct {
syntax.SampleExpr
// contains filtered or unexported fields
}
DownstreamSampleExpr is a SampleExpr which signals downstream computation
func (DownstreamSampleExpr) Pretty ¶
func (d DownstreamSampleExpr) Pretty(level int) string
The DownstreamSampleExpr is not part of LogQL. In the prettified version it's represented as e.g. `downstream<count_over_time({foo="bar"} |= "error"), shard=1_of_3>`
func (DownstreamSampleExpr) String ¶
func (d DownstreamSampleExpr) String() string
func (DownstreamSampleExpr) Walk ¶
func (d DownstreamSampleExpr) Walk(f syntax.WalkFn)
type Downstreamable ¶
type Downstreamable interface {
Downstreamer(context.Context) Downstreamer
}
type Downstreamer ¶
type Downstreamer interface {
Downstream(context.Context, []DownstreamQuery, Accumulator) ([]logqlmodel.Result, error)
}
Downstreamer is an interface for deferring responsibility for query execution. It is decoupled from but consumed by a downStreamEvaluator to dispatch ASTs.
type DynamicBoundsStrategy ¶
type DynamicBoundsStrategy struct {
// contains filtered or unexported fields
}
func NewDynamicBoundsStrategy ¶
func NewDynamicBoundsStrategy(resolver ShardResolver, targetBytesPerShard uint64) DynamicBoundsStrategy
func (DynamicBoundsStrategy) Resolver ¶
func (s DynamicBoundsStrategy) Resolver() ShardResolver
func (DynamicBoundsStrategy) Shards ¶
func (s DynamicBoundsStrategy) Shards(expr syntax.Expr) ([]ShardWithChunkRefs, uint64, error)
type EmptyEvaluator ¶
type EmptyEvaluator[R StepResult] struct { // contains filtered or unexported fields }
func (EmptyEvaluator[_]) Close ¶
func (EmptyEvaluator[_]) Close() error
Close implements StepEvaluator.
func (EmptyEvaluator[_]) Error ¶
func (EmptyEvaluator[_]) Error() error
Error implements StepEvaluator.
func (EmptyEvaluator[SampleVector]) Explain ¶
func (EmptyEvaluator[SampleVector]) Explain(parent Node)
func (EmptyEvaluator[_]) Next ¶
func (e EmptyEvaluator[_]) Next() (ok bool, ts int64, r StepResult)
Next implements StepEvaluator.
type EngineOpts ¶
type EngineOpts struct {
// MaxLookBackPeriod is the maximum amount of time to look back for log lines.
// only used for instant log queries.
MaxLookBackPeriod time.Duration `yaml:"max_look_back_period"`
// LogExecutingQuery will control if we log the query when Exec is called.
LogExecutingQuery bool `yaml:"-"`
// MaxCountMinSketchHeapSize is the maximum number of labels the heap for a topk query using a count min sketch
// can track. This impacts the memory usage and accuracy of a sharded probabilistic topk query.
MaxCountMinSketchHeapSize int `yaml:"max_count_min_sketch_heap_size"`
}
EngineOpts is the list of options to use with the LogQL query engine.
func (*EngineOpts) RegisterFlags ¶
func (opts *EngineOpts) RegisterFlags(f *flag.FlagSet)
func (*EngineOpts) RegisterFlagsWithPrefix ¶
func (opts *EngineOpts) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet)
type EntryEvaluatorFactory ¶
type EntryEvaluatorFactory interface {
// NewIterator returns the iter.EntryIterator for a given LogSelectorExpr
NewIterator(context.Context, syntax.LogSelectorExpr, Params) (iter.EntryIterator, error)
}
type EvaluatorFactory ¶
type EvaluatorFactory interface {
SampleEvaluatorFactory
EntryEvaluatorFactory
}
EvaluatorFactory is an interface for iterating over data at different nodes in the AST
type FirstOverTime ¶
type FirstOverTime struct {
// contains filtered or unexported fields
}
type HeapCountMinSketchVector ¶
type HeapCountMinSketchVector struct {
CountMinSketchVector
// contains filtered or unexported fields
}
HeapCountMinSketchVector is a CountMinSketchVector that keeps the number of metrics to a defined maximum.
func NewHeapCountMinSketchVector ¶
func NewHeapCountMinSketchVector(ts int64, metricsLength, maxLabels int) HeapCountMinSketchVector
func (*HeapCountMinSketchVector) Add ¶
func (v *HeapCountMinSketchVector) Add(metric labels.Labels, value float64)
func (HeapCountMinSketchVector) Len ¶
func (v HeapCountMinSketchVector) Len() int
func (HeapCountMinSketchVector) Less ¶
func (v HeapCountMinSketchVector) Less(i, j int) bool
func (*HeapCountMinSketchVector) Pop ¶
func (v *HeapCountMinSketchVector) Pop() any
func (*HeapCountMinSketchVector) Push ¶
func (v *HeapCountMinSketchVector) Push(x any)
func (HeapCountMinSketchVector) Swap ¶
func (v HeapCountMinSketchVector) Swap(i, j int)
type LabelReplaceEvaluator ¶
type LabelReplaceEvaluator struct {
// contains filtered or unexported fields
}
func (*LabelReplaceEvaluator) Close ¶
func (e *LabelReplaceEvaluator) Close() error
func (*LabelReplaceEvaluator) Error ¶
func (e *LabelReplaceEvaluator) Error() error
func (*LabelReplaceEvaluator) Explain ¶
func (e *LabelReplaceEvaluator) Explain(parent Node)
func (*LabelReplaceEvaluator) Next ¶
func (e *LabelReplaceEvaluator) Next() (bool, int64, StepResult)
type LastOverTime ¶
type LastOverTime struct {
// contains filtered or unexported fields
}
type Limits ¶
type Limits interface {
MaxQuerySeries(userID string) int
MaxQueryRange(ctx context.Context, userID string) time.Duration
QueryTimeout(context.Context, string) time.Duration
BlockedQueries(context.Context, string) []*validation.BlockedQuery
// StreamFirstExecutionEnabled reports whether eligible metric queries of the tenant run in
// stream-first sample order.
StreamFirstExecutionEnabled(userID string) bool
}
Limits allow the engine to fetch limits for a given users.
type LiteralParams ¶
type LiteralParams struct {
// contains filtered or unexported fields
}
LiteralParams impls Params
func NewLiteralParams ¶
func NewLiteralParamsWithCaching ¶
func NewLiteralParamsWithCaching( qs string, start, end time.Time, step, interval time.Duration, direction logproto.Direction, limit uint32, shards []string, storeChunks *logproto.ChunkRefGroup, cachingOptions resultscache.CachingOptions, ) (LiteralParams, error)
func (LiteralParams) CachingOptions ¶
func (p LiteralParams) CachingOptions() resultscache.CachingOptions
CachingOptions returns whether Loki query created from this params should be cached.
func (LiteralParams) Copy ¶
func (p LiteralParams) Copy() LiteralParams
func (LiteralParams) Direction ¶
func (p LiteralParams) Direction() logproto.Direction
Direction impls Params
func (LiteralParams) GetDataObjOptions ¶
func (p LiteralParams) GetDataObjOptions() *logproto.DataObjOptions
GetDataObjOptions implements Params.
func (LiteralParams) GetExpression ¶
func (p LiteralParams) GetExpression() syntax.Expr
GetExpression impls Params
func (LiteralParams) GetHintRanges ¶
func (p LiteralParams) GetHintRanges() []logproto.HintTimeRange
GetHintRanges implements Params.
func (LiteralParams) GetStoreChunks ¶
func (p LiteralParams) GetStoreChunks() *logproto.ChunkRefGroup
StoreChunks impls Params
func (LiteralParams) Interval ¶
func (p LiteralParams) Interval() time.Duration
Interval impls Params
func (LiteralParams) WithDataObjOptions ¶
func (p LiteralParams) WithDataObjOptions(options *logproto.DataObjOptions) LiteralParams
WithDataObjOptions returns a copy of the params with the given data-object options.
type LiteralStepEvaluator ¶
type LiteralStepEvaluator struct {
// contains filtered or unexported fields
}
func (*LiteralStepEvaluator) Close ¶
func (e *LiteralStepEvaluator) Close() error
func (*LiteralStepEvaluator) Error ¶
func (e *LiteralStepEvaluator) Error() error
func (*LiteralStepEvaluator) Explain ¶
func (e *LiteralStepEvaluator) Explain(parent Node)
func (*LiteralStepEvaluator) Next ¶
func (e *LiteralStepEvaluator) Next() (bool, int64, StepResult)
type MapperMetrics ¶
type MapperMetrics struct {
DownstreamQueries *prometheus.CounterVec // downstream queries total, partitioned by streams/metrics
ParsedQueries *prometheus.CounterVec // parsed ASTs total, partitioned by success/failure/noop
DownstreamFactor prometheus.Histogram // per request downstream factor
}
MapperMetrics is the metrics wrapper used in logql mapping (shard and range)
func NewRangeMapperMetrics ¶
func NewRangeMapperMetrics(registerer prometheus.Registerer) *MapperMetrics
func NewShardMapperMetrics ¶
func NewShardMapperMetrics(registerer prometheus.Registerer) *MapperMetrics
type MapperStats ¶
type MapperStats struct {
// contains filtered or unexported fields
}
func NewMapperStats ¶
func NewMapperStats() *MapperStats
func (*MapperStats) AddSplitQueries ¶
func (s *MapperStats) AddSplitQueries(num int)
AddSplitQueries add num split queries to the counter
func (*MapperStats) GetSplitQueries ¶
func (s *MapperStats) GetSplitQueries() int
GetSplitQueries returns the number of split queries
type MatrixStepEvaluator ¶
type MatrixStepEvaluator struct {
// contains filtered or unexported fields
}
MatrixStepEvaluator exposes a promql.Matrix as a StepEvaluator. Ensure that the resulting StepEvaluator maintains the same shape that the parameters expect. For example, it's possible that a downstream query returns matches no log streams and thus returns an empty matrix. However, we still need to ensure that it can be merged effectively with another leg that may match series. Therefore, we determine our steps from the parameters and not the underlying Matrix.
func NewMatrixStepEvaluator ¶
func (*MatrixStepEvaluator) Close ¶
func (m *MatrixStepEvaluator) Close() error
func (*MatrixStepEvaluator) Error ¶
func (m *MatrixStepEvaluator) Error() error
func (*MatrixStepEvaluator) Explain ¶
func (m *MatrixStepEvaluator) Explain(parent Node)
func (*MatrixStepEvaluator) Next ¶
func (m *MatrixStepEvaluator) Next() (bool, int64, StepResult)
type MaxOverTime ¶
type MaxOverTime struct {
// contains filtered or unexported fields
}
type MergeFirstOverTimeExpr ¶
type MergeFirstOverTimeExpr struct {
syntax.SampleExpr
// contains filtered or unexported fields
}
func (MergeFirstOverTimeExpr) String ¶
func (e MergeFirstOverTimeExpr) String() string
func (*MergeFirstOverTimeExpr) Walk ¶
func (e *MergeFirstOverTimeExpr) Walk(f syntax.WalkFn)
type MergeLastOverTimeExpr ¶
type MergeLastOverTimeExpr struct {
syntax.SampleExpr
// contains filtered or unexported fields
}
func (MergeLastOverTimeExpr) String ¶
func (e MergeLastOverTimeExpr) String() string
func (*MergeLastOverTimeExpr) Walk ¶
func (e *MergeLastOverTimeExpr) Walk(f syntax.WalkFn)
type MinOverTime ¶
type MinOverTime struct {
// contains filtered or unexported fields
}
type MockDownstreamer ¶
type MockDownstreamer struct {
*QueryEngine
}
func (MockDownstreamer) Downstream ¶
func (m MockDownstreamer) Downstream(ctx context.Context, queries []DownstreamQuery, acc Accumulator) ([]logqlmodel.Result, error)
func (MockDownstreamer) Downstreamer ¶
func (m MockDownstreamer) Downstreamer(_ context.Context) Downstreamer
type MockQuerier ¶
type MockQuerier struct {
// contains filtered or unexported fields
}
Shard aware mock querier
func NewMockQuerier ¶
func NewMockQuerier(shards int, streams []logproto.Stream) MockQuerier
func (MockQuerier) SelectLogs ¶
func (q MockQuerier) SelectLogs(_ context.Context, req SelectLogParams) (iter.EntryIterator, error)
func (MockQuerier) SelectSamples ¶
func (q MockQuerier) SelectSamples(_ context.Context, req SelectSampleParams) (iter.SampleIterator, error)
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node is a handle associated with a specific depth in a tree. See below for sample usage.
func NewTree ¶
func NewTree() Node
NewTree creates a tree printer and returns a sentinel node reference which should be used to add the root. Sample usage:
tp := NewTree()
root := n.Child("root")
root.Child("child-1")
root.Child("child-2").Child("grandchild\ngrandchild-more-info")
root.Child("child-3")
fmt.Print(tp.String())
Output:
root ├── child-1 ├── child-2 │ └── grandchild │ grandchild-more-info └── child-3
Note that the Child calls can't be rearranged arbitrarily; they have to be in the order they need to be displayed (depth-first pre-order).
func (Node) AddEmptyLine ¶
func (n Node) AddEmptyLine()
AddEmptyLine adds an empty line to the output; used to introduce vertical spacing as needed.
func (Node) Child ¶
Child adds a node as a child of the given node. Multi-line strings are supported with appropriate indentation.
func (Node) FormattedRows ¶
FormattedRows returns the formatted rows. Can only be called on the result of treeprinter.New.
type OneOverTime ¶
type OneOverTime struct {
}
type Params ¶
type Params interface {
QueryString() string
Start() time.Time
End() time.Time
Step() time.Duration
Interval() time.Duration
Limit() uint32
Direction() logproto.Direction
Shards() []string
GetExpression() syntax.Expr
GetStoreChunks() *logproto.ChunkRefGroup
GetHintRanges() []logproto.HintTimeRange
GetDataObjOptions() *logproto.DataObjOptions
CachingOptions() resultscache.CachingOptions
}
Params details the parameters associated with a loki request
func ParamOverridesFromShard ¶
func ParamOverridesFromShard(base Params, shard *ShardWithChunkRefs) (result Params)
type ParamsWithChunkOverrides ¶
type ParamsWithChunkOverrides struct {
Params
StoreChunksOverride *logproto.ChunkRefGroup
}
func (ParamsWithChunkOverrides) GetStoreChunks ¶
func (p ParamsWithChunkOverrides) GetStoreChunks() *logproto.ChunkRefGroup
type ParamsWithExpressionOverride ¶
ParamsWithExpressionOverride overrides the query expression so that the query string and the expression can differ. This is useful for query planning when plan my not match externally available logql syntax
func (ParamsWithExpressionOverride) GetExpression ¶
func (p ParamsWithExpressionOverride) GetExpression() syntax.Expr
GetExpression returns the parsed expression of the query.
type ParamsWithShardsOverride ¶
ParamsWithExpressionOverride overrides the shards. Since the backing implementation of the Params interface is unknown they are embedded and the original shards are shadowed.
func (ParamsWithShardsOverride) Shards ¶
func (p ParamsWithShardsOverride) Shards() []string
Shards returns this overwriting shards.
type PowerOfTwoStrategy ¶
type PowerOfTwoStrategy struct {
// contains filtered or unexported fields
}
func NewPowerOfTwoStrategy ¶
func NewPowerOfTwoStrategy(resolver ShardResolver) PowerOfTwoStrategy
func (PowerOfTwoStrategy) Resolver ¶
func (s PowerOfTwoStrategy) Resolver() ShardResolver
func (PowerOfTwoStrategy) Shards ¶
func (s PowerOfTwoStrategy) Shards(expr syntax.Expr) ([]ShardWithChunkRefs, uint64, error)
PowerOfTwo strategy does not support precomputed chunk refs
type ProbabilisticQuantileMatrix ¶
type ProbabilisticQuantileMatrix []ProbabilisticQuantileVector
func ProbabilisticQuantileMatrixFromProto ¶
func ProbabilisticQuantileMatrixFromProto(proto *logproto.QuantileSketchMatrix) (ProbabilisticQuantileMatrix, error)
func (ProbabilisticQuantileMatrix) Merge ¶
func (m ProbabilisticQuantileMatrix) Merge(right ProbabilisticQuantileMatrix) (ProbabilisticQuantileMatrix, error)
func (ProbabilisticQuantileMatrix) Release ¶
func (m ProbabilisticQuantileMatrix) Release()
func (ProbabilisticQuantileMatrix) String ¶
func (ProbabilisticQuantileMatrix) String() string
func (ProbabilisticQuantileMatrix) ToProto ¶
func (m ProbabilisticQuantileMatrix) ToProto() *logproto.QuantileSketchMatrix
func (ProbabilisticQuantileMatrix) Type ¶
func (ProbabilisticQuantileMatrix) Type() promql_parser.ValueType
type ProbabilisticQuantileSample ¶
type ProbabilisticQuantileSample struct {
T int64
F sketch.QuantileSketch
Metric labels.Labels
}
func (ProbabilisticQuantileSample) ToProto ¶
func (q ProbabilisticQuantileSample) ToProto() *logproto.QuantileSketchSample
type ProbabilisticQuantileVector ¶
type ProbabilisticQuantileVector []ProbabilisticQuantileSample
func ProbabilisticQuantileVectorFromProto ¶
func ProbabilisticQuantileVectorFromProto(proto *logproto.QuantileSketchVector) (ProbabilisticQuantileVector, error)
func (ProbabilisticQuantileVector) CountDistinctSketchVec ¶
func (ProbabilisticQuantileVector) CountDistinctSketchVec() CountDistinctSketchVector
func (ProbabilisticQuantileVector) CountMinSketchVec ¶
func (ProbabilisticQuantileVector) CountMinSketchVec() CountMinSketchVector
func (ProbabilisticQuantileVector) Merge ¶
func (q ProbabilisticQuantileVector) Merge(right ProbabilisticQuantileVector) (ProbabilisticQuantileVector, error)
func (ProbabilisticQuantileVector) QuantileSketchVec ¶
func (q ProbabilisticQuantileVector) QuantileSketchVec() ProbabilisticQuantileVector
func (ProbabilisticQuantileVector) Release ¶
func (q ProbabilisticQuantileVector) Release()
func (ProbabilisticQuantileVector) SampleVector ¶
func (ProbabilisticQuantileVector) SampleVector() promql.Vector
func (ProbabilisticQuantileVector) ToProto ¶
func (q ProbabilisticQuantileVector) ToProto() *logproto.QuantileSketchVector
type QuantileOverTime ¶
type QuantileOverTime struct {
// contains filtered or unexported fields
}
type QuantileSketchAccumulator ¶
type QuantileSketchAccumulator struct {
// contains filtered or unexported fields
}
func (*QuantileSketchAccumulator) Accumulate ¶
func (a *QuantileSketchAccumulator) Accumulate(_ context.Context, res logqlmodel.Result, _ int) error
func (*QuantileSketchAccumulator) Result ¶
func (a *QuantileSketchAccumulator) Result() []logqlmodel.Result
type QuantileSketchEvalExpr ¶
type QuantileSketchEvalExpr struct {
syntax.SampleExpr
// contains filtered or unexported fields
}
QuantileSketchEvalExpr evaluates a quantile sketch to the actual quantile.
func (QuantileSketchEvalExpr) String ¶
func (e QuantileSketchEvalExpr) String() string
func (*QuantileSketchEvalExpr) Walk ¶
func (e *QuantileSketchEvalExpr) Walk(f syntax.WalkFn)
type QuantileSketchMatrixStepEvaluator ¶
type QuantileSketchMatrixStepEvaluator = SketchMatrixStepEvaluator[ProbabilisticQuantileVector]
QuantileSketchMatrixStepEvaluator steps through a matrix of quantile sketch vectors, ie t-digest or DDSketch structures per time step.
func NewQuantileSketchMatrixStepEvaluator ¶
func NewQuantileSketchMatrixStepEvaluator(m ProbabilisticQuantileMatrix, params Params) *QuantileSketchMatrixStepEvaluator
type QuantileSketchMergeExpr ¶
type QuantileSketchMergeExpr struct {
syntax.SampleExpr
// contains filtered or unexported fields
}
func (QuantileSketchMergeExpr) String ¶
func (e QuantileSketchMergeExpr) String() string
func (*QuantileSketchMergeExpr) Walk ¶
func (e *QuantileSketchMergeExpr) Walk(f syntax.WalkFn)
type QuantileSketchStepEvaluator ¶
type QuantileSketchStepEvaluator struct {
// contains filtered or unexported fields
}
func (*QuantileSketchStepEvaluator) Close ¶
func (e *QuantileSketchStepEvaluator) Close() error
func (*QuantileSketchStepEvaluator) Error ¶
func (e *QuantileSketchStepEvaluator) Error() error
func (*QuantileSketchStepEvaluator) Explain ¶
func (e *QuantileSketchStepEvaluator) Explain(parent Node)
func (*QuantileSketchStepEvaluator) Next ¶
func (e *QuantileSketchStepEvaluator) Next() (bool, int64, StepResult)
type QuantileSketchVectorStepEvaluator ¶
type QuantileSketchVectorStepEvaluator struct {
// contains filtered or unexported fields
}
QuantileSketchVectorStepEvaluator evaluates a quantile sketch into a promql.Vector.
func NewQuantileSketchVectorStepEvaluator ¶
func NewQuantileSketchVectorStepEvaluator(inner StepEvaluator, quantile float64) *QuantileSketchVectorStepEvaluator
func (*QuantileSketchVectorStepEvaluator) Close ¶
func (e *QuantileSketchVectorStepEvaluator) Close() error
func (*QuantileSketchVectorStepEvaluator) Error ¶
func (e *QuantileSketchVectorStepEvaluator) Error() error
func (*QuantileSketchVectorStepEvaluator) Explain ¶
func (e *QuantileSketchVectorStepEvaluator) Explain(parent Node)
func (*QuantileSketchVectorStepEvaluator) Next ¶
func (e *QuantileSketchVectorStepEvaluator) Next() (bool, int64, StepResult)
type Querier ¶
type Querier interface {
SelectLogs(context.Context, SelectLogParams) (iter.EntryIterator, error)
SelectSamples(context.Context, SelectSampleParams) (iter.SampleIterator, error)
}
Querier allows a LogQL expression to fetch an EntryIterator for a set of matchers and filters
type Query ¶
type Query interface {
// Exec processes the query.
Exec(ctx context.Context) (logqlmodel.Result, error)
}
Query is a LogQL query to be executed.
type QueryEngine ¶
type QueryEngine struct {
// contains filtered or unexported fields
}
QueryEngine is the LogQL engine.
func NewEngine ¶
func NewEngine(opts EngineOpts, q Querier, l Limits, logger log.Logger) *QueryEngine
NewEngine creates a new LogQL QueryEngine.
func (*QueryEngine) Query ¶
func (qe *QueryEngine) Query(params Params) Query
Query creates a new LogQL query. Instant/Range type is derived from the parameters.
type QueryParams ¶
type QueryRangeType ¶
type QueryRangeType string
var ( InstantType QueryRangeType = "instant" RangeType QueryRangeType = "range" )
func GetRangeType ¶
func GetRangeType(q Params) QueryRangeType
GetRangeType returns whether a query is an instant query or range query
type RangeMapper ¶
type RangeMapper struct {
// contains filtered or unexported fields
}
RangeMapper is used to rewrite LogQL sample expressions into multiple downstream sample expressions with a smaller time range that can be executed using the downstream engine.
A rewrite is performed using the following rules:
- Check if query is splittable based on the range.
- Check if the query is splittable based on the query AST
- Range aggregations are split into multiple downstream range aggregation expressions that are concatenated with an appropriate vector aggregator with a grouping operator. If the range aggregation has a grouping, the grouping is also applied to the resultant vector aggregator expression. If the range aggregation has no grouping, a grouping operator using "without" is applied to the resultant vector aggregator expression to preserve the stream labels.
- Vector aggregations are split into multiple downstream vector aggregations that are merged with vector aggregation using "without" and then aggregated using the vector aggregation with the same operator, either with or without grouping.
- Left and right-hand side of binary operations are split individually using the same rules as above.
func NewRangeMapper ¶
func NewRangeMapper(interval time.Duration, metrics *MapperMetrics, stats *MapperStats) (RangeMapper, error)
NewRangeMapper creates a new RangeMapper instance with the given duration as split interval. The interval must be greater than 0.
func NewRangeMapperWithSplitAlign ¶
func NewRangeMapperWithSplitAlign(interval time.Duration, splitAlign time.Time, metrics *MapperMetrics, stats *MapperStats) (RangeMapper, error)
NewRangeMapperWithSplitAlign is similar to `NewRangeMapper` except it accepts additional `splitAlign` argument and used to align the subqueries generated according to that. Look at `rangeSplitAlign` method for more information.
func (RangeMapper) Map ¶
func (m RangeMapper) Map(expr syntax.SampleExpr, vectorAggrPushdown *syntax.VectorAggregationExpr, recorder *downstreamRecorder) (syntax.SampleExpr, error)
Map rewrites sample expression expr and returns the resultant sample expression to be executed by the downstream engine It is called recursively on the expression tree. The function takes an optional vector aggregation as second argument, that is pushed down to the downstream expression.
func (RangeMapper) Parse ¶
Parse parses the given LogQL query string into a sample expression and applies the rewrite rules for splitting it into a sample expression that can be executed by the downstream engine. It returns a boolean indicating whether a rewrite was possible, the rewritten sample expression, and an error in case the rewrite failed.
type RangeStreamingAgg ¶
type RangeStreamingAgg interface {
// contains filtered or unexported methods
}
RangeStreamingAgg streaming aggregates sample for each sample
type RangeVectorEvaluator ¶
type RangeVectorEvaluator struct {
// contains filtered or unexported fields
}
func (*RangeVectorEvaluator) Close ¶
func (r *RangeVectorEvaluator) Close() error
func (*RangeVectorEvaluator) Error ¶
func (r *RangeVectorEvaluator) Error() error
func (*RangeVectorEvaluator) Explain ¶
func (r *RangeVectorEvaluator) Explain(parent Node)
func (*RangeVectorEvaluator) Next ¶
func (r *RangeVectorEvaluator) Next() (bool, int64, StepResult)
type RangeVectorIterator ¶
type RangeVectorIterator interface {
Next() bool
At() (int64, StepResult)
Close() error
Error() error
}
RangeVectorIterator iterates through a range of samples. To fetch the current vector use `At` with a `BatchRangeVectorAggregator` or `RangeStreamingAgg`.
type RateCounterOverTime ¶
type RateCounterOverTime struct {
// contains filtered or unexported fields
}
rateCounter calculates the per-second rate of values extracted from log lines and treat them like a "counter" metric.
type RateLogBytesOverTime ¶
type RateLogBytesOverTime struct {
// contains filtered or unexported fields
}
RateLogBytesOverTime calculates the per-second rate of log bytes.
type RateLogsOverTime ¶
type RateLogsOverTime struct {
// contains filtered or unexported fields
}
RateLogsOverTime calculates the per-second rate of log lines or values extracted from log lines.
type SampleEvaluatorFactory ¶
type SampleEvaluatorFactory interface {
// NewStepEvaluator returns a NewStepEvaluator for a given SampleExpr. It's explicitly passed another NewStepEvaluator// in order to enable arbitrary computation of embedded expressions. This allows more modular & extensible
// NewStepEvaluator implementations which can be composed.
//
// isRootExpr is true only for the root expression of the query, whose output is the query
// result.
NewStepEvaluator(ctx context.Context, nextEvaluatorFactory SampleEvaluatorFactory, expr syntax.SampleExpr, p Params, isRootExpr bool) (StepEvaluator, error)
}
type SampleEvaluatorFunc ¶
type SampleEvaluatorFunc func(ctx context.Context, nextEvaluatorFactory SampleEvaluatorFactory, expr syntax.SampleExpr, p Params, isRootExpr bool) (StepEvaluator, error)
func (SampleEvaluatorFunc) NewStepEvaluator ¶
func (s SampleEvaluatorFunc) NewStepEvaluator(ctx context.Context, nextEvaluatorFactory SampleEvaluatorFactory, expr syntax.SampleExpr, p Params, isRootExpr bool) (StepEvaluator, error)
type SampleVector ¶
func (SampleVector) CountDistinctSketchVec ¶
func (SampleVector) CountDistinctSketchVec() CountDistinctSketchVector
func (SampleVector) CountMinSketchVec ¶
func (SampleVector) CountMinSketchVec() CountMinSketchVector
func (SampleVector) QuantileSketchVec ¶
func (p SampleVector) QuantileSketchVec() ProbabilisticQuantileVector
func (SampleVector) SampleVector ¶
func (p SampleVector) SampleVector() promql.Vector
type SelectLogParams ¶
type SelectLogParams struct {
*logproto.QueryRequest
}
SelectParams specifies parameters passed to data selections.
func (SelectLogParams) LogSelector ¶
func (s SelectLogParams) LogSelector() (syntax.LogSelectorExpr, error)
LogSelector returns the LogSelectorExpr from the SelectParams. The `LogSelectorExpr` can then returns all matchers and filters to use for that request.
func (SelectLogParams) String ¶
func (s SelectLogParams) String() string
func (SelectLogParams) WithStoreChunks ¶
func (s SelectLogParams) WithStoreChunks(chunkRefGroup *logproto.ChunkRefGroup) SelectLogParams
func (SelectLogParams) WithTimeRange ¶
func (s SelectLogParams) WithTimeRange(start, end time.Time) SelectLogParams
WithTimeRange returns a copy of s covering the given time range. The copy owns its request, so the time range of s does not change.
type SelectSampleParams ¶
type SelectSampleParams struct {
*logproto.SampleQueryRequest
}
func (SelectSampleParams) Expr ¶
func (s SelectSampleParams) Expr() (syntax.SampleExpr, error)
Expr returns the SampleExpr from the SelectSampleParams. The `LogSelectorExpr` can then returns all matchers and filters to use for that request.
func (SelectSampleParams) LogSelector ¶
func (s SelectSampleParams) LogSelector() (syntax.LogSelectorExpr, error)
LogSelector returns the LogSelectorExpr from the SelectParams. The `LogSelectorExpr` can then returns all matchers and filters to use for that request.
func (SelectSampleParams) WithStoreChunks ¶
func (s SelectSampleParams) WithStoreChunks(chunkRefGroup *logproto.ChunkRefGroup) SelectSampleParams
func (SelectSampleParams) WithTimeRange ¶
func (s SelectSampleParams) WithTimeRange(start, end time.Time) SelectSampleParams
WithTimeRange returns a copy of s covering the given time range. The copy owns its request, so the time range of s does not change.
type Shard ¶
type Shard struct {
PowerOfTwo *index.ShardAnnotation
Bounded *logproto.Shard
}
Shard represents a shard annotation It holds either a power of two shard (legacy) or a bounded shard
func NewBoundedShard ¶
func NewPowerOfTwoShard ¶
func NewPowerOfTwoShard(shard index.ShardAnnotation) Shard
func (Shard) Bind ¶
func (s Shard) Bind(chunks *logproto.ChunkRefGroup) *ShardWithChunkRefs
func (*Shard) GetFromThrough ¶
func (s *Shard) GetFromThrough() (model.Fingerprint, model.Fingerprint)
func (Shard) Ptr ¶
convenience method for unaddressability concerns using constructors in literals (tests)
func (*Shard) Variant ¶
func (s *Shard) Variant() ShardVersion
type ShardMapper ¶
type ShardMapper struct {
// contains filtered or unexported fields
}
func NewShardMapper ¶
func NewShardMapper(strategy ShardingStrategy, metrics *MapperMetrics, shardAggregation []string) ShardMapper
type ShardResolver ¶
type ShardResolver interface {
Shards(expr syntax.Expr) (int, uint64, error)
// ShardingRanges returns shards and optionally a set of precomputed chunk refs for each group. If present,
// they will be used in lieu of resolving chunk refs from the index durin evaluation.
// If chunks are present, the number of shards returned must match the number of chunk ref groups.
ShardingRanges(expr syntax.Expr, targetBytesPerShard uint64) ([]logproto.Shard, []logproto.ChunkRefGroup, error)
GetStats(e syntax.Expr) (stats.Stats, error)
}
type ShardVersion ¶
type ShardVersion uint8
const ( PowerOfTwoVersion ShardVersion = iota BoundedVersion )
TODO(owen-d): refactor this file. There's too many layers (sharding strategies, sharding resolvers). Eventually we should have a single strategy (bounded) and a single resolver (dynamic). It's likely this could be refactored anyway -- I was in a rush writing it the first time around.
func ParseShardVersion ¶
func ParseShardVersion(s string) (ShardVersion, error)
func (ShardVersion) Strategy ¶
func (v ShardVersion) Strategy(resolver ShardResolver, defaultTargetShardBytes uint64) ShardingStrategy
func (ShardVersion) String ¶
func (v ShardVersion) String() string
type ShardWithChunkRefs ¶
type ShardWithChunkRefs struct {
Shard
// contains filtered or unexported fields
}
ShardWithChunkRefs is a convenience type for passing around shards with associated chunk refs. The chunk refs are optional as determined by their contents (zero chunks means no precomputed refs) and are used to precompute chunk refs for each group
type ShardingStrategy ¶
type ShardingStrategy interface {
// The chunks for each shard are optional and are used to precompute chunk refs for each group
Shards(expr syntax.Expr) (shards []ShardWithChunkRefs, maxBytesPerShard uint64, err error)
Resolver() ShardResolver
}
type SketchMatrixStepEvaluator ¶
type SketchMatrixStepEvaluator[V StepResult] struct { // contains filtered or unexported fields }
SketchMatrixStepEvaluator steps through a matrix of sketch vectors, one evaluation timestamp at a time. Quantile and count-distinct sketches share this stepper and differ only in the vector type stored in the matrix.
func (*SketchMatrixStepEvaluator[_]) Close ¶
func (*SketchMatrixStepEvaluator[_]) Close() error
func (*SketchMatrixStepEvaluator[_]) Error ¶
func (*SketchMatrixStepEvaluator[_]) Error() error
func (*SketchMatrixStepEvaluator[_]) Explain ¶
func (m *SketchMatrixStepEvaluator[_]) Explain(parent Node)
func (*SketchMatrixStepEvaluator[V]) Next ¶
func (m *SketchMatrixStepEvaluator[V]) Next() (bool, int64, StepResult)
type StddevOverTime ¶
type StddevOverTime struct {
// contains filtered or unexported fields
}
type StdvarOverTime ¶
type StdvarOverTime struct {
// contains filtered or unexported fields
}
type StepEvaluator ¶
type StepEvaluator interface {
// while Next returns a promql.Value, the only acceptable types are Scalar and Vector.
Next() (ok bool, ts int64, r StepResult)
// Close all resources used.
Close() error
// Reports any error
Error() error
// Explain returns a print of the step evaluation tree
Explain(Node)
}
StepEvaluator evaluate a single step of a query.
func NewResultStepEvaluator ¶
func NewResultStepEvaluator(res logqlmodel.Result, params Params) (StepEvaluator, error)
NewResultStepEvaluator coerces a downstream vector or matrix into a StepEvaluator
type StepResult ¶
type StepResult interface {
SampleVector() promql.Vector
QuantileSketchVec() ProbabilisticQuantileVector
CountMinSketchVec() CountMinSketchVector
CountDistinctSketchVec() CountDistinctSketchVector
}
type SumOverTime ¶
type SumOverTime struct {
// contains filtered or unexported fields
}
SumOverTime is the streaming counterpart of sumOverTime: it keeps a Kahan-compensated running sum, one sample at a time.
type VectorAggEvaluator ¶
type VectorAggEvaluator struct {
// contains filtered or unexported fields
}
func (*VectorAggEvaluator) Close ¶
func (e *VectorAggEvaluator) Close() error
func (*VectorAggEvaluator) Error ¶
func (e *VectorAggEvaluator) Error() error
func (*VectorAggEvaluator) Explain ¶
func (e *VectorAggEvaluator) Explain(parent Node)
func (*VectorAggEvaluator) Next ¶
func (e *VectorAggEvaluator) Next() (bool, int64, StepResult)
type VectorIterator ¶
type VectorIterator struct {
// contains filtered or unexported fields
}
VectorIterator return simple vector like (1).
func (*VectorIterator) Close ¶
func (r *VectorIterator) Close() error
func (*VectorIterator) Error ¶
func (r *VectorIterator) Error() error
func (*VectorIterator) Explain ¶
func (i *VectorIterator) Explain(parent Node)
func (*VectorIterator) Next ¶
func (r *VectorIterator) Next() (bool, int64, StepResult)
type VectorStepEvaluator ¶
type VectorStepEvaluator struct {
// contains filtered or unexported fields
}
func NewVectorStepEvaluator ¶
func NewVectorStepEvaluator(start time.Time, data promql.Vector) *VectorStepEvaluator
func (*VectorStepEvaluator) Close ¶
func (e *VectorStepEvaluator) Close() error
func (*VectorStepEvaluator) Error ¶
func (e *VectorStepEvaluator) Error() error
func (*VectorStepEvaluator) Explain ¶
func (e *VectorStepEvaluator) Explain(parent Node)
func (*VectorStepEvaluator) Next ¶
func (e *VectorStepEvaluator) Next() (bool, int64, StepResult)
Source Files
¶
- accumulator.go
- approx_count_distinct.go
- blocker.go
- count_min_sketch.go
- downstream.go
- engine.go
- evaluator.go
- explain.go
- first_last_over_time.go
- kahan.go
- limits.go
- mapper_metrics.go
- mapper_stats.go
- matchers.go
- matrix.go
- metrics.go
- optimize.go
- quantile_over_time_sketch.go
- range_vector.go
- rangemapper.go
- shardmapper.go
- shards.go
- step_evaluator.go
- stream_first_accumulator.go
- stream_first_range_vector.go
- test_utils.go
- tree_printer.go
- vector.go
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
logqlbench/report
command
Command report turns `go test -bench BenchmarkLogQLMetricQueries` output into the markdown tables pasted into a PR description.
|
Command report turns `go test -bench BenchmarkLogQLMetricQueries` output into the markdown tables pasted into a PR description. |
|
logfmt
Adapted from https://github.com/go-logfmt/logfmt/ but []byte as parameter instead Original license is MIT.
|
Adapted from https://github.com/go-logfmt/logfmt/ but []byte as parameter instead Original license is MIT. |
|
This file is taken from the golang text/scanner package so `bufLen` can be set to `maxInputSize`.
|
This file is taken from the golang text/scanner package so `bufLen` can be set to `maxInputSize`. |