美文网首页
SpringBoot2.x Actuator监控端点使用

SpringBoot2.x Actuator监控端点使用

作者: 砒霜拌辣椒 | 来源:发表于2020-07-27 19:35 被阅读0次

2.x版本的actuator使用与1.x版本有较大区别,主要有如下规则:

  • SpringBoot2.0要通过actuator暴露端点,必须同时是启用(enabled)和暴露(exposed)的。
  • 所有除了/health/info的端点,默认都是不暴露的。
  • 所有除了/shutdown的端点,默认都是启用的。
  • 默认访问路径http://ip:port/actuator/xxx

端点配置

management:
  endpoint.shutdown.enabled: true # 开启shutdown
  endpoints.web.exposure.include: "*" # 暴露所有端点
  endpoint.health.show-details: always # health健康检查显示详细信息
#  endpoints.web.base-path: /monitor # 监控端点url设置(默认是/actuator,2.0之前是/)
#  server.port: 30101 # 监控端点单独配置(默认就是服务端口)

常用端点可以参考SpringBoot1.x版本。

SpringBoot1.x Actuator监控端点使用

参考链接

代码地址

相关文章

网友评论

      本文标题:SpringBoot2.x Actuator监控端点使用

      本文链接:https://www.haomeiwen.com/subject/srjtrktx.html