健康终点不在弹簧启动器执行器服务中工作

时间:2018-02-28 14:14:14

标签: spring-boot-actuator health-monitoring

您好我使用的是春季启动版 - 2.0.0.RC1。我有简单的服务运行@port 9400.

我的application.properties具有以下配置:

spring.main.banner-mode = CONSOLE
spring.profiles.active  = ${profile:local}

server.compression.enabled = true
server.compression.min-response-size = 1
server.compression.mime-types = application/json,application/xml,text/xml,text/plain

banner.charset              = UTF-8

management.endpoints.health.show-details=true
management.server.address: 127.0.0.1
management.endpoints.web.expose: health,info,metrics,mappings,trace
management.endpoints.health.show-details: true
management.endpoints.health.time-to-live: 2000
management.security.enabled: false
management.health.defaults.enabled: false
management.health.diskspace.enabled: true

我的build.gradle有:

dependencies {
    // Spring Boot
    compile group: 'org.springframework.boot', name: 'spring-boot-starter-webflux', version: springBootVersion
    compile group: 'org.springframework.boot', name: 'spring-boot-starter-actuator', version: springBootVersion
}

我的gradle.properties:

springBootVersion    = 2.0.0.RC1

当我指向http://127.0.0.1:9400/health

我将错误屏幕作为附加快照。

我缺少什么?enter image description here

2 个答案:

答案 0 :(得分:2)

您提供的show-details值不是有效值... 无论如何,在Spring Boot 2.0中,执行器端点(如健康状态)被重新映射到/ actuator / *。 现在,健康状况位于/执行/健康。

https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0.0-RC2-Release-Notes#health-endpoint

中的发布说明中的更多信息

答案 1 :(得分:0)

只需在application.properties文件中添加以下属性:

management.health.defaults.enabled=false