Glossary · Types of monitoring

What is a health check endpoint?

A health check endpoint is a URL, such as /health or /healthz, that a service exposes so load balancers, orchestrators and monitoring can ask whether it works. It answers 200 when the service is healthy and an error status, usually 503, when it isn’t.

How it works and why it matters

A good health check tests what the service needs to serve users: a quick query to the database, the cache, the queue. It answers fast, has no side effects, needs no login or only a key with no other rights, and returns a small JSON body that says which check failed.

There are usually two kinds. A liveness check says the process runs and shouldn’t be restarted; it stays simple. A readiness check says the instance can take traffic now, dependencies included, so a load balancer or Kubernetes can route around it. External monitoring wants the readiness kind.

Be careful with dependencies you don’t control. If the health check fails whenever a third-party API is slow, every instance can be taken out of service at once. Report those as degraded in the body, and keep the status code for failures that really stop the service.

Example

GET /health

HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: no-store

{"status":"ok","checks":{"database":"ok","cache":"ok"}}

A monitor checks the status code and that $.status equals ok. A 503, a timeout or any other value fails the check.

How Uptimecheck helps

Uptimecheck API monitors can check a health endpoint every minute: the status code (200 to 399 by default, or the codes you set), up to 10 JSON and header conditions such as $.status equals ok, a keyword, and up to 20 request headers for a key. The default timeout is 10 seconds, and responses slower than your limit send a slow alert.

See API monitoring

14-day free trial · Then free on 20 monitors · No credit card

Read more in the guides

Guides 7 min read

How to Build a Health Check Endpoint (and Monitor It)

A health check endpoint tells monitors and load balancers whether your app can serve requests. What to check, how to keep it fast and safe, code for Laravel, Express and Flask, and how to monitor it.

Read

Guides 5 min read

API Monitoring Checklist: What to Check Beyond a 200 OK

An API can return 200 and still be broken. A practical checklist for API monitoring: methods, headers, request bodies, authentication, expected responses and response time thresholds.

Read

Questions

What should a health check endpoint return?

200 with a small JSON body when the service and its critical dependencies work, and 503 when they don’t. Add Cache-Control: no-store so a cache never answers for it.

Should a health check endpoint be public?

It can be, if it reveals nothing sensitive: no versions, host names or error messages. Otherwise protect it with a token sent as a header, and give the monitor its own key.

What is the difference between liveness and readiness?

Liveness says the process runs; failing it gets the process restarted. Readiness says the instance can serve traffic now; failing it takes the instance out of rotation until it recovers.

Hear it from us, not your customers.

Click around the live demo without an account, or start your trial and add your first monitor.

14-day free trial · Then free on 20 monitors · No credit card