You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support multi-segment paths when mapping a health group to an additional path #48374
Error:
Caused by: java.lang.IllegalArgumentException: 'value' must contain only one segment.
at org.springframework.util.Assert.isTrue(Assert.java:116) ~[spring-core-6.2.12.jar:6.2.12]
This would make the live health group available on the main server port at /healthz. The prefix is mandatory and must be either server: (represents the main server port) or management: (represents the management port, if configured.) The path must be a single path segment.
Case 2 is also working as I would expect. The management server's base path has no effect as you're exposing the endpoint on the main (not management) server.
We might be able to relax the restriction in case 1, but I don't recall the reasons for it so it may not be possible. I'll discuss it with the rest of the team.
changed the title [-]Web base-path is not working on main port when management port is active[/-][+]Support multi-segment paths when mapping a health group to an additional path[/+]on Dec 2, 2025
That would be great, because if you are behind a Spring Cloud gateway with the same domain, for example, you have no chance (except with a lot of configuration and stripping) of forwarding the health check to the service if you have more than 1 service
I have a feeling we used a single path to align with standard actuator mappings where the endpoint ID is used as the path and cannot contains /. Looking at AdditionalHealthEndpointPathsWebMvcHandlerMapping, I think it should be possible to support more segments (at least for Spring MVC). The org.springframework.boot.webmvc.actuate.endpoint.web.AbstractWebMvcEndpointHandlerMapping.createRequestMappingInfo(WebOperationRequestPredicate, String) method already has subPath support.
I have a feeling we used a single path to align with standard actuator mappings where the endpoint ID is used as the path and cannot contains /. Looking at AdditionalHealthEndpointPathsWebMvcHandlerMapping, I think it should be possible to support more segments (at least for Spring MVC). The org.springframework.boot.webmvc.actuate.endpoint.web.AbstractWebMvcEndpointHandlerMapping.createRequestMappingInfo(WebOperationRequestPredicate, String) method already has subPath support.
Yes could be: then maybe an additional-base-path is missing, but looks then maybe confusing with the server: and management: prefix
Activity
wilkinsona commentedon Dec 2, 2025
This isn't supported at the moment.
Case 1 is working as documented:
Case 2 is also working as I would expect. The management server's base path has no effect as you're exposing the endpoint on the main (not management) server.
We might be able to relax the restriction in case 1, but I don't recall the reasons for it so it may not be possible. I'll discuss it with the rest of the team.
[-]Web base-path is not working on main port when management port is active[/-][+]Support multi-segment paths when mapping a health group to an additional path[/+]MelleD commentedon Dec 2, 2025
That would be great, because if you are behind a Spring Cloud gateway with the same domain, for example, you have no chance (except with a lot of configuration and stripping) of forwarding the health check to the service if you have more than 1 service
philwebb commentedon Dec 2, 2025
I have a feeling we used a single path to align with standard actuator mappings where the endpoint ID is used as the path and cannot contains
/. Looking atAdditionalHealthEndpointPathsWebMvcHandlerMapping, I think it should be possible to support more segments (at least for Spring MVC). Theorg.springframework.boot.webmvc.actuate.endpoint.web.AbstractWebMvcEndpointHandlerMapping.createRequestMappingInfo(WebOperationRequestPredicate, String)method already hassubPathsupport.MelleD commentedon Dec 2, 2025
Yes could be: then maybe an additional-base-path is missing, but looks then maybe confusing with the server: and management: prefix
Preserve health component selectors for wildcard mappings
Use parsed path patterns for MVC endpoint selectors
wilkinsona commentedon Sep 15, 2026
Closing in favour of #51470.