我从1.5.10迁移到了Spring Boot 2.0.0 RC1,并被最新版本的执行器卡住了。如何启用暴露并启用所有执行器端点?
唯一公开的端点是:
{ "_links": { "self": { "href": "http://127.0.0.1:8080/actuator", "templated": false }, "health": { "href": "http://127.0.0.1:8080/actuator/health", "templated": false }, "info": { "href": "http://127.0.0.1:8080/actuator/info", "templated": false } } }
这是我的application.properties档案。有任何想法吗?
application.properties
#The three first ones seem to be obsolete endpoints.configprops.enabled=true endpoints.beans.enabled=true endpoints.shutdown.enabled=true management.endpoints.enabled-by-default=true management.endpoints.sensitive=false management.endpoints.enabled=true management.endpoint.configprops.enabled=true management.endpoint.beans.enabled=true management.endpoint.shutdown.enabled=true management.endpoints.web.exposure.include=*
对于Spring Boot 2.0.0.RC1,必须启用执行器端点并暴露2)执行器端点。
默认情况下,所有端点shutdown都被启用且仅被启用,health并且info被公开。
shutdown
health
info
在您的情况下,以下方法应该起作用:
management.endpoints.web.expose=* # if you'd like to expose shutdown: # management.endpoint.shutdown.enabled=true
请注意,从Spring Boot 2.0.0.RC2开始,这再次发生了变化:
management.endpoints.web.exposure.include=* # if you'd like to expose shutdown: # management.endpoint.shutdown.enabled=true
毫无疑问,专用的迁移指南始终是最新的变化。
编辑
为了方便复制和粘贴,以下是“ yaml”版本-从Spring Boot 2.0.0.RC2开始:
management: endpoints: web: exposure: include: "*"
之前:
management: endpoints: web: expose: "*"