Conversation
zzylol
force-pushed
the
add-/api/v1/query_range-forwarding
branch
from
May 26, 2026 14:56
811a735 to
7bc5e1d
Compare
Contributor
|
Superseded by #347. The Thanos The difference is structural: a routing review concluded engine selection should live in one place ( Closing in favor of #347. |
zzylol
added a commit
that referenced
this pull request
May 26, 2026
…r; add range support (#347) Routing decisions now live in one place (EngineRouter + compatible_storage_backends); http.rs is a thin transport layer. Both instant and range queries try the ASAP sketch tier first and fall back to the archive (thanos_query) on CapabilityMiss, except accuracy==Exact goes straight to the archive. Supersedes PR #309's inline approach. - QueryEngine: add `execute_range` (default returns CapabilityMiss). - EngineRouter: add `execute_range` mirroring `execute()`'s failover over the shared `compatible_storage_backends` sequence. - ASAPQueryEngine: `execute_range` delegates to `execute_range_promql_modern` so the router reaches the real warm-tier range path. - ThanosQueryEngine: implement `execute_range` forwarding to `/api/v1/query_range` (4xx -> CapabilityMiss, 5xx/timeout -> Backend), ported from #309. - compatible_storage_backends: ASAP-first (Approximate -> [SketchStore, GorillaObjectStore]); Exact -> archive only; PrometheusRemote unchanged. Tests updated. - http.rs: `process_range_query_request` thinned to a single `query_router.execute_range` call; inline Thanos lookup removed. accuracy is still hardcoded `Approximate` on the live path (matches the instant path); the `Exact -> archive` gate is wired but dormant until a request can declare accuracy. cargo check + routing/thanos/http/capability_matching tests green. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
This PR implements
/api/v1/query_rangeforwarding inThanosQueryEngineso that range queries against archive-tier metrics are served by Thanos instead of returning an error.What Was Added
Added
range_endpoint()toThanosQueryConfigAdded
query_range()toThanosQueryEnginequerystartendstepAdded
execute_range()override onThanosQueryEngine4xx→CapabilityMiss5xx / timeout→BackendAdded
execute_range()default method to theQueryEnginetraitCapabilityMissby defaultWired
process_range_query_request()inhttp.rsThanosQueryEnginewhen:CapabilityMissAdded:
Updated:
verify_gorilla_compression.shREADME.mdWhy
ThanosQueryEnginepreviously only forwarded instant queries through:Range queries still went through:
When the ASAP sketch tier had no warm data for the metric, the backend returned:
instead of falling through to Thanos.
This blocked:
query_range/api/v1/query_rangerequestseven though Thanos already had the data available via:
thanos-store-gatewaygorilla-buffer-storeThe ingest path and instant-query path are unchanged.
Flow Before
Flow After
Test Results
Unit Tests
cargo test --manifest-path data_plane/Cargo.toml thanos_query_engineHTTP End-to-End Test
cargo test http_query_range_forwards_to_thanos