spring boot 2.x 监控

1.pom依赖

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

2.配置

management.endpoints.web.exposure.include=*

默认只开通了info和health两个接口
配置为*,开通所有的
yml文件配置时加双引号:"*"
3.metrics的监控信息

{
    "names":[
        "jvm.memory.committed",
        "http.server.requests",
        "jvm.buffer.memory.used",
        "jvm.gc.memory.allocated",
        "tomcat.sessions.created",
        "tomcat.sessions.expired",
        "jvm.memory.used",
        "tomcat.global.error",
        "jvm.gc.max.data.size",
        "system.cpu.count",//cpu核数
        "jvm.memory.max",
        "tomcat.global.sent",
        "jvm.buffer.total.capacity",
        "jvm.buffer.count",
        "process.files.max",
        "jvm.threads.daemon",
        "process.start.time",
        "tomcat.sessions.active.max",
        "tomcat.global.request.max",
        "jvm.gc.live.data.size",
        "process.files.open",
        "process.cpu.usage",//进程cpu使用率
        "tomcat.threads.current",
        "tomcat.servlet.request",
        "jvm.gc.pause",
        "process.uptime",//程序运行时间
        "tomcat.threads.busy",
        "system.load.average.1m",
        "tomcat.cache.hit",
        "tomcat.global.request",
        "tomcat.servlet.error",
        "tomcat.servlet.request.max",
        "tomcat.cache.access",
        "tomcat.sessions.active.current",
        "system.cpu.usage",
        "jvm.threads.live",
        "jvm.classes.loaded",
        "jvm.classes.unloaded",
        "jvm.threads.peak",
        "tomcat.threads.config.max",
        "jvm.gc.memory.promoted",
        "tomcat.sessions.rejected",
        "tomcat.global.received",
        "tomcat.sessions.alive.max"
    ]
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值