【问题标题】:Actuators does not work执行器不工作
【发布时间】:2016-05-12 09:11:41
【问题描述】:

我正在尝试在我的 spring boot 应用程序中设置执行器端点,但我无法获得我在 application.yml 中设置的值。这是我目前的配置:

src/main/resources/application.yml

info.app:
  description: mydescription
  name: myname
  version: 1.0

management.contextPath: /rest/internal/application

但是,当我尝试访问端点时,我只能得到这个:

rest call to http://localhost:8090/rest/internal/application/info

{
    "Manifest-Version":"1.0",
    "Created-By":"1.6.0_18 (Sun Microsystems Inc.)"
}

那么,我做错了什么?

【问题讨论】:

    标签: spring rest spring-boot spring-boot-actuator


    【解决方案1】:

    .app 后缀有问题,请将info 部分更改为 i.e.

    info:
      description: mydescription
      name: myname
      version: 1.0
    

    The documentation 声明:

    您可以通过设置自定义 info 端点公开的数据 info.* 弹簧属性。信息下的所有环境属性 密钥会自动暴露。

    以下是 yaml 中的示例:

    info:
      app:
        name: MyService
        description: My awesome service
        version: 1.0.0
    

    【讨论】:

      猜你喜欢
      • 2014-09-11
      • 2013-04-16
      • 2017-11-10
      • 1970-01-01
      • 1970-01-01
      • 2018-01-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多