Skip to content

fix(promql): lower workloads with ingestion intervals - #417

Merged
zzylol merged 1 commit into
mainfrom
408-promql-instant-aggregates-lose-their-evaluation-horizon-and-lower-directly-over-scan
Sep 18, 2026
Merged

zzylol merged 1 commit into
mainfrom
408-promql-instant-aggregates-lose-their-evaluation-horizon-and-lower-directly-over-scan

Conversation

@milindsrivastava1997

@milindsrivastava1997 milindsrivastava1997 commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

PromQL instant selectors need an explicit selection horizon that survives lowering and maintained-population compilation. This PR supplies it from source ingestion cadence.

Before this PR

Bare instant selectors lower directly to scans, losing their selection horizon; maintained current-series populations use a fixed expiry horizon.

After this PR

DataWorkload::data_ingestion_interval supplies a nonzero cadence. PromQL workload lowering accepts a PlanningWorkload and explicit planning timestamp, rejects unavailable cadence evidence, and wraps instant selectors in the declared time range. Explicit range selectors keep their query range. Maintained populations preserve and validate the same expiry horizon through Post-ASAP IR handling and executable-DAG compilation.

CLI tools, examples, and tests migrate to the workload lowering API. Freshness coverage includes future observations, expiry boundaries, expired evidence, and missing observation timestamps.

This PR targets main after #442 merged. #442 introduced only the query/data workload split; this PR adds ingestion-interval lowering and IR handling.

Validation

  • The final file tree is identical to previously validated commit 7fbfaf2 (full workspace tests, formatting, and Clippy passed).
  • Regression tests cover cadence freshness and maintained-population horizons.

@milindsrivastava1997
milindsrivastava1997 force-pushed the 408-promql-instant-aggregates-lose-their-evaluation-horizon-and-lower-directly-over-scan branch from c431b36 to 751a16d Compare September 14, 2026 14:22
@milindsrivastava1997 milindsrivastava1997 changed the title Lower PromQL workloads with explicit ingestion intervals fix(promql): lower workloads with ingestion intervals Sep 14, 2026
@milindsrivastava1997

Copy link
Copy Markdown
Collaborator Author

@zzylol Pls check the entire PR description. Code is in progress.

@milindsrivastava1997
milindsrivastava1997 marked this pull request as ready for review September 14, 2026 23:05
@milindsrivastava1997

Copy link
Copy Markdown
Collaborator Author

@zzylol code is done

zzylol
zzylol previously approved these changes Sep 18, 2026

@zzylol zzylol left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why data ingestion interval is a requirement to lower for PromQL, it may be useful for dataworkload as input to planner in general.

Also, the data ingestion interval (sample scraping interval in prometheus), and the query window range are two concepts, not sure how they are related in this PR.

@milindsrivastava1997

Copy link
Copy Markdown
Collaborator Author

@zzylol See issue 408. To convert PromQL instant selector queries to pre ASAP IR, we need a scrape interval. For range selector queries too, the scrape interval helps guide the possible sliding window choices we can use for precomputation.

@zzylol

zzylol commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Updated PR organization: #442 contains only the query/data workload split and targets main. #417 is stacked on #442 and contains ingestion-interval lowering, cadence freshness, and Post-ASAP IR handling. Merge #442 first, then retarget #417 to main. The two PRs are complementary.

@zzylol
zzylol force-pushed the 408-promql-instant-aggregates-lose-their-evaluation-horizon-and-lower-directly-over-scan branch from b56d0e2 to 37d1145 Compare September 18, 2026 16:34
@zzylol
zzylol changed the base branch from main to refactor/data-workload-parallel September 18, 2026 16:35
@zzylol
zzylol changed the base branch from refactor/data-workload-parallel to main September 18, 2026 16:41
@zzylol
zzylol force-pushed the 408-promql-instant-aggregates-lose-their-evaluation-horizon-and-lower-directly-over-scan branch from 37d1145 to 1f1f099 Compare September 18, 2026 16:41
@zzylol
zzylol merged commit c9b2aa7 into main Sep 18, 2026
3 of 4 checks passed
@zzylol
zzylol deleted the 408-promql-instant-aggregates-lose-their-evaluation-horizon-and-lower-directly-over-scan branch September 18, 2026 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PromQL instant aggregates lose their evaluation horizon and lower directly over Scan

2 participants