logqlmodel

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package logqlmodel contains the error types and label-name constants used by the LogQL syntax and evaluation packages.

This is a trimmed fork of github.com/grafana/loki/v3/pkg/logqlmodel that omits the runtime Result/Streams types (which depend on github.com/grafana/loki/pkg/push and the queryrange-base definitions). Only the symbols required by the syntax and log packages are retained.

Index

Constants

View Source
const (
	ErrorLabel         = "__error__"
	PreserveErrorLabel = "__preserve_error__"
	ErrorDetailsLabel  = "__error_details__"
)

Special label names used by the pipeline error machinery.

View Source
const PackedEntryKey = "_entry"

PackedEntryKey is a special JSON key used by the pack promtail stage and the unpack parser.

View Source
const ValueTypeStreams = "streams"

ValueTypeStreams is the parser.ValueType for log streams.

Variables

View Source
var (
	ErrParse                            = errors.New("failed to parse the log query")
	ErrPipeline                         = errors.New("failed execute pipeline")
	ErrLimit                            = errors.New("limit reached while evaluating the query")
	ErrIntervalLimit                    = errors.New("[interval] value exceeds limit")
	ErrBlocked                          = errors.New("query blocked by policy")
	ErrParseMatchers                    = errors.New("only label matchers are supported")
	ErrUnsupportedSyntaxForInstantQuery = errors.New(
		"log queries are not supported as an instant query type, please change your query to a range query type",
	)
	ErrVariantsDisabled = errors.New(
		"multi variant queries are disabled for this instance",
	)
)

Errors useful for comparison via errors.Is.

errors.Is(err, logqlmodel.ErrParse) // is this an AST parse error?

Functions

This section is empty.

Types

type LimitError

type LimitError struct {
	// contains filtered or unexported fields
}

LimitError wraps an underlying error with the ErrLimit sentinel.

func NewSeriesLimitError

func NewSeriesLimitError(limit int) *LimitError

NewSeriesLimitError constructs a LimitError for a series-cardinality limit.

func (LimitError) Is

func (e LimitError) Is(target error) bool

Is allows errors.Is(err, ErrLimit) on this error.

type ParseError

type ParseError struct {
	// contains filtered or unexported fields
}

ParseError is returned when the parser fails.

func NewParseError

func NewParseError(msg string, line, col int) ParseError

NewParseError constructs a ParseError at the given source location.

func NewStageError

func NewStageError(expr string, err error) ParseError

NewStageError constructs a ParseError for a pipeline stage failure.

func (ParseError) Error

func (p ParseError) Error() string

Error implements the error interface.

func (ParseError) Is

func (p ParseError) Is(target error) bool

Is allows errors.Is(err, ErrParse) on this error.

type PipelineError

type PipelineError struct {
	// contains filtered or unexported fields
}

PipelineError is returned when a pipeline stage fails at evaluation time.

func NewPipelineErr

func NewPipelineErr(metric labels.Labels) *PipelineError

NewPipelineErr constructs a PipelineError from the given series labels.

func (PipelineError) Error

func (e PipelineError) Error() string

Error implements the error interface.

func (PipelineError) Is

func (e PipelineError) Is(target error) bool

Is allows errors.Is(err, ErrPipeline) on this error.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL