Prometheus+Grafana多方位监控-Java应用监控

安装

#pom导入
<dependency>
    <groupId>io.micrometer</groupId>
    <artifactId>micrometer-registry-prometheus</artifactId>
</dependency>

#yml配置
management:
  endpoints:
    web:
      exposure:
        include: "*"
  endpoint:
    health:
      show-details: ALWAYS

监控配置

#抓取配置
scrape_configs:

  #Java程序监控
  - job_name: service
    metrics_path: "/actuator/prometheus"
    static_configs:

      - targets: ["localhost:8090"]
        labels:
          application: applciation1

      - targets: ["localhost:9999"]
        labels:
          application: applciation2

监控大盘

登陆grafana新建看板导入

https://grafana.com/grafana/dashboards/4701-jvm-micrometer/

https://grafana.com/grafana/dashboards/12900-springboot-apm-dashboard/

效果演示

请添加图片描述

请添加图片描述

上一篇:基于uniapp+微信小程序的智能停车场管理小程序,附源码-1 简介


下一篇:Debian 12 tomcat 9 日志信息 中文显示乱码