Skip to main content

Health checks

HivePaaS has two kinds of health check:

  • the container's, which Docker runs inside each container, to restart one that stopped working, and to know when a new one is ready;
  • the app's, which HivePaaS runs from outside against a URL, to tell you when the app is down.

The container's health check​

In the app's Container Settings, under the health check, choose its Mode:

  • Inherit: the image's own HEALTHCHECK, if it has one;
  • CMD: a command run directly, such as curl -f http://localhost:8080/health;
  • CMD-SHELL: a command run by the container's shell, such as pg_isready -U "$POSTGRES_USER".

The command succeeds, with exit code 0, while the container is healthy. Then:

SettingWhat it does
IntervalThe time between two checks.
TimeoutThe longest one check may take.
RetriesHow many checks in a row must fail before the container is unhealthy.
Start PeriodThe time a starting container gets before failures count.
Start IntervalThe time between checks during the start period.

Docker replaces a container that turns unhealthy. The command runs inside the container, so the tool it uses, such as curl or wget, must be in the image.

The app's health checks​

In the app's Periodic Jobs, create a health check:

SettingWhat to give
TypeREST for an HTTP endpoint, or GRPC for a gRPC health service.
URL, Method, BodyThe request to make, such as GET https://shop.example.com/health.
Return Code Must BeThe status codes that pass, such as 200,204.
Return Body Must BeOptional: text the body must equal or match, or JSON it must equal or contain.
SchedulingHow often to check, and the timeout, retries and delay between them.
Notification ConfigurationWho hears when it fails, and how often at most, with Min Send Interval.

When a check fails, HivePaaS notifies the target you chose. A scheduled job can run when the app's health checks fail, and when they pass again.