Repository navigation
feat(data-plane): --no-forward: every answer computed by ASAP - #841
Merged
Merged
Conversation
With --no-forward the data plane never sends a query to Prometheus for computation. It refuses to install a plan with a query the query engine cannot run, and answers any query the plan does not answer (not planned, a pane not stored, off the pane grid, a range query) with a Prometheus execution error (422, x-asap-execution: refused) giving the reason a forwarded query's x-asap-forward-reason would carry. Raw samples are still read from Prometheus. Without the flag nothing changes. Closes #836.
zzylol
force-pushed
the
feat/no-forward
branch
from
October 21, 2026 00:49
949bd2e to
297c4f1
Compare
zzylol
marked this pull request as ready for review
October 21, 2026 00:49
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.
Stack: main → #834 → this PR. Closes #836.
Why
The data plane forwards a query to Prometheus whenever the plan does not answer it: the query is not planned, a pane it reads is not stored, the evaluation time is off the pane grid, or its root cannot be compiled. The answer then comes from Prometheus, and only
x-asap-execution: forwardedshows it. To evaluate ASAP, and for deployments that want every answer computed by ASAP, forwarded work must not hide in Prometheus's CPU.What
--no-forward(EngineOptions::no_forward) on the data plane:QueryRunstored output that cannot be built) is refused, and the reasons are listed.executionerror: HTTP 422,{"status":"error","errorType":"execution","error":"<reason>"}, withx-asap-execution: refused. The reason is the textx-asap-forward-reasonwould carry: not planned, pane not stored, off the pane grid, evaluation time out of range, or execution failed. Range queries and requests without aqueryget the same error. Prometheus receives no query for computation.The control plane already writes a plan only when the Planner plans every workload query with what the data plane can execute: otherwise
plan_installablefails, and no plan is written. A new test pins this down.How
QueryEngine::unexecutable()lists the planned queries whose program failed to compile, with the reason;Engine::newrefuses the plan whenno_forwardis set and the list is not empty.DataPlanekeepsno_forwardand, where it would callforward, returnsnot_answered(reason)instead.Usage
Before this PR
up(not planned) andquantile_over_time(0.99, latency_ms[60m])before its panes exist were both answered by Prometheus, withx-asap-execution: forwarded.After this PR
With
--no-forward, both get 422 with the reason, and Prometheus receives no request. Without the flag they are forwarded as before.Verification
cargo test --workspace --lockedpasses (fmt checked; clippy not run for this draft). New tests:no_forward::refuses_what_the_plan_cannot_answer_without_asking_prometheus: an unplanned query, an evaluation whose panes are not stored, and a range query each get 422 with the reason, and a counting stand-in Prometheus receives 0 requests.no_forward::forwards_without_the_flag: the same unplanned query is forwarded once.no_forward::refuses_to_install_a_plan_with_a_query_it_cannot_run: a plan whose raw-sample window has a matcher that does not compile is refused with--no-forwardand installs without it.plan_workload::refuses_a_workload_with_a_query_it_cannot_plan: without raw data at query time, a workload with a raw instant selector (latency_ms) is refused by planning.