feat: add runtime_status and is_ready - #81
Conversation
Adds SpiceClient::runtime_status (GET /v1/status), reporting per-component state for http, flight, metrics and opentelemetry, and SpiceClient::is_ready (GET /v1/ready) for the boolean case. Neither was reachable from the SDK. ComponentStatus keeps an Other(String) variant so a status added by a newer runtime deserializes rather than failing.
There was a problem hiding this comment.
Pull request overview
Adds runtime health and per-component status support to the Spice.ai Rust SDK by exposing /v1/ready and /v1/status through SpiceClient, reusing the existing authenticated HTTP client.
Changes:
- Introduces
statusmodule withComponentStatus,ConnectionDetails, andStatusError, plus internalQueryHttpClienthelpers for/v1/statusand/v1/ready. - Adds
SpiceClient::runtime_status()andSpiceClient::is_ready()methods that requirehttp_url()configuration. - Updates crate exports and README documentation/example to cover the new health APIs.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/status.rs | New runtime health/status types, errors, HTTP calls, and unit tests. |
| src/query.rs | Adds crate-private accessors so status.rs can reuse the configured/authenticated HTTP client. |
| src/lib.rs | Exposes the new status module and re-exports its public types. |
| src/client.rs | Adds SpiceClient convenience methods wrapping the new status/ready endpoints. |
| README.md | Documents and demonstrates runtime health/status usage. |
# Conflicts: # README.md
StatusError::RequestFailed and ::HttpError are raised by both runtime_status (GET /v1/status) and is_ready (GET /v1/ready), but both displayed "Failed to get runtime status", which is misleading in a readiness probe. Carry the URL and name it in the message instead.
|
The 10 red Probed directly at 2026-07-29T11:28Z:
Tracked in spiceai/spiceai#12116. Nothing to change on this branch — the remaining checks ( |
|
Closing and reopening to re-trigger CI: all 10 |
|
The reopen created a fresh run — 30647658880 — but it landed at |
Resolves the src/lib.rs module-list conflict: trunk added `mod redirect;` (the same-origin credential fix) while this branch added `pub mod status;`. Both belong; kept in alphabetical order alongside the rest of the list. The new status surface reaches the network through the shared http_client, which trunk now builds via `redirect::credentialed_client_builder()`, so the credential policy covers it with no further wiring.
|
The workflow-run approval I asked for on 2026-07-31 was granted — thank you. Run 30977349316 executed at 05:11Z today, so the old All 10 red legs fail for one reason, and it is not this diff: the integration suite needs a repo secret that a fork PR never receives. Every unit test passes on every platform. The only failure is
Three independent checks that the diff is not implicated:
This cannot be fixed from this branch — no change here can make a fork run see the secret. Worth noting for whoever picks this up: GitHub currently reports this PR as |
|
Filed #88 to own the harness fix, so the permanent red on fork PRs has somewhere to be fixed rather than being re-diagnosed on each PR. Nothing about this branch changes — the ten |
# Conflicts: # README.md
What
Adds two runtime health methods to
SpiceClient:runtime_status()→Vec<ConnectionDetails>, wrappingGET /v1/status. One entryper runtime connection (
http,flight,metrics,opentelemetry) with thatcomponent's endpoint and
ComponentStatus.is_ready()→bool, wrappingGET /v1/ready.Why
Neither endpoint was reachable from this SDK, so a Rust user waiting for a runtime to
come up — or diagnosing one that came up wrong — had to hand-roll
reqwestcallsalongside the client they already had configured.
/v1/readycollapses the runtime to one boolean;/v1/statussays which componentis not ready, which is the difference between "not up yet" and "Flight is failing".
Neither requires cluster mode or extra configuration, so both work on a default
spice run.Two details worth a reviewer's eye:
ComponentStatushas anOther(String)catch-all via#[serde(untagged)], so astatus variant added by a future runtime deserializes instead of erroring.
is_ready()returnsOk(false)for the runtime's503and reservesErrfor aprobe that could not be completed, so "not ready" and "could not ask" stay distinct.
Adding
client()/base_url()/authorized()accessors to the crate-privateQueryHttpClientletsstatus.rsreuse the existing client and API-key handlingrather than standing up a second
reqwest::Client. No public API change there.Part of aligning runtime health/status coverage across the Spice SDKs.
Verification
cargo buildcargo test --lib— 182 passed, 0 failed (4 new)cargo test --doc— 23 passed, including the new README examplecargo fmt --all --checkcargo clippy --all-features— no new warningstests/client_test.rs) — not run; they require a live runtimeand
SCP_SPICEAI_TPCH_API_KEY, neither available in this environment. They failidentically on unmodified
trunkhere.