Skip to content

Define health groups

A health group checks a subset of the indicators and answers at /actuator/health/{group}. The package defines two groups for Kubernetes probes:

config/actuator.php
'groups' => [
'liveness' => ['include' => ['ping']],
'readiness' => ['include' => ['readinessState']],
],

List the indicator names in include. Each name must be a key of health.indicators:

config/actuator.php
'groups' => [
'liveness' => ['include' => ['ping']],
'readiness' => ['include' => ['readinessState', 'db', 'cache']],
],

A name that is not an indicator makes the health endpoint throw an exception, so a typo shows up at the first request.

Add a key to groups. For example, a group that a dashboard polls for the external services:

config/actuator.php
'groups' => [
'liveness' => ['include' => ['ping']],
'readiness' => ['include' => ['readinessState']],
'external' => ['include' => ['paymentGateway', 'redis']],
],
Terminal window
curl http://localhost/actuator/health/external

Use a group name that is not also an indicator name. When both exist, the path selects the group.

A group can override show_details and show_components. The group setting wins over the endpoint setting:

config/actuator.php
'show_details' => 'when_authorized',
'groups' => [
'liveness' => ['include' => ['ping'], 'show_details' => 'never'],
'external' => ['include' => ['paymentGateway', 'redis'], 'show_details' => 'always'],
],

When components are visible, each component of a group has its own path:

Terminal window
curl http://localhost/actuator/health/readiness/db

Set groups to an empty array. The root response then omits the groups key:

config/actuator.php
'groups' => [],