File tree Expand file tree Collapse file tree
check-plugins/spring-boot-actuator-health Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -146,6 +146,9 @@ Each *numeric* component detail value is exposed as perfdata.
146146For testing purposes, install a Spring Boot Actuator application providing a ` /health ` endpoint. For example:
147147
148148``` bash
149+
150+ podman network create --ignore pcnet
151+
149152podman rm -f petclinic pg > /dev/null 2>&1 || true
150153
151154podman run -d --name pg --network pcnet -p 5432:5432 \
@@ -164,11 +167,20 @@ podman run -d --name petclinic --network pcnet -p 9966:9966 \
164167 -e MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE=health,info \
165168 -e MANAGEMENT_ENDPOINT_HEALTH_SHOW_DETAILS=always \
166169 -e MANAGEMENT_ENDPOINT_HEALTH_SHOW_COMPONENTS=always \
170+ --health-cmd=' curl --fail --show-error --silent --max-time 2 http://localhost:9966/petclinic/actuator/health' \
171+ --health-interval=30s \
172+ --health-on-failure=kill \
173+ --health-retries=5 \
174+ --health-start-period=5s \
175+ --health-timeout=10s \
167176 docker.io/springcommunity/spring-petclinic-rest
168177
178+
169179sleep 5
170180
171181curl http://localhost:9966/petclinic/actuator/health
182+
183+ podman inspect petclinic | jq ' .[0].State.Health'
172184```
173185
174186
You can’t perform that action at this time.
0 commit comments