HIPPO-4J 在线文档 HIPPO-4J 在线文档
首页
  • 简介
  • 架构设计
  • 快速上手
  • 通知报警
  • hippo4j-core

    • 接入文档
    • 线程池监控
  • hippo4j-server

    • 接入文档
    • 服务端配置手册
  • 运维指南

    • 直接部署
    • 控制台手册
    • 版本号手册
  • 其它

    • 加群沟通
常见问题
支持
Gitee (opens new window)
GitHub (opens new window)
首页
  • 简介
  • 架构设计
  • 快速上手
  • 通知报警
  • hippo4j-core

    • 接入文档
    • 线程池监控
  • hippo4j-server

    • 接入文档
    • 服务端配置手册
  • 运维指南

    • 直接部署
    • 控制台手册
    • 版本号手册
  • 其它

    • 加群沟通
常见问题
支持
Gitee (opens new window)
GitHub (opens new window)
  • 指南

    • 简介
    • 架构设计
    • 快速上手
    • 通知报警
  • hippo4j-core

    • 接入文档
    • 线程池监控
      • 准备条件
      • 线程池监控
  • hippo4j-server

    • 接入文档
    • 服务端配置手册
  • 运维指南

    • 直接部署
    • 控制台手册
    • 版本号手册
  • 其它

    • 加群沟通

线程池监控

# 准备条件

已完成 hippo4j-core 的 接入工作 。

已安装 Grafana + Prometheus 服务。

# 线程池监控

1、引入 actuator。spring 2.x 一般都有版本指定,所以这里不用写版本号。

<dependency>
    <groupId>io.micrometer</groupId>
    <artifactId>micrometer-registry-prometheus</artifactId>
</dependency>

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

2、添加相关配置。

management:
  metrics:
    export:
      prometheus:
        enabled: true
  server:
    port: 29999 # 自选
  endpoints:
    web:
      exposure:
        include: '*' # 测试使用,开启了所有端点,生产环境不建议 *
spring:
  dynamic:
    thread-pool:
      collect-type: metric

3、Prometheus 配置任务,配置成功后需重启。

- job_name: 'dynamic-thread-pool-job'
    scrape_interval: 5s
    metrics_path: '/actuator/prometheus'
    static_configs:
    - targets: ['127.0.0.1:29999'] # 如果是 docker 部署,这里需要写本机的 IP

4、Grafana 导入数据源。

5、Grafana DashBoard 配置。

关注公众号 龙台的技术笔记,回复:监控,获取 DashBoard JSON。

获取到 JSON 文件后,导入至 Grafana。

即可使用 Hippo4j 线程池监控大屏。

接入文档
接入文档

← 接入文档 接入文档→

Theme by Vdoing | Copyright © 2021-2022 Acmenlt | Apache License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式
×