logqlmodel

package
v3.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: AGPL-3.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

View Source
const PackedEntryKey = "_entry"

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

View Source
const ValueTypeStreams = "streams"

ValueTypeStreams promql.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")
	ErrorLabel                          = "__error__"
	PreserveErrorLabel                  = "__preserve_error__"
	ErrorDetailsLabel                   = "__error_details__"
)

Those errors are useful for comparing error returned by the engine. e.g. errors.Is(err,logqlmodel.ErrParse) let you know if this is a ast parsing error.

Functions

This section is empty.

Types

type LimitError

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

func NewSeriesLimitError

func NewSeriesLimitError(limit int) *LimitError

func (LimitError) Is

func (e LimitError) Is(target error) bool

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

type ParseError

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

ParseError is what is returned when we failed to parse.

func NewParseError

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

func NewStageError

func NewStageError(expr string, err error) ParseError

func (ParseError) Error

func (p ParseError) Error() string

func (ParseError) Is

func (p ParseError) Is(target error) bool

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

type PipelineError

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

func NewPipelineErr

func NewPipelineErr(metric labels.Labels) *PipelineError

func (PipelineError) Error

func (e PipelineError) Error() string

func (PipelineError) Is

func (e PipelineError) Is(target error) bool

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

type Result

type Result struct {
	Data       parser.Value
	Statistics stats.Result
	Headers    []*definitions.PrometheusResponseHeader
	Warnings   []string
}

Result is the result of a query execution.

type Streams

type Streams []push.Stream

Streams is promql.Value

func (Streams) Len

func (streams Streams) Len() int

func (Streams) Less

func (streams Streams) Less(i, j int) bool

func (Streams) Lines

func (streams Streams) Lines() int64

func (Streams) String

func (Streams) String() string

String implements `promql.Value` and `parser.Value`

func (Streams) Swap

func (streams Streams) Swap(i, j int)

func (Streams) Type

func (Streams) Type() parser.ValueType

Type implements `promql.Value` and `parser.Value`

Directories

Path Synopsis
Package metadata provides primitives for recording metadata across the query path.
Package metadata provides primitives for recording metadata across the query path.
Package stats provides primitives for recording metrics across the query path.
Package stats provides primitives for recording metrics across the query path.

Jump to

Keyboard shortcuts

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