如何启用执行器中的所有端点(Spring Boot 2.0.0 RC1) [英] How to enable all endpoints in actuator (Spring Boot 2.0.0 RC1)

查看:198
本文介绍了如何启用执行器中的所有端点(Spring Boot 2.0.0 RC1)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从1.5.10迁移到了Spring Boot 2.0.0 RC1,并被最新版本的执行器卡住了.如何启用暴露并启用所有执行器端点?

I moved to Spring Boot 2.0.0 RC1 from 1.5.10 and I am stuck with actuator in the latest version. How can I enable expose and enable all actuator endpoints?

唯一公开的端点是:

{
  "_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文件.有什么想法吗?

This is my application.properties files. Any ideas?

#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)执行器端点.

With Spring Boot 2.0.0.RC1, actuator endpoints must be 1) enabled and 2) exposed.

默认情况下,除了shutdown之外的所有端点都已启用,并且仅公开了healthinfo.

By default, all endpoints but shutdown are enabled and only health and info are exposed.

在您的情况下,以下方法应该起作用:

In your case, the following should work:

management.endpoints.web.expose=*
# if you'd like to expose shutdown:
# management.endpoint.shutdown.enabled=true

请注意,从Spring Boot 2.0.0.RC2开始,此更改(再次!):

Note that this changes (again!) as of Spring Boot 2.0.0.RC2:

management.endpoints.web.exposure.include=*
# if you'd like to expose shutdown:
# management.endpoint.shutdown.enabled=true

有疑问,专用迁移指南始终是最新的.

In doubt, the dedicated migration guide is always up-to-date with the latest changes.

修改

为便于复制和粘贴,以下是"yaml"版本-从Spring Boot 2.0.0.RC2开始:

For easy copy and paste, here's the `yaml´ versions - as of Spring Boot 2.0.0.RC2:

management:
  endpoints:
    web:
      exposure:
        include: "*"

之前:

management:
  endpoints:
    web:
      expose: "*"

这篇关于如何启用执行器中的所有端点(Spring Boot 2.0.0 RC1)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆