Liveness API: GET /api/health
GET /api/health tells you whether the MDSS API gateway process is up and answering HTTP requests. It checks nothing else.
Available in all versions. No API key is needed from MDSS 4.6.0. On 4.5.x and earlier, send the ApiKey header of any user; a Read Only Administrator key is enough.
Request
Parameter | Required | Effect |
|---|---|---|
| no | Adds the body |
The endpoint runs no query against the database, the cache or the message broker, and it does not ask the other MDSS services. It is safe to poll at any interval.
Response
HTTP | Body | Meaning |
|---|---|---|
| empty, or | The gateway process is up. |
| web server error page | The gateway is down or restarting. The web server in front of it could not reach it. |
| Only on 4.5.x and earlier, when no |
What it does not tell you
/api/health keeps answering 200 while the database, the cache or the message broker is unreachable, and while Discovery, Scanning or Remediations are stopped. Users cannot log in or scan in those states, yet the process is alive.
On MDSS 4.7.0 and later, use
GET /api/readyzfor that question. It needs no credentials either and answers503when MDSS cannot serve.On MDSS 4.6.x and earlier,
GET /api/healthzwith an administrator API key shows the state of each service.
Examples
Call it
On 4.5.x and earlier:
Wait for the gateway to come up
Kubernetes liveness probe
Why not /?
A web server that has lost its connection to the gateway still serves the login page at / with 200. The same web server answers 502 on /api/health. Point health checks at /api/health or /api/readyz, never at /.
Notes
Each API gateway answers for itself. Behind a load balancer, probe every instance.
MDSS Cloud and other multi-tenant deployments: from 4.7.0 the endpoint answers without a tenant cookie.