一、用到的工具
 
二、安装和运行Prometheus
  1. 官网下载prometheus-2.9.1.linux-amd64.tar.gz并解压
       2. 配置(修改Prometheus目录下的prometheus.yml文件)
 
       3. 启动(nohup ./prometheus --config.file=prometheus.yml &)
 
       4. 访问(localhost:9090)
 
 
三、安装和运行Granfana
 
        yum localinstall grafana-6.2.5-1.x86_64.rpm  
 
     2. 启动(service grafana-server start)
 
     3. 访问(http://localhost:3000/,admin/admin)
 
     4. 添加Prometheus数据源   
 
     4. 添加Dashboard(4701)
 
 
四、创建SpringBoot应用
 
1. 添加如下依赖
<!--监控 begin-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!--Micrometer-->
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
<!--监控 end-->

2. 配置监控

spring.application.name=bounter-monitor

## 暴露所有的actuator endpoints
management.endpoints.web.exposure.include=* ## Grafana上的应用名字
management.metrics.tags.application=${spring.application.name}
3. 打包并在服务器上运行
    nohup java -jar bounter-monitor &
 
4. 配置Prometheus endpoint
  # SpringBoot Application
- job_name: 'bounter-monitor'
scrape_interval: 5s
metrics_path: '/actuator/prometheus'
static_configs:
- targets: ['localhost:8080']
 
在做好以上步骤后,重启Prometheus就可以在Grafana看到jvm 监控数据了,如下图:
 
 
是不是觉得挺简单哉!那就赶快自己动手试试吧!
 
参考资料:

Prometheus + Grafana 监控SpringBoot应用的更多相关文章

  1. 【Springboot】用Prometheus+Grafana监控Springboot应用

    1 简介 项目越做越发觉得,任何一个系统上线,运维监控都太重要了.关于Springboot微服务的监控,之前写过[Springboot]用Springboot Admin监控你的微服务应用,这个方案可 ...

  2. Prometheus+Grafana监控SpringBoot

    Prometheus+Grafana监控SpringBoot 一.Prometheus监控SpringBoot 1.1 pom.xml添加依赖 1.2 修改application.yml配置文件 1. ...

  3. 基于Docker+Prometheus+Grafana监控SpringBoot健康信息

    在微服务体系当中,监控是必不可少的.当系统环境超过指定的阀值以后,需要提醒指定的运维人员或开发人员进行有效的防范,从而降低系统宕机的风险.在CNCF云计算平台中,Prometheus+Grafana是 ...

  4. cAdvisor+Prometheus+Grafana监控docker

    cAdvisor+Prometheus+Grafana监控docker 一.cAdvisor(需要监控的主机都要安装) 官方地址:https://github.com/google/cadvisor ...

  5. [转帖]Prometheus+Grafana监控Kubernetes

    原博客的位置: https://blog.csdn.net/shenhonglei1234/article/details/80503353 感谢原作者 这里记录一下自己试验过程中遇到的问题: . 自 ...

  6. prometheus+grafana监控redis

    prometheus+grafana监控redis redis安装配置 https://www.cnblogs.com/autohome7390/p/6433956.html redis_export ...

  7. prometheus+grafana监控mysql

    prometheus+grafana监控mysql 1.安装配置MySQL官方的 Yum Repository(有mysql只需设置监控账号即可) [root@localhost ~]# wget - ...

  8. [转帖]安装prometheus+grafana监控mysql redis kubernetes等

    安装prometheus+grafana监控mysql redis kubernetes等 https://www.cnblogs.com/sfnz/p/6566951.html plug 的模式进行 ...

  9. Prometheus + Grafana 监控系统搭

    本文主要介绍基于Prometheus + Grafana 监控Linux服务器. 一.Prometheus 概述(略) 与其他监控系统对比 1 Prometheus vs. Zabbix Zabbix ...

随机推荐

  1. Ta还没有分享呢,过段时间再来看看吧~ 解决办法

    自己摸索出来的.只能查看以前分享的奥.   找到要查看用户的id号   利用特百度搜索工具实现检索 http://www.tebaidu.com/user--1.html 将红字部分替换为刚才复制的u ...

  2. csr_matrix用法

    1 csr_matrix默认对未填充的位置置为0, row = [0, 0, 0, 1, 1, 1, 2, 2, 2] # 行指标 col = [0, 1, 2, 0, 1, 2, 0, 1, 2] ...

  3. base64编解码的两个函数

    base64编解码的两个函数,声明,参考网络上的代码实现. unsigned char *base64_encode(unsigned char *str, long* lpBufLen) { lon ...

  4. JavaScript文件中; !function (win, undefined) {}(window);的意义

    +function (){}-function (){}!function (){}~function (){}(function (){})() 这种写法可以保证匿名函数立即运行且运行一次 传入的 ...

  5. python+selenium元素定位——8种方法

    定位元素,selenium提供了8中元素定位方法: (1)find_element_by_id() :html规定,id在html中必须是唯一的,有点类似于身份证号 (2)find_element_b ...

  6. <每日一题> Day3:CodeForces-1141B.MaximalContinuousRest(简单题)

    题目链接 参考代码: #include <iostream> #include <algorithm> using namespace std; + ; int value[m ...

  7. React入门教程1---初见面

    React入门教程1---初见面:https://blog.csdn.net/solar_lan/article/details/82799248 React 教程 React 是一个用于构建用户界面 ...

  8. Python自学第二天学习之《元组与字典》

    一.  元组:tuple类型,元组一级元素 不能修改 不能增加 不能删除,是有序的. 格式 :tu=(1,2,3,4,5,6) 1.类型转换: #字符串转换成元组 b=“123” c=tuple(b) ...

  9. jQuery 的attr()与css()的区别

    attr是attribute的缩写,意思是标签属性. css是,样式,意思是元素的style样式的 我的理解是: attr是操作元素的   属性 css是操作元素的  style属性 前者可以修改&l ...

  10. jQ:"对象不支持“first”属性或方法"IE内核下不兼容first()、chilrdren()方法的处理

    场景:需要查找某元素下的第一个子集,使用了如下语句: $("#left_1>tbody").find(".menuTr").first().addClas ...