【问题标题】:Getting system info from Spring Boot Actuator从 Spring Boot Actuator 获取系统信息
【发布时间】:2019-03-23 12:02:17
【问题描述】:

我有一个 SpringBoot 应用程序。 2.1.3.RELEASE由JWT担保,我想添加一个执行器。我添加了这个依赖

<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency> 

我已将此属性添加到 application.properties 文件中

management.endpoints.web.exposure.include=health,info
management.endpoint.health.show-details=always

当我访问/actuator 时,我收到了这样的回复:

{
    "_links": {
        "self": {
            "href": "http://127.0.0.1:1133/tdk/actuator",
            "templated": false
        },
        "health": {
            "href": "http://127.0.0.1:1133/tdk/actuator/health",
            "templated": false
        },
        "health-component": {
            "href": "http://127.0.0.1:1133/tdk/actuator/health/{component}",
            "templated": true
        },
        "health-component-instance": {
            "href": "http://127.0.0.1:1133/tdk/actuator/health/{component}/{instance}",
            "templated": true
        },
        "info": {
            "href": "http://127.0.0.1:1133/tdk/actuator/info",
            "templated": false
        }
    }
}

但是当我访问 http://127.0.0.1:1133/tdk/actuator/info 时,我只有

{}

【问题讨论】:

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


    【解决方案1】:

    您需要添加build-info 目标来生成构建信息。 see doc here 了解更多信息。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-07
      • 1970-01-01
      • 2014-07-13
      • 1970-01-01
      • 1970-01-01
      • 2018-04-10
      相关资源
      最近更新 更多