feat(promql): presence functions absent / absent_over_time / present_over_time (#47) - #82
Merged
Merged
Conversation
…over_time (#47) `absent`/`absent_over_time`/`present_over_time` parsed but were rejected. They now lower to presence intents (~65 corpus rejections; alerts corpus 864 → 876). Each lowers to a per-series `Aggregate{[Absent/AbsentOverTime/ PresentOverTime]}` over the (instant or range) argument. The empty-result → synthesized-1-sample logic is an L4/runtime concern; L3 only marks the operation. Modelled label-preserving so `absent`'s output labels — which it synthesizes from the argument's equality matchers (e.g. `job` from `{job="x"}`) — survive into the schema. - L3 AggIntent: + Absent / AbsentOverTime / PresentOverTime; requires()=TimeSeries, is_per_series()=true, float output. - L2 AggFunc mirror + converter mapping. - Front end: `walk_presence` + dispatch (arg 0 is the vector; `walk` builds a Window for the `*_over_time` matrix forms → TimeRange). Composes with #35 (`absent(up{job="x"}) == 1`). Flipped the `absent` GAP test, dropped absent/absent_over_time from `unsupported_functions_are_rejected`, added conformance section P (+ a matcher-label-preservation test). Full suite green; clippy clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #47.
absent/absent_over_time/present_over_timeparsed but were rejected (~65 corpus rejections).How
Each lowers to a per-series
Aggregate{[Absent / AbsentOverTime / PresentOverTime]}over the (instant or range) argument. The empty-result → synthesized-1-sample logic is an L4/runtime concern; L3 only marks the operation.Modelled label-preserving so
absent's output labels — which it synthesizes from the argument's equality matchers (e.g.jobfrom{job="x"}) — survive into the schema (verified byabsent_keeps_matcher_labels_for_the_synthesized_output).AggIntent::Absent/AbsentOverTime/PresentOverTime;requires()=TimeSeries,is_per_series()=true, float output.AggFuncmirror + converter mapping.walk_presence+ dispatch — arg 0 is the vector;walkbuilds aWindowfor the*_over_timematrix forms (→TimeRange).Verified
absent(up{job="prometheus"})→Aggregate{Absent} over Filter{job, Scan};absent_over_time(m[1h])/present_over_time(m[5m])→ overTimeRange;absent(up{job="x"}) == 1composes with the #35 scalar operand. Alerts corpus 864 → 876 lowered.Flipped the
absentGAP test → positive, dropped absent/absent_over_time fromunsupported_functions_are_rejected, added conformance section P. Full suite green (29 binaries), clippy clean.🤖 Generated with Claude Code