From e754212a394c67e5f43e9f5a52efa7fc58e48dbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gast=C3=B3n=20Fournier?= Date: Fri, 16 May 2025 12:38:27 +0200 Subject: [PATCH] docs: explain health API properly (#10009) ## About the changes Our health implementation always returns GOOD if the server is up: https://github.com/Unleash/unleash/blob/beb29f5b5bbff620097fa822e2dff6b68a11adab/src/lib/routes/health-check.ts#L46-L51 Currently our documentation of the endpoint is misleading saying that it will return BAD if unable to connect to PostgreSQL Closes #9965 --- src/lib/openapi/spec/health-check-schema.ts | 2 +- .../reference/api/legacy/unleash/internal/health.md | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/lib/openapi/spec/health-check-schema.ts b/src/lib/openapi/spec/health-check-schema.ts index 81612d4e14..e7f6dbbdb1 100644 --- a/src/lib/openapi/spec/health-check-schema.ts +++ b/src/lib/openapi/spec/health-check-schema.ts @@ -10,7 +10,7 @@ export const healthCheckSchema = { properties: { health: { description: - 'The state this Unleash instance is in. GOOD if everything is ok, BAD if the instance should be restarted', + 'The state this Unleash instance is in. GOOD if the server is up and running. It never returns BAD, if the server is unhealthy you will get an unsuccessful http response.', type: 'string', enum: ['GOOD', 'BAD'], example: 'GOOD', diff --git a/website/docs/reference/api/legacy/unleash/internal/health.md b/website/docs/reference/api/legacy/unleash/internal/health.md index 8711da6042..1cbe3409ec 100644 --- a/website/docs/reference/api/legacy/unleash/internal/health.md +++ b/website/docs/reference/api/legacy/unleash/internal/health.md @@ -16,14 +16,8 @@ Used to check the health of the running Unleash instance. This endpoint has two } ``` -This response means everything is OK. Unleash is able to talk to the PostgreSQL +This response means Unleash server is up. `Status: 500` -```json -{ - "health": "BAD" -} -``` - -This response indicates that Unleash is not able to talk to PostgreSQL and will not be able to serve requests. +This response indicates that Unleash server is unhealthy.