Documentation
¶
Index ¶
- func FindPosition(expr string, within posrange.PositionRange, fn string) posrange.PositionRange
- func GetQueryFragment(expr string, pos posrange.PositionRange) string
- func HasVectorSelector(node *parser.PromQLNode) (vs []promParser.VectorSelector)
- func RemoveConditions(source string) promParser.Node
- type ExcludedLabel
- type Join
- type Source
- type SourceType
- type Visitor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindPosition ¶ added in v0.71.0
func FindPosition(expr string, within posrange.PositionRange, fn string) posrange.PositionRange
FIXME sum() on ().
func GetQueryFragment ¶ added in v0.71.0
func GetQueryFragment(expr string, pos posrange.PositionRange) string
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 posrange.PositionRange
}
type Source ¶ added in v0.67.0
type Source struct {
Selector *promParser.VectorSelector // Vector selector used for this source.
Call *promParser.Call // Most outer call used inside this source.
Aggregation *promParser.AggregateExpr // Most outer aggregation expression used inside this source.
ExcludeReason map[string]ExcludedLabel // Reason why a label was excluded
Operation string
IsDeadReason string
Returns promParser.ValueType
Joins []Join // Any other sources this source joins with.
Unless []Join // Any other sources this source is suppressed by.
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).
Position posrange.PositionRange
IsDeadPosition posrange.PositionRange
ReturnedNumber float64 // If AlwaysReturns=true this is the number that's returned
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.
KnownReturn bool // True if we always know the return value.
IsConditional bool // True if this source is guarded by 'foo > 5' or other condition.
IsReturnBool bool // True if this source uses the 'bool' modifier.
}
FIXME remove Selector/Call/Aggregation? Use a single parser.Node instead?
func LabelsSource ¶ added in v0.67.0
func LabelsSource(expr string, node promParser.Node) (src []Source)
func (Source) CanHaveLabel ¶ added in v0.71.0
func (Source) LabelExcludeReason ¶ added in v0.71.0
func (s Source) LabelExcludeReason(name string) ExcludedLabel
func (Source) WalkSources ¶ added in v0.71.0
type SourceType ¶ added in v0.67.0
type SourceType int
const ( UnknownSource SourceType = iota NumberSource StringSource SelectorSource FuncSource AggregateSource )
Click to show internal directories.
Click to hide internal directories.