After moving from spring-boot v1.3 to the newest spring-boot v2.2.4 we've lost the ability to have custom endpoints under management port.
Before we had our custom endpoints declared as:
@Component
public class CacheEndpoint implements MvcEndpoint {
...
@Override
public String getPath() {
return "/v1/cache";
}
...
// mappings goes here
Since MvcEndpoint
has been removed from spring-boot actuator now we need to do next:
@Component
@RestControllerEndpoint(id = "cache")
public class CacheEndpoint {
...
// mappings goes here
Unfortunately, we've lost an option to have a custom root path for our custom management endpoints (before it was /v1/
)
For back-compatibility, we still want to have default actuator endpoints such as health
, metrics
, env
.. to be under /
base path. e.g. host:<management_port>/health
, but at the same time we still want to support our custom endpoints under /v1/
path, e.g. host:<management_port>/v1/cache
I tried a lot of things, googled
even more, but no success yet.
Is there a way to achieve this?