Add liveness checks to your Daemons
Vercel Daemons now allow HTTP liveness checks to monitor daemon health, restarting containers automatically when failures occur.
Vercel Daemons now support HTTP liveness checks, enabling automatic detection of unhealthy daemon states. Developers must implement a lightweight HTTP endpoint in their daemon that reports health status. The endpoint should return an error status when the daemon is no longer functioning properly, triggering a container restart by Vercel. This mechanism helps prevent prolonged use of degraded or unresponsive daemons.
The liveness check operates by having Vercel periodically query the configured HTTP endpoint. If the endpoint fails to respond or returns an error status, Vercel restarts the daemon's container. This ensures that daemons remain operational and responsive to workloads. The feature is designed to catch cases where a daemon is still running but no longer healthy.
To use this feature, developers need to define an HTTP endpoint within their daemon that adheres to Vercel's requirements. The endpoint should be lightweight to ensure quick responses and accurate health reporting. Vercel provides default values for the liveness check configuration, which can be adjusted using optional tuning fields.
For detailed implementation guidance, developers can refer to the Daemon documentation on Vercel's website. The documentation includes information about default values, tuning fields, and best practices for configuring liveness checks. This ensures that daemons are properly monitored and maintained.