
# 暴露所有 HTTP的endpoints(不包含shutdown)
#management.endpoints.web.exposure.include=*
# 只暴露指定 HTTP的endpoint
# 这里只暴露 /actuator/beans和/actuator/mappings 端点
#management.endpoints.web.exposure.include=beans,mappings
## exclude 用来关闭某些endpoints
## exclude 通常会跟include一起用,先include全部endpoints,然后再exclude某些endpoints
# 这里暴露所有的端点中,排除/actuator/beans这个端点
management.endpoints.web.exposure.exclude=beans
management.endpoints.web.exposure.include=*
# 如果要开启/actuator/shutdown,要额外再加这一行
management.endpoint.shutdown.enabled=true
# 原本內建的/actuator/xxx路径,都会变成/manage/xxx,可以用來防止被其他人猜到
management.endpoints.web.base-path=/manage
# 原本內建的/actuator/health路径, 会变成/actuator/healthcheck,可以用來防止被其他人猜到
management.endpoints.web.path-mapping.health=healthcheck
# 指定端口,默认跟server.port一样,可以防止被其他人猜到
management.server.port=10111
对于一些不带参数的端点请求会自动进行缓存,我们可以通过如下方式配置缓存时间
# 下面配置表示 beans 端点的缓存时间为 100s
management.endpoint.beans.cache.time-to-live=100s
# 设置为本地ip,防止远程访问该连接进行关闭服务
# 不允许远程管理连接,安全性考虑
management.server.address=127.0.0.1