-
Notifications
You must be signed in to change notification settings - Fork 0
feat(promql): support topk over sum_over_time/count_over_time (ASAPQuery #706 parity) #502
Copy link
Copy link
Closed
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 servingintegration: ASAPPlannerASAPPlanner API, IR, candidate, and selected-plan integrationASAPPlanner API, IR, candidate, and selected-plan integrationtest: end-to-endProcess-boundary, differential, conformance, and full-stack testsProcess-boundary, differential, conformance, and full-stack tests
Description
Activity
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 servingintegration: ASAPPlannerASAPPlanner API, IR, candidate, and selected-plan integrationASAPPlanner API, IR, candidate, and selected-plan integrationtest: end-to-endProcess-boundary, differential, conformance, and full-stack testsProcess-boundary, differential, conformance, and full-stack tests
Summary
Match ASAPQuery PR #706 by accelerating
topkoversum_over_timeandcount_over_timein the backend-local PromQL profile, with the correct heap weighting and labels.Compatibility target
ProjectASAP/ASAPQuery#706 added these supported shapes:
The first must rank each series by its summed sample values (
count_events = false/ value weighting). The second must rank by the number of observations (count_events = true/ count weighting). Both grouped and ungrouped forms are included.topkoverrate,avg_over_time, and other temporal functions remains unsupported, matching ASAPQuery #706.ASAPQuery-backend has generic heap-bearing sketch machinery and can compile an evidenced Top-K query, but its checked-in backend-local compatibility workload and process conformance test do not cover either #706 shape. That leaves the weighting and in-sketch key/label contract unverified at the actual profile boundary.
Scope
by(...)partition labels.Acceptance criteria
sum_over_timeand count weighting forcount_over_time./api/v1/queryand/api/v1/query_range, compares against Prometheus, and assertsdata_source: warm.topk(rate(...))andtopk(avg_over_time(...))on exact fallback.Parent: #501