Class PromqlFunctionDefinition
java.lang.Object
org.elasticsearch.xpack.esql.expression.promql.function.PromqlFunctionDefinition
Function definition record for registration and metadata.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder forPromqlFunctionDefinitions.static enumDescribes whether a PromQL function supports counter metric types.static interfaceBuilds an ES|QL expression for a PromQL date/time extraction function (e.g.static interfacestatic interfacestatic enumStack (versioned Elasticsearch) releases that PromQL function documentation can reference.static final recordRepresents the parameter count constraints for a PromQL function.static final recordstatic final recordA singlestackavailability entry for a function's docs badge: a lifecycle state and the release it applies from, for examplepreview 9.4orga 9.5. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringShared extended-description fragment for the counter rate family (rate,irate,increase), set as each function'sPromqlFunctionDefinition.Builder.extendedDescriptionso it appears only on the dedicated function page, not in the brief functions overview.static final Stringstatic final Stringstatic final StringShared extended-description fragment for the gauge family (delta,idelta,deriv), set as each function'sPromqlFunctionDefinition.Builder.extendedDescriptionso it appears only on the dedicated function page, not in the brief functions overview.static final PromqlFunctionDefinition.PromqlParamInfostatic final PromqlFunctionDefinition.PromqlParamInfostatic final Stringstatic final PromqlFunctionDefinition.PromqlParamInfostatic final PromqlFunctionDefinition.PromqlParamInfostatic final Stringstatic final PromqlFunctionDefinition.PromqlParamInfostatic final Stringstatic final PromqlFunctionDefinition.PromqlParamInfostatic final StringDifference note forrateandincrease: unlike Prometheus, which extrapolates within each (overlapping) range window, Elasticsearch evaluates these over fixed time buckets and interpolates the counter value at interior bucket boundaries from the adjacent buckets' samples.static final PromqlFunctionDefinition.PromqlParamInfostatic final List<PromqlFunctionDefinition.StackAvailability> Stack availability for PromQL functions first implemented (and generally available) in 9.5.static final List<PromqlFunctionDefinition.StackAvailability> Stack availability for PromQL functions that shipped as a preview in 9.4 and became generally available in 9.5.static final PromqlFunctionDefinition.PromqlParamInfo -
Method Summary
Modifier and TypeMethodDescriptionarity()def()Create a builder for aPromqlFunctionDefinition.The "Differences from Prometheus" note rendered in the generated function docs, ornullwhen the function matches the Prometheus reference behavior.examples()Additional description detail rendered only on the function's own reference page (after the brief summary), not in the per-category functions overview.Convenience factory for agastack availability entry.name()params()Convenience factory for apreviewstack availability entry.static ExpressionquantileToPercentile(Source source, Expression phi) Scales a PromQL quantile φ (in the range [0, 1]) to the percentile value (in the range [0, 100]) expected by the ES|QLPERCENTILEaggregation that PromQLquantileandquantile_over_timetranslate into.stack()Thestackavailability entries rendered into this function's docsapplies_tobadge (for examplepreview 9.4, ga 9.5).toString()
-
Field Details
-
RANGE_VECTOR
-
INSTANT_VECTOR
-
INSTANT_VECTOR_OPTIONAL
-
SCALAR
-
QUANTILE
-
TO_NEAREST
-
MIN_SCALAR
-
MAX_SCALAR
-
COUNTER_RATE_BEHAVIOR
Shared extended-description fragment for the counter rate family (rate,irate,increase), set as each function'sPromqlFunctionDefinition.Builder.extendedDescriptionso it appears only on the dedicated function page, not in the brief functions overview. Documents Elasticsearch behavior that is consistent with Prometheus.- See Also:
-
RATE_INCREASE_NOTE
Difference note forrateandincrease: unlike Prometheus, which extrapolates within each (overlapping) range window, Elasticsearch evaluates these over fixed time buckets and interpolates the counter value at interior bucket boundaries from the adjacent buckets' samples. SeeRateDoubleGroupingAggregatorFunction.- See Also:
-
GAUGE_FAMILY_BEHAVIOR
Shared extended-description fragment for the gauge family (delta,idelta,deriv), set as each function'sPromqlFunctionDefinition.Builder.extendedDescriptionso it appears only on the dedicated function page, not in the brief functions overview. Documents the transparentto_gaugecoercion, which matches Prometheus semantics and so is not a "Differences from Prometheus" note. (Native histogram support is covered by the page-level limitations note rather than repeated here.)- See Also:
-
FIRST_LAST_NOTE
- See Also:
-
COUNT_NOTE
- See Also:
-
LOG_DOMAIN_NOTE
- See Also:
-
DOMAIN_PLUS_MINUS_ONE_NOTE
- See Also:
-
OVERFLOW_NOTE
- See Also:
-
QUANTILE_NOTE
- See Also:
-
STACK_PREVIEW_9_4_GA_9_5
Stack availability for PromQL functions that shipped as a preview in 9.4 and became generally available in 9.5. -
STACK_GA_9_5
Stack availability for PromQL functions first implemented (and generally available) in 9.5.
-
-
Method Details
-
name
-
functionType
-
arity
-
esqlBuilder
-
description
-
extendedDescription
Additional description detail rendered only on the function's own reference page (after the brief summary), not in the per-category functions overview. Used to keep the overview summaries short while documenting fuller behavior on the dedicated page.nullwhen the function has no extra detail. -
params
-
examples
-
counterSupport
-
differenceFromPrometheus
The "Differences from Prometheus" note rendered in the generated function docs, ornullwhen the function matches the Prometheus reference behavior. -
stack
Thestackavailability entries rendered into this function's docsapplies_tobadge (for examplepreview 9.4, ga 9.5). Empty when the function has not declared its availability, which the docs generator treats as an error so every registered function must declare one. -
toString
-
preview
public static PromqlFunctionDefinition.StackAvailability preview(PromqlFunctionDefinition.PromqlDocsVersion version) Convenience factory for apreviewstack availability entry. -
ga
public static PromqlFunctionDefinition.StackAvailability ga(PromqlFunctionDefinition.PromqlDocsVersion version) Convenience factory for agastack availability entry. -
quantileToPercentile
Scales a PromQL quantile φ (in the range [0, 1]) to the percentile value (in the range [0, 100]) expected by the ES|QLPERCENTILEaggregation that PromQLquantileandquantile_over_timetranslate into. Without this scaling, e.g.quantile(1.0, x)would collapse to the 0.01th percentile (≈ the minimum) instead of returning the maximum. -
def
Create a builder for aPromqlFunctionDefinition.
-