Add prefix to all Spring Boot actuator endpoints

codependent picture codependent · Jul 8, 2016 · Viewed 16.9k times · Source

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

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

Answer

codependent picture codependent · Jul 8, 2016

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
...