Learn how to configure custom health checks for your Koyeb Services
By default, Koyeb automatically performs TCP health checks on your service deployment's exposed ports to ensure maximum availability and determine your deployment healthiness. The TCP probe performed by default checks a connection can be made and gracefully terminated on the deployment exposed ports.
These default health checks run on a repeating basis and are used at different stages of the deployment:
To start receiving traffic, all health checks must pass for all ports exposed on your service deployment.
If one or all health checks fail for fifteen minutes, your service deployment will have the Error
status.
In that case, the previous Healthy
deployment will continue to receive traffic until a new deployment reaches the Healthy
status.
If no previous deployment was successfully promoted, your service will not receive traffic.
Depending on the application you deploy, you may need more control over defining the health status of your service deployments. Koyeb allows you to override and define your own health check for each exposed port.
This documentation explains how to:
Koyeb allows you to configure HTTP and TCP probes. Note that we plan to support more probes in the future like gRPC, QUIC, and more.
As previously mentioned, by default, Koyeb automatically performs a TCP health check on your service deployment exposed ports. Depending on your needs, you can override a part or all values of the default health check:
To customize the TCP health check using the Koyeb control panel, proceed as follows:
Your health checks will be active when your new deployment is live.
If you are deploying an HTTP server, like an API or a web application, we recommend you define custom HTTP health checks on relevant ports to indicate how Koyeb should determine the health of your service deployment. An HTTP probe allows you to check the status at the application level by sending an HTTP request to a specific path and expecting a specific HTTP status code in return.
For your health check to be considered successful, the path defined in the health check must return a 2xx
or 3xx
HTTP status code. Any other status code will be considered a failure.
By defining a custom HTTP health check, you can customize the following values:
GET
. You can change the method by one of the following GET
, HEAD
, POST
, PUT
, DELETE
, CONNECT
, OPTIONS
, or TRACE
.To customize and create an HTTP health check using the Koyeb control panel, proceed as follows:
TCP
to HTTP
Your health checks will be active when your new deployment is live.
You can monitor the status of the health checks performed on your service deployments by looking at:
In addition to these statuses, a message is displayed to provide more details about the current state of the deployment and its instances.
When your deployment failed and has the Error
status, you can know if the error is due to a health check failure if the following message appears: Health checks failed to pass on all instances. Please check instances messages for more information.
In the case your deployment has the Unhealthy
, Degraded
, or Error
status, you can click on the Instances tab to get more information and visualize if this status is related to a health check failure by looking at the status and message of the instances.
For example, if an HTTP health check fails to pass on port 8080
you will see the following message on
your deployment instances: HTTP health check on port 8080 failed.
Read our Troubleshooting Deployments doc to learn how to troubleshoot unhealthy instances.