Search code examples
springspring-bootspring-boot-actuator

Add prefix to all Spring Boot actuator endpoints


Is there an easy way to add a prefix to all the Actuator endpoints?

/env ->     /secure/env
/health ->  /secure/health
/info ->    /secure/info
...

Solution

  • Jesper's answer is completely right, but I was looking for a more straightforward way of prefixing all endpoints, and it can be done with management.context-path, e.g.:

    management:
      context-path: /secure
    
    -> /secure/env
    -> /secure/health
    ...