Skip to content

📊 系统监控指南

📖 功能介绍

TIP

系统监控功能提供全方位的性能指标监控,包括请求TPS、接口响应时间、JVM状态等关键指标,帮助您实时掌握系统运行状况。

⚙️ 配置说明

1. 请求统计配置

yaml
wueasy:
  filter:
    metrics:
      enabled: true    # 启用请求统计,默认false

2. 监控端点配置

yaml
management:
  # 端点基础配置
  endpoints:
    web:
      base-path: /actuator    # 端点访问前缀
      exposure:
        include: '*'          # 暴露所有端点
        exclude: ['shutdown'] # 排除关闭端点
    
    # JMX配置
    jmx:
      exposure:
        include: '*'
        exclude: ['shutdown']
  
  # 监控服务端口
  server:
    port: 8088
  
  # 指标配置
  metrics:
    tags:
      application: ${spring.application.name}
  
  # 请求统计配置
  endpoint:
    requeststats:
      cache:
        time-to-live: 5s     # 缓存时间

📈 监控指标

1. 核心指标

指标类型说明监控维度
TPS每秒事务处理量接口级别
响应时间请求处理耗时最大/平均/最小
错误率请求失败比例异常类型
JVM状态虚拟机运行状态内存/线程/GC

2. 可用端点

端点路径说明
健康检查/actuator/health系统健康状态
性能指标/actuator/metrics系统性能指标
环境信息/actuator/env配置环境信息
请求统计/actuator/stats.html请求监控面板

🖥️ 访问方式

1. 监控面板

访问地址为:http://{host}:{port}/actuator/stats.html

2. 示例