Health Probe
By default in Deploio, an application is considered ready as soon as the web server starts listening on its port. If it still needs extra startup work (e.g., load data, run migrations), traffic might arrive too early and cause temporary errors. A custom health probe URL fixes this by letting the platform poll your app until it reports itself as healthy - only then is traffic routed to it. This probe is optional. If you don't configure it, the platform will use its default health check behavior.
What you configure
We keep this simple - there are only two fields. The
--health-probe-period-seconds
flag controls how often the platform runs the
health probe against your application. It is specified in seconds, with a default
value of 10 and a minimum allowed value of 1. The --health-probe-path
flag
specifies the HTTP path on your application that the platform should request to
determine whether the service is healthy, for example /healthz
. Together,
these flags let you define how frequently the health check runs and which
endpoint should be used to signal when the application is ready and functioning
properly.
Your app controls the response. During startup, return a non-success status to indicate it is not yet ready, and once healthy, return a success HTTP status code. Any code greater than or equal to 200 and less than 400 indicates success. Any other code indicates failure.
Refer to the deploio-examples
repository for additional code samples. For example,
the sample Go application
defines a /healthz
endpoint, which serves as a simple demonstration of a custom health
probe.
Specifying a custom health probe during app creation
You can configure a health probe when creating an application by using the
health probe flags on the nctl create app
command.
nctl create app --health-probe-path="/healthz" --health-probe-period-seconds=9
Removing a custom health probe
Use this command if you want to remove a previously configured health probe and revert to the platform's default health check behavior:
nctl update app --delete-health-probe
Specifying a health probe on other configuration layers
As health probes are part of the configuration of a Deploio application, you can
also configure them on other configuration layers.
For example, you can set a health probe via the git configuration source file
.deploio.yaml
:
healthProbe:
httpGet:
path: /healthz
periodSeconds: 9
Examples
Refer to the deploio-examples repository
for additional code samples. For example, the sample Go application defines a
/healthz
endpoint, which serves as a simple demonstration of a custom health
probe.