Actuator

作者: a9104fed92a0 | 来源:发表于2018-09-06 14:09 被阅读0次

actuator 帮助你在应用程序生产环境时监视和管理应用程序。可以使用HTTP的各种请求来监管,审计,收集应用的运行情况.
项目中增加以下依赖

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

通过在appliction.properties中暴露actuator的监控接口
management.endpoints.web.exposure.include=*,hystrix.stream

启动项目后,看到类似的打印,actuator/** 代表暴露的接口


终端打印

其中actuator自带的监控接口包括:

函数 描述
dump 活动线程
env 环境属性
health 健康检查
info 定制信息
mappings URI路径,在这里可以看到有哪些端点
metrics 查看内存、CPU核心等系统参数
trace 用户请求信息
loggers 日志
/env/{name:.*} 像这种端点,后面带有一个name,这是指获取env中名字为name的那一个参数的值,比如http://localhost:8080/env/local.server.port

自定义Endpoint

相关文章

网友评论

      本文标题:Actuator

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