Versions in this module Expand all Collapse all v2 v2.4.3 Feb 9, 2022 Changes in this version + const ABSENT_OVER_TIME + const ADD + const AND + const AVG + const AVG_OVER_TIME + const BOOL + const BOTTOMK + const BY + const BYTES + const BYTES_CONV + const BYTES_OVER_TIME + const BYTES_RATE + const CLOSE_BRACE + const CLOSE_BRACKET + const CLOSE_PARENTHESIS + const CMP_EQ + const COMMA + const COUNT + const COUNT_OVER_TIME + const DIV + const DOT + const DURATION + const DURATION_CONV + const DURATION_SECONDS_CONV + const EQ + const FIRST_OVER_TIME + const FailureKey + const GROUP_LEFT + const GROUP_RIGHT + const GT + const GTE + const IDENTIFIER + const IGNORING + const IP + const JSON + const LABELS + const LABEL_FMT + const LABEL_REPLACE + const LAST_OVER_TIME + const LINE_FMT + const LOGFMT + const LT + const LTE + const MATCHERS + const MAX + const MAX_OVER_TIME + const MIN + const MIN_OVER_TIME + const MOD + const MUL + const MetricsKey + const NEQ + const NRE + const NUMBER + const NoopKey + const OFFSET + const ON + const OPEN_BRACE + const OPEN_BRACKET + const OPEN_PARENTHESIS + const OR + const OpConvBytes + const OpConvDuration + const OpConvDurationSeconds + const OpFilterIP + const OpFmtLabel + const OpFmtLine + const OpGroupLeft + const OpGroupRight + const OpIgnoring + const OpLabelReplace + const OpOffset + const OpOn + const OpParserTypeJSON + const OpParserTypeLogfmt + const OpParserTypePattern + const OpParserTypeRegexp + const OpParserTypeUnpack + const OpPipe + const OpRangeTypeAbsent + const OpRangeTypeAvg + const OpRangeTypeBytes + const OpRangeTypeBytesRate + const OpRangeTypeCount + const OpRangeTypeFirst + const OpRangeTypeLast + const OpRangeTypeMax + const OpRangeTypeMin + const OpRangeTypeQuantile + const OpRangeTypeRate + const OpRangeTypeStddev + const OpRangeTypeStdvar + const OpRangeTypeSum + const OpTypeAdd + const OpTypeAnd + const OpTypeAvg + const OpTypeBottomK + const OpTypeCmpEQ + const OpTypeCount + const OpTypeDiv + const OpTypeGT + const OpTypeGTE + const OpTypeLT + const OpTypeLTE + const OpTypeMax + const OpTypeMin + const OpTypeMod + const OpTypeMul + const OpTypeNEQ + const OpTypeOr + const OpTypePow + const OpTypeStddev + const OpTypeStdvar + const OpTypeSub + const OpTypeSum + const OpTypeTopK + const OpTypeUnless + const OpUnwrap + const PATTERN + const PIPE + const PIPE_EXACT + const PIPE_MATCH + const POW + const QUANTILE_OVER_TIME + const QueryTypeFilter + const QueryTypeLimited + const QueryTypeMetric + const RANGE + const RATE + const RE + const REGEXP + const STDDEV + const STDDEV_OVER_TIME + const STDVAR + const STDVAR_OVER_TIME + const STRING + const SUB + const SUM + const SUM_OVER_TIME + const StreamsKey + const SuccessKey + const TOPK + const UNLESS + const UNPACK + const UNWRAP + const WITHOUT + var NoLimits = &fakeLimits + func EvaluatorUnsupportedType(expr Expr, ev Evaluator) error + func IsComparisonOperator(op string) bool + func IsLogicalBinOp(op string) bool + func Match(xs []string) ([][]*labels.Matcher, error) + func ParseAndValidateSeriesQuery(r *http.Request) (*logproto.SeriesRequest, error) + func ParseLabels(lbs string) (labels.Labels, error) + func ParseMatchers(input string) ([]*labels.Matcher, error) + func PopulateMatrixFromScalar(data promql.Scalar, params Params) promql.Matrix + func QueryType(query string) (string, error) + func RecordMetrics(ctx context.Context, p Params, status string, stats logql_stats.Result, ...) + func ResultIterator(res logqlmodel.Result, params Params) (iter.EntryIterator, error) + type BinOpExpr struct + Op string + Opts *BinOpOptions + RHS SampleExpr + func (e *BinOpExpr) Shardable() bool + func (e *BinOpExpr) String() string + func (e *BinOpExpr) Walk(f WalkFn) + type BinOpOptions struct + ReturnBool bool + VectorMatching *VectorMatching + type ConcatLogSelectorExpr struct + func (c ConcatLogSelectorExpr) String() string + type ConcatSampleExpr struct + func (c ConcatSampleExpr) String() string + func (c ConcatSampleExpr) Walk(f WalkFn) + type DefaultEvaluator struct + func NewDefaultEvaluator(querier Querier, maxLookBackPeriod time.Duration) *DefaultEvaluator + func (ev *DefaultEvaluator) Iterator(ctx context.Context, expr LogSelectorExpr, q Params) (iter.EntryIterator, error) + func (ev *DefaultEvaluator) StepEvaluator(ctx context.Context, nextEv SampleEvaluator, expr SampleExpr, q Params) (StepEvaluator, error) + type DownstreamEvaluator struct + func NewDownstreamEvaluator(downstreamer Downstreamer) *DownstreamEvaluator + func (ev *DownstreamEvaluator) Iterator(ctx context.Context, expr LogSelectorExpr, params Params) (iter.EntryIterator, error) + func (ev *DownstreamEvaluator) StepEvaluator(ctx context.Context, nextEv SampleEvaluator, expr SampleExpr, params Params) (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 Expr + Params Params + Shards Shards + type DownstreamSampleExpr struct + func (d DownstreamSampleExpr) String() string + func (d DownstreamSampleExpr) Walk(f 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, LogSelectorExpr, Params) (iter.EntryIterator, error) + type Evaluator interface + type Expr interface + Shardable func() bool + func Clone(e Expr) (Expr, error) + func ParseExpr(input string) (Expr, error) + type Grouping struct + Groups []string + Without bool + func (g Grouping) String() string + type JSONExpressionParser struct + Expressions []log.JSONExpression + func (j *JSONExpressionParser) Shardable() bool + func (j *JSONExpressionParser) Stage() (log.Stage, error) + func (j *JSONExpressionParser) String() string + func (j *JSONExpressionParser) Walk(f WalkFn) + type LabelFilterExpr struct + func (e *LabelFilterExpr) Shardable() bool + func (e *LabelFilterExpr) Stage() (log.Stage, error) + func (e *LabelFilterExpr) String() string + func (e *LabelFilterExpr) Walk(f WalkFn) + type LabelFmtExpr struct + Formats []log.LabelFmt + func (e *LabelFmtExpr) Shardable() bool + func (e *LabelFmtExpr) Stage() (log.Stage, error) + func (e *LabelFmtExpr) String() string + func (e *LabelFmtExpr) Walk(f WalkFn) + type LabelParserExpr struct + Op string + Param string + func (e *LabelParserExpr) Shardable() bool + func (e *LabelParserExpr) Stage() (log.Stage, error) + func (e *LabelParserExpr) String() string + func (e *LabelParserExpr) Walk(f WalkFn) + type LabelReplaceExpr struct + Dst string + Left SampleExpr + Re *regexp.Regexp + Regex string + Replacement string + Src string + func (e *LabelReplaceExpr) Extractor() (SampleExtractor, error) + func (e *LabelReplaceExpr) Selector() LogSelectorExpr + func (e *LabelReplaceExpr) Shardable() bool + func (e *LabelReplaceExpr) String() string + func (e *LabelReplaceExpr) Walk(f WalkFn) + type Limits interface + MaxQuerySeries func(userID string) int + type LineFilterExpr struct + Left *LineFilterExpr + Match string + Op string + Ty labels.MatchType + func (e *LineFilterExpr) Filter() (log.Filterer, error) + func (e *LineFilterExpr) Shardable() bool + func (e *LineFilterExpr) Stage() (log.Stage, error) + func (e *LineFilterExpr) String() string + func (e *LineFilterExpr) Walk(f WalkFn) + type LineFmtExpr struct + Value string + func (e *LineFmtExpr) Shardable() bool + func (e *LineFmtExpr) Stage() (log.Stage, error) + func (e *LineFmtExpr) String() string + func (e *LineFmtExpr) Walk(f WalkFn) + type LiteralExpr struct + func (e *LiteralExpr) Extractor() (log.SampleExtractor, error) + func (e *LiteralExpr) HasFilter() bool + func (e *LiteralExpr) Matchers() []*labels.Matcher + func (e *LiteralExpr) Pipeline() (log.Pipeline, error) + func (e *LiteralExpr) Selector() LogSelectorExpr + func (e *LiteralExpr) Shardable() bool + func (e *LiteralExpr) String() string + func (e *LiteralExpr) Value() float64 + func (e *LiteralExpr) Walk(f WalkFn) + 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 LogPipelineExpr interface + Pipeline func() (Pipeline, error) + type LogRange struct + Interval time.Duration + Left LogSelectorExpr + Offset time.Duration + Unwrap *UnwrapExpr + func (r *LogRange) Shardable() bool + func (r *LogRange) Walk(f WalkFn) + func (r LogRange) String() string + type LogSelectorExpr interface + HasFilter func() bool + Matchers func() []*labels.Matcher + func AddFilterExpr(expr LogSelectorExpr, ty labels.MatchType, op, match string) (LogSelectorExpr, error) + func ParseLogSelector(input string, validate bool) (LogSelectorExpr, error) + type MatchersExpr struct + func (e *MatchersExpr) AppendMatchers(m []*labels.Matcher) + func (e *MatchersExpr) HasFilter() bool + func (e *MatchersExpr) Matchers() []*labels.Matcher + func (e *MatchersExpr) Pipeline() (log.Pipeline, error) + func (e *MatchersExpr) Shardable() bool + func (e *MatchersExpr) String() string + func (e *MatchersExpr) Walk(f WalkFn) + 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 MultiStageExpr []StageExpr + func (m MultiStageExpr) Pipeline() (log.Pipeline, error) + func (m MultiStageExpr) String() string + type OffsetExpr struct + Offset time.Duration + func (o *OffsetExpr) String() string + 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 Pipeline = log.Pipeline + type PipelineExpr struct + Left *MatchersExpr + MultiStages MultiStageExpr + func (e *PipelineExpr) HasFilter() bool + func (e *PipelineExpr) Matchers() []*labels.Matcher + func (e *PipelineExpr) Pipeline() (log.Pipeline, error) + func (e *PipelineExpr) Shardable() bool + func (e *PipelineExpr) String() string + func (e *PipelineExpr) Walk(f WalkFn) + 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() (LogSelectorExpr, error) + type QueryRangeType string + var InstantType QueryRangeType = "instant" + var RangeType QueryRangeType = "range" + func GetRangeType(q Params) QueryRangeType + type RangeAggregationExpr struct + Grouping *Grouping + Left *LogRange + Operation string + Params *float64 + func (e *RangeAggregationExpr) Selector() LogSelectorExpr + func (e *RangeAggregationExpr) Shardable() bool + func (e *RangeAggregationExpr) String() string + func (e *RangeAggregationExpr) Walk(f WalkFn) + func (r RangeAggregationExpr) Extractor() (log.SampleExtractor, 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 SampleExpr, p Params) (StepEvaluator, error) + type SampleEvaluatorFunc func(ctx context.Context, nextEvaluator SampleEvaluator, expr SampleExpr, p Params) (StepEvaluator, error) + func (s SampleEvaluatorFunc) StepEvaluator(ctx context.Context, nextEvaluator SampleEvaluator, expr SampleExpr, p Params) (StepEvaluator, error) + type SampleExpr interface + Extractor func() (SampleExtractor, error) + Selector func() LogSelectorExpr + func ParseSampleExpr(input string) (SampleExpr, error) + type SampleExtractor = log.SampleExtractor + type SelectLogParams struct + func (s SelectLogParams) LogSelector() (LogSelectorExpr, error) + func (s SelectLogParams) String() string + type SelectSampleParams struct + func (s SelectSampleParams) Expr() (SampleExpr, error) + func (s SelectSampleParams) LogSelector() (LogSelectorExpr, error) + type ShardMapper struct + func NewShardMapper(shards int, metrics *ShardingMetrics) (ShardMapper, error) + func (m ShardMapper) Map(expr Expr, r *shardRecorder) (Expr, error) + func (m ShardMapper) Parse(query string) (noop bool, expr Expr, err error) + type ShardedEngine struct + func NewShardedEngine(opts EngineOpts, downstreamable Downstreamable, metrics *ShardingMetrics, ...) *ShardedEngine + func (ng *ShardedEngine) Query(p Params, mapped Expr) Query + 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 StageExpr interface + Stage func() (log.Stage, error) + 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 UnwrapExpr struct + Identifier string + Operation string + PostFilters []log.LabelFilterer + func (u UnwrapExpr) String() string + type VectorAggregationExpr struct + Grouping *Grouping + Left SampleExpr + Operation string + Params int + func (e *VectorAggregationExpr) Extractor() (log.SampleExtractor, error) + func (e *VectorAggregationExpr) Selector() LogSelectorExpr + func (e *VectorAggregationExpr) Shardable() bool + func (e *VectorAggregationExpr) String() string + func (e *VectorAggregationExpr) Walk(f WalkFn) + type VectorMatchCardinality int + const CardManyToOne + const CardOneToMany + const CardOneToOne + func (vmc VectorMatchCardinality) String() string + type VectorMatching struct + Card VectorMatchCardinality + Include []string + MatchingLabels []string + On bool + type WalkFn = func(e interface{}) + type Walkable interface + Walk func(f WalkFn) Other modules containing this package github.com/frelon/loki