Hi!

I'm trying to expose readiness probe on the main application port of spring boot microservice. I want it to mirror the path used by endpoint on management port so I set property management.endpoint.health.group.readiness.additional-path=server:/actuator/health/readiness. But it is not possible due to following validation

https://github.com/spring-projects/spring-boot/blob/49c86e6e1bef32e21bd2979aabddfcbacbe8ee89/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/AdditionalHealthEndpointPath.java#L129-L132

Is it really necessary? I'm not sure if I understand the reasoning behind this limitation correctly.

Comment From: chillb0nes

Looks like not only this validation prevents my scenario. If I bypass validation during debugging, path with multiple segments still does not work. This is probably because additional-path works by utilizing health/{*path} mapping, but it is handled differently from Spring MVC request matching, and only the last path segment got captured.

https://github.com/spring-projects/spring-boot/blob/49c86e6e1bef32e21bd2979aabddfcbacbe8ee89/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java#L337-L346

I think this can be fixed by using PathPattern or AntPathMatcher from here, but perhaps this is intended?

Comment From: philwebb

I'm afraid the restriction is intentional since we need to support Spring MVC, Spring WebFlux and Jersey. I'm not sure we want to remove that restriction given the effort required to support all of those stacks.

You might be able to write something similar to AdditionalHealthEndpointPathsWebMvcHandlerMapping for your specific purpose that calls registerMapping with the specific path you want.