parse

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotImplemented = errors.New("expression not implemented")
View Source
var ErrNotSupportedExpr = errors.New("unsupported expression")
View Source
var XFunctions = map[string]*parser.Function{
	"xdelta": {
		Name:       "xdelta",
		ArgTypes:   []parser.ValueType{parser.ValueTypeMatrix},
		ReturnType: parser.ValueTypeVector,
	},
	"xincrease": {
		Name:       "xincrease",
		ArgTypes:   []parser.ValueType{parser.ValueTypeMatrix},
		ReturnType: parser.ValueTypeVector,
	},
	"xrate": {
		Name:       "xrate",
		ArgTypes:   []parser.ValueType{parser.ValueTypeMatrix},
		ReturnType: parser.ValueTypeVector,
	},
}

Functions

func IsExtFunction

func IsExtFunction(functionName string) bool

IsExtFunction is a convenience function to determine whether extended range calculations are required.

func RegisterXFunctions added in v0.8.0

func RegisterXFunctions()

RegisterXFunctions makes the custom x-functions (xrate, xincrease, xdelta) available to the PromQL parser by adding them to the global parser.Functions table. Since prometheus v0.312 the parser no longer accepts a custom function map at construction time, so this global registration is the only way to make the engine parse these functions.

func UnknownFunctionError

func UnknownFunctionError(name string) error

func UnsupportedOperationErr

func UnsupportedOperationErr(op parser.ItemType) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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