关于actuator的具体内容参考第21篇,这里不再重复。当时是spring boot 1.x版本,现在spring boot2.x中其主要内容基本没变,只是相关端点配置请求路径有所不同。本篇仅介绍这些变化的配置。
开放端点
1.x需要配置敏感端点,2.x改成了以下配置,* 可开户所有端点。
management.endpoints.web.exposure.include=*
/actuator 前缀
2.x所有端点请求url都需要加 /actuator 前缀
排除端点
如果不想开放某些端点,比如beans和env
management.endpoints.web.exposure.exclude=beans,env