Skip to content

Commit b3857b9

Browse files
authored
Merge pull request #963 from Dstack-TEE/codex/feat-kms-startup-health
feat(kms): expose a startup health endpoint
2 parents b2b5b3e + 0c4523c commit b3857b9

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

dstack/kms/src/main.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ async fn run_onboard_service(kms_config: KmsConfig, figment: Figment) -> Result<
6363
// Remove section tls
6464

6565
let rocket = rocket::custom(figment)
66-
.mount("/", rocket::routes![index, finish])
66+
.mount("/", rocket::routes![index, finish, health])
6767
.mount(
6868
"/prpc",
6969
ra_rpc::prpc_routes!(OnboardState, OnboardHandler, trim: "Onboard."),
@@ -80,6 +80,11 @@ async fn run_onboard_service(kms_config: KmsConfig, figment: Figment) -> Result<
8080
Ok(())
8181
}
8282

83+
#[rocket::get("/health")]
84+
fn health() -> RawText<&'static str> {
85+
RawText("OK")
86+
}
87+
8388
#[rocket::get("/metrics")]
8489
fn metrics(state: &State<KmsState>) -> RawText<String> {
8590
RawText(state.metrics().render_prometheus())
@@ -184,6 +189,7 @@ async fn main() -> Result<()> {
184189
"/prpc",
185190
ra_rpc::prpc_routes!(KmsState, RpcHandler, trim: "KMS."),
186191
)
192+
.mount("/", rocket::routes![health])
187193
.manage(state.clone());
188194

189195
if metrics_enabled {

0 commit comments

Comments
 (0)