Skip to main content
Version: next

Since version 3.6

Health Checks

Health checks allow you to monitor the availability of your services and automatically put your store in maintenance mode if a service is down. This ensures that your users are not affected by a service outage.

With health checks, you can define a set of services that you want to monitor and provide a function to check the health of each service. Front-Commerce will periodically run these health check functions and if a service is down, it will automatically put the store in maintenance mode. Once the service is back up, the Front-Commerce will automatically remove the store from maintenance mode.

Additionally, you can configure the scheduling of the health checks using a Cron pattern. This allows you to control how often the health checks are run and how quickly your store is put in maintenance mode if a service is down.

info

When Maintenance Mode has been activated manually via the maintenance mode API, the health checks will not remove the store from maintenance mode even after a service has recovered. To remove the store from maintenance mode, you must manually deactivate it.

demo

For a more detailed example of how to use this feature, you can refer to the Maintenance Mode Demo Extension. This extension defines a health check that checks a hypothetical "acme" service, and allows to mutate the status in a custom /maintenance route.

The Health Check API