spring boot 2.0.0下spring-boot-starter-actuator默认endpoints未打开

编程知识 更新时间:2023-04-05 05:00:41

最近在spring boot 2.0.0下配置spring-boot-starter-actuator,加入依赖后启动,发现spring-boot-starter-actuator2.0.0 RELEASE进行了重构,与之前的spring-boot-actuator的使用大有区别

区别1:启动后只显示

/actuator

/actuator/info

/actuator/health

其他的endpoints都没有显示出来

查看文档 https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-endpoints.html

怀疑可能是未enable或未expose造成的

在application.properties中按照文档添加内容

management.endpoints.web.exposure.include=*

于是出现了久违的log

区别2:显示所有健康状态,需要加配置

management.endpoint.health.show-details=always

结果:


从源码可以看到其集成了多个HealthIndicator


更多推荐

spring boot 2.0.0下spring-boot-starter-actuator默认endpoints未打开

本文发布于:2023-04-05 05:00:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/d3471852a6d3c26a97167c448fbb6862.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:boot   spring   endpoints   actuator   starter

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 44911文章数
  • 14阅读数
  • 0评论数