You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PromQL spatial aggregation (sum by (cpu) (metric), no range vector) and SQL spatial-style queries (no explicit time range) both mean "aggregate over the last scrape/ingestion interval," but that default is applied inconsistently per query language:
PromQL: implicit, handled via QueryPatternType::OnlySpatial branches.
SQL: implicit, handled via QueryType::Spatial branches with its own substitution logic.
do_merge on QueryExecutionContext is set from the enum variant rather than computed from the resolved time range, so its correctness depends on the enum classification being right rather than on any explicit, checkable relationship between range and window size.
Why it matters
There's no single point where "what time range did this query actually use" is explicit and observable — it's reconstructed differently by each planner from different inputs (enum variant, scrape interval, ingestion interval). This makes the actual queried window hard to test directly and easy to get subtly wrong per language (#485 is one concrete consequence, on the Elastic path).
Summary
PromQL spatial aggregation (
sum by (cpu) (metric), no range vector) and SQL spatial-style queries (no explicit time range) both mean "aggregate over the last scrape/ingestion interval," but that default is applied inconsistently per query language:QueryPatternType::OnlySpatialbranches.QueryType::Spatialbranches with its own substitution logic.do_mergeonQueryExecutionContextis set from the enum variant rather than computed from the resolved time range, so its correctness depends on the enum classification being right rather than on any explicit, checkable relationship between range and window size.Why it matters
There's no single point where "what time range did this query actually use" is explicit and observable — it's reconstructed differently by each planner from different inputs (enum variant, scrape interval, ingestion interval). This makes the actual queried window hard to test directly and easy to get subtly wrong per language (#485 is one concrete consequence, on the Elastic path).
Evidence
asap-planner-rs/src/planner/window.rs:51— spatial window size branchasap-planner-rs/src/planner/cleanup.rs:26— spatial lookback branchasap-planner-rs/src/planner/promql.rs,asap-planner-rs/src/planner/sql.rs:168— per-language implicit-default handlingdo_mergeset fromQueryPatternTyperather than derived, acrossasap-query-engine/src/engines/simple_engine/*