Repository navigation
feat(asapquery-profile): cover the complete ASAPQuery PromQL acceleration matrix #501
Copy link
Copy link
Open
Labels
area: control planePlanning, configuration, routing, and control-plane orchestrationPlanning, configuration, routing, and control-plane orchestrationarea: data planeRuntime ingestion, storage, and query-serving data pathsRuntime ingestion, storage, and query-serving data pathsarea: physical compilerCompilation from selected logical plans to executable backend and Collector plansCompilation from selected logical plans to executable backend and Collector plansarea: query enginePromQL lowering, execution, result shaping, and fallback behaviorPromQL lowering, execution, result shaping, and fallback behaviorarea: summary executionWarm-summary binding, readout, composition, and result decodingWarm-summary binding, readout, composition, and result decodingenhancementNew feature or requestNew feature or requestfeature: PromQLPromQL compatibility and execution semanticsPromQL compatibility and execution semanticsfeature: Top-KTop-K planning, heap materialization, ranking, and labelsTop-K planning, heap materialization, ranking, and labelsfeature: range evaluationRange-query steps, windows, timestamps, and temporal evaluationRange-query steps, windows, timestamps, and temporal evaluationfeature: sketch algorithmsSketch-family configuration, lifecycle, merge, and readout behaviorSketch-family configuration, lifecycle, merge, and readout behaviorfeature: warm summariesASAP warm-tier materialization, readiness, and servingASAP warm-tier materialization, readiness, and servingfeature: workload optimizationCross-query sharing, costing, placement, and physical configuration selectionCross-query sharing, costing, placement, and physical configuration selectionintegration: ASAPPlannerASAPPlanner API, IR, candidate, and selected-plan integrationASAPPlanner API, IR, candidate, and selected-plan integrationmeta: trackingUmbrella issue coordinating multiple implementation gapsUmbrella issue coordinating multiple implementation gapsquality: accuracyExact and approximate accuracy contracts, error bounds, and routingExact and approximate accuracy contracts, error bounds, and routingtest: end-to-endProcess-boundary, differential, conformance, and full-stack testsProcess-boundary, differential, conformance, and full-stack tests
Description
Summary
Raise the backend-local asapquery profile from its four-case MVP matrix to the complete accelerated PromQL surface documented and tested by current ASAPQuery.
Current gap
The backend profile's executable matrix currently proves only rate, increase, sum_over_time, and quantile_over_time for instant/range queries. ASAPQuery additionally accelerates:
- temporal
count_over_time,avg_over_time,min_over_time,max_over_time; - spatial
sum,count,avg,min,max,quantile, andtopk, with optionalby(...); - the six safe temporal/spatial compositions currently recognized by ASAPQuery:
sum(sum_over_time),sum(count_over_time),min(min_over_time),max(max_over_time),topk(sum_over_time), andtopk(count_over_time); - arithmetic trees over acceleratable leaves using
+ - * / ^ %, including scalar/vector arms; - both instant and range evaluation, including sliding-window composition and a query lookback wider than the materialized pane/window.
ASAPQuery's README intentionally excludes label selectors from this accelerated profile, and vector-matching modifiers are explicitly out of scope in its arithmetic design; those are not requested here.
Scope
- Add every listed shape to backend-local planning, physical compilation, precompute, QueryPlan execution, and readiness coverage.
- Preserve Prometheus labels, timestamps, range steps, counter reset/extrapolation semantics, Top-K ordering/labels, and arithmetic behavior.
- Use the canonical ASAPPlanner IR and selected summary plan; do not restore the historical ASAPQuery planner.
- Fail closed to exact Prometheus fallback whenever any leaf/operator cannot be accelerated safely.
- Version and document the expanded compatibility level.
Acceptance criteria
- A table-driven conformance suite runs every family through both
/api/v1/queryand/api/v1/query_range, comparing against Prometheus and assertingdata_source: warm. - Arithmetic covers all six operators, nested trees, scalar-vector/vector-scalar/vector-vector, divide-by-zero/NaN behavior, and whole-query fallback on an unsupported arm.
- Sliding and wider-lookback cases cover aligned and misaligned steps without double-counting panes.
- Existing focused gaps remain linked rather than duplicated: Exact TopK (accuracy: Exact) has no warm-tier materialization -- always falls to archive #432 (exact Top-K), SummaryExecutor: permanent self-exclusions + upstream composition gaps leave some PromQL shapes always on the legacy/archive path #436 (composition/SummaryExecutor exclusions), PromQL range warm path ignores step_ms and differential E2E does not detect it #487 (range step handling), and Small-sample quantile_over_time p99 diverges from Prometheus interpolation semantics #492 (small-sample quantile semantics).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: control planePlanning, configuration, routing, and control-plane orchestrationPlanning, configuration, routing, and control-plane orchestrationarea: data planeRuntime ingestion, storage, and query-serving data pathsRuntime ingestion, storage, and query-serving data pathsarea: physical compilerCompilation from selected logical plans to executable backend and Collector plansCompilation from selected logical plans to executable backend and Collector plansarea: query enginePromQL lowering, execution, result shaping, and fallback behaviorPromQL lowering, execution, result shaping, and fallback behaviorarea: summary executionWarm-summary binding, readout, composition, and result decodingWarm-summary binding, readout, composition, and result decodingenhancementNew feature or requestNew feature or requestfeature: PromQLPromQL compatibility and execution semanticsPromQL compatibility and execution semanticsfeature: Top-KTop-K planning, heap materialization, ranking, and labelsTop-K planning, heap materialization, ranking, and labelsfeature: range evaluationRange-query steps, windows, timestamps, and temporal evaluationRange-query steps, windows, timestamps, and temporal evaluationfeature: sketch algorithmsSketch-family configuration, lifecycle, merge, and readout behaviorSketch-family configuration, lifecycle, merge, and readout behaviorfeature: warm summariesASAP warm-tier materialization, readiness, and servingASAP warm-tier materialization, readiness, and servingfeature: workload optimizationCross-query sharing, costing, placement, and physical configuration selectionCross-query sharing, costing, placement, and physical configuration selectionintegration: ASAPPlannerASAPPlanner API, IR, candidate, and selected-plan integrationASAPPlanner API, IR, candidate, and selected-plan integrationmeta: trackingUmbrella issue coordinating multiple implementation gapsUmbrella issue coordinating multiple implementation gapsquality: accuracyExact and approximate accuracy contracts, error bounds, and routingExact and approximate accuracy contracts, error bounds, and routingtest: end-to-endProcess-boundary, differential, conformance, and full-stack testsProcess-boundary, differential, conformance, and full-stack tests
Activity
zzylol commentedon Sep 4, 2026
ASAPQuery PromQL PR audit → executable matrix
Audited all ASAPQuery PRs and excluded SQL/Elasticsearch. The matrix is grouped by behavior rather than duplicating every literal metric name.
Warm rows already proved by the backend process E2E
rate(m[w]),increase(m[w])— Small-sample quantile_over_time p99 diverges from Prometheus interpolation semantics #492, fix(clickhouse): preserve nulls in query results #657, Add canonical versioned label population keys #663, feat(query): maintain shared current-series quantile and TopK state #700, Add offline cluster data exporter tool #704sum_over_time(m[w]),quantile_over_time(phi,m[w])— test(e2e): controller → backend streaming-config round-trip + grouping plumb #247, feat(query): maintain shared current-series quantile and TopK state #700topk(k,sum_over_time(m[w])),topk by(labels)(k,count_over_time(m[w]))with explicit value/count heap modes — feat(promql): support topk over sum_over_time/count_over_time (ASAPQuery #706 parity) #502 / ASAPQuery Lookback vs PromQL range selector: redundant window concepts (+ /query_range readout bug) #706/[Refactor] Centralize planner and backend accuracy formulas #707, implemented by PR fix(promql): bind temporal TopK update semantics on the shared workload plan #505Rows that compile but still need process-level parity promotion
count_over_time,min_over_time,max_over_timesum,sum by,min,max,quantilesum(sum_over_time),sum(count_over_time),min(min_over_time),max(max_over_time)krepresentatives 1/3/5/10 from feat(query): maintain shared current-series quantile and TopK state #700These remain in this umbrella until they are added to the canonical startup snapshot and asserted warm against Prometheus.
Executed fallback rows and owners
PR #506 now sends these through the production binary and asserts atomic fallback:
avg_over_time, spatialcount, spatialavg→ feat(promql): compile and execute count/avg aggregation families from the ASAPQuery matrix #503topk(k,m)/ exact TopK → Exact TopK (accuracy: Exact) has no warm-tier materialization -- always falls to archive #432leaf op leaf,leaf op scalar, all+ - * / % ^, nesting and labels → feat(promql): execute binary arithmetic over warm summary readouts #504 + feat(promql): retain summary leaves under binary arithmetic plans ASAPPlanner#343; derived from ASAPQuery fix(query): dispatch Vector vs Matrix in asap_tier_result_to_query_result #256/Type physical plan references as summary definitions #572/feat: compose ClickHouse exact subtrees with summaries #577/Make completed summary windows immutable after durable flush #644Independent correctness gates (existing issues)
Selectors and vector-matching modifiers remain out of the ASAPQuery accelerated contract; Elasticsearch is intentionally excluded per scope.