utils

package
v0.69.1 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasOuterBinaryExpr added in v0.8.0

func HasOuterBinaryExpr(node *parser.PromQLNode) *promParser.BinaryExpr

func HasOuterRate added in v0.28.0

func HasOuterRate(node *parser.PromQLNode) (calls []*promParser.Call)

func HasVectorSelector added in v0.4.1

func HasVectorSelector(node *parser.PromQLNode) (vs []promParser.VectorSelector)

func RemoveConditions added in v0.10.1

func RemoveConditions(source string) promParser.Node

RemoveConditions takes a *valid* PromQL expression and removes any condition from it.

Types

type ExcludedLabel added in v0.67.0

type ExcludedLabel struct {
	Reason   string
	Fragment string
}

type Source added in v0.67.0

type Source struct {
	Selectors        []*promParser.VectorSelector
	Call             *promParser.Call
	ExcludeReason    map[string]ExcludedLabel // Reason why a label was excluded
	Operation        string
	Returns          promParser.ValueType
	ReturnedNumbers  []float64 // If AlwaysReturns=true this is the number that's returned
	IncludedLabels   []string  // Labels that are included by filters, they will be present if exist on source series (by).
	ExcludedLabels   []string  // Labels guaranteed to be excluded from the results (without).
	GuaranteedLabels []string  // Labels guaranteed to be present on the results (matchers).
	Type             SourceType
	FixedLabels      bool // Labels are fixed and only allowed labels can be present.
	IsDead           bool // True if this source cannot be reached and is dead code.
	AlwaysReturns    bool // True if this source always returns results.
}

func LabelsSource added in v0.67.0

func LabelsSource(expr string, node promParser.Node) (src []Source)

type SourceType added in v0.67.0

type SourceType int
const (
	UnknownSource SourceType = iota
	NumberSource
	StringSource
	SelectorSource
	FuncSource
	AggregateSource
)

Jump to

Keyboard shortcuts

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