Mar*_*vic 2 health-monitoring spring-boot spring-rabbitmq spring-boot-actuator
我将spring boot版本从1.4.2升级到1.5.1.我的应用程序取决于RabbitMQ.
在使用版本1.4.2时,健康端点的输出是
{
"status": "UP",
"diskSpace": {
"status": "UP",
"total": 249779191808,
"free": 160644202496,
"threshold": 10485760
},
"rabbit": {
"status": "UP",
"version": "3.6.5"
}
}
Run Code Online (Sandbox Code Playgroud)
升级后,使用1.5.1版输出
{
"status": "UP"
}
Run Code Online (Sandbox Code Playgroud)
因此,磁盘空间和兔子指标不再存在.奇怪的是在日志中,我可以找到:
Registering bean definition for @Bean method org.springframework.boot.actuate.autoconfigure.HealthIndicatorAutoConfiguration$DiskSpaceHealthIndicatorConfiguration.diskSpaceHealthIndicatorProperties()
Registering bean definition for @Bean method org.springframework.boot.actuate.autoconfigure.HealthIndicatorAutoConfiguration$RabbitHealthIndicatorConfiguration.rabbitHealthIndicator()
Run Code Online (Sandbox Code Playgroud)
甚至当我请求/健康端点时,我可以在日志中看到调用RabbitMq
o.s.amqp.rabbit.core.RabbitTemplate - Executing callback on RabbitMQ Channel: Cached Rabbit Channel: AMQChannel(amqp://guest@0:0:0:0:0:0:0:1:5672/,2), conn: Proxy@5292883 Shared Rabbit Connection: SimpleConnection@1aa1a795 [delegate=amqp://guest@0:0:0:0:0:0:0:1:5672/, localPort= 59527]
Run Code Online (Sandbox Code Playgroud)
预计,如果我关闭RabbitMQ实例的响应是
{
"status": "DOWN"
}
Run Code Online (Sandbox Code Playgroud)
在我的application.ymlI中没有任何健康配置,因此使用默认配置.
如何获取健康端点的旧输出?
您需要通过身份验证才能查看所有详细信息.如果您希望内容在未经身份验证的情况下可用,则可以将其添加到您的媒体资源中
management.security.enabled=false
endpoints.health.sensitive=false
Run Code Online (Sandbox Code Playgroud)
更多细节Spring boot Production Ready Monitoring
| 归档时间: |
|
| 查看次数: |
1852 次 |
| 最近记录: |